1scsi_dmaget(9F) Kernel Functions for Drivers scsi_dmaget(9F)
2
3
4
6 scsi_dmaget, scsi_dmafree - SCSI dma utility routines
7
9 #include <sys/scsi/scsi.h>
10
11
12
13 struct scsi_pkt *scsi_dmaget(struct scsi_pkt *pkt,
14 opaque_t dmatoken, int(*callback)(void));
15
16
17 void scsi_dmafree(struct scsi_pkt *pkt);
18
19
21 These interfaces are obsolete. Use scsi_init_pkt(9F) instead of
22 scsi_dmaget(). Use scsi_destroy_pkt(9F) instead of scsi_dmafree().
23
25 pkt A pointer to a scsi_pkt(9S) structure.
26
27
28 dmatoken Pointer to an implementation dependent object.
29
30
31 callback Pointer to a callback function, or NULL_FUNC or SLEEP_FUNC.
32
33
35 The scsi_dmaget() function allocates DMA resources for an already allo‐
36 cated SCSI packet. pkt is a pointer to the previously allocated SCSI
37 packet (see scsi_pktalloc(9F)).
38
39
40 The dmatoken parameter is a pointer to an implementation dependent
41 object which defines the length, direction, and address of the data
42 transfer associated with this SCSI packet (command). The dmatoken must
43 be a pointer to a buf(9S) structure. If dmatoken is NULL, no resources
44 are allocated.
45
46
47 The callback parameter indicates what scsi_dmaget() should do when
48 resources are not available:
49
50 NULL_FUNC Do not wait for resources. Return a NULL pointer.
51
52
53 SLEEP_FUNC Wait indefinitely for resources.
54
55
56 Other Values callback points to a function which is called when
57 resources may have become available. callback must
58 return either 0 (indicating that it attempted to allo‐
59 cate resources but failed to do so again), in which
60 case it is put back on a list to be called again later,
61 or 1 indicating either success in allocating resources
62 or indicating that it no longer cares for a retry.
63
64
65
66 The scsi_dmafree() function frees the DMA resources associated with the
67 SCSI packet. The packet itself remains allocated.
68
70 The scsi_dmaget() function returns a pointer to a scsi_pkt on success.
71 It returns NULL if resources are not available.
72
74 If callback is SLEEP_FUNC, then this routine may only be called from
75 user or kernel context. Otherwise, it may be called from user, kernel,
76 or interrupt context. The callback function may not block or call rou‐
77 tines that block.
78
79
80 The scsi_dmafree() function can be called from user, interrupt, or ker‐
81 nel context.
82
84 See attributes(5) for a description of the following attributes:
85
86
87
88
89 ┌─────────────────────────────┬─────────────────────────────┐
90 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
91 ├─────────────────────────────┼─────────────────────────────┤
92 │Stability Level │Obsolete │
93 └─────────────────────────────┴─────────────────────────────┘
94
96 attributes(5), scsi_pktalloc(9F), scsi_pktfree(9F), scsi_resalloc(9F),
97 scsi_resfree(9F), buf(9S), scsi_pkt(9S)
98
99
100 Writing Device Drivers
101
103 The scsi_dmaget() and scsi_dmafree() functions are obsolete and will be
104 discontinued in a future release. These functions have been replaced
105 by, respectively, scsi_init_pkt(9F) and scsi_destroy_pkt(9F).
106
107
108
109SunOS 5.11 16 Jan 2006 scsi_dmaget(9F)