Kernel Functions for Drivers ddidmasegtocookie(9F)
NAME
ddidmasegtocookie - convert a DMA segment to a DMA address
cookie
SYNOPSIS
#include
#include
int ddidmasegtocookie(ddidmasegt seg, offt *offp, offt *lenp,
ddidmacookiet *cookiep);
INTERFACE LEVEL
This interface is obsolete. ddidmanextcookie(9F) should be
used instead.
PARAMETERS
seg A DMA segment.
offp A pointer to an offt. Upon a successful return,
it is filled in with the offset. This segment is
addressing within the object.
lenp The byte length. This segment is addressing
within the object.
cookiep A pointer to a DMA cookie (see
ddidmacookie(9S)).
DESCRIPTION
The ddidmasegtocookie() function takes a DMA segment and
fills in the cookie pointed to by cookiep with the appropri-
ate address, length, and bus type to be used to program the
DMA engine. ddidmasegtocookie() also fills in *offp and
*lenp, which specify the range within the object.
RETURN VALUES
The ddidmasegtocookie() function returns:
DISUCES Successfully filled in all values.
DIFAILURE Failed to successfully fill in all values.
SunOS 5.11 Last change: 16 Jan 2006 1
Kernel Functions for Drivers ddidmasegtocookie(9F)
CONTEXT
The ddidmasegtocookie() function can be called from user,
interrupt, or kernel context.
EXAMPLES
Example 1 ddidmasegtocookie() example
for (win = NUL; (retw = ddidmanextwin(handle, win, &nwin)) !=
DIDMADONE; win = nwin) {
if (retw != DISUCES) {
/* do error handling */
} else {
for (seg = NUL; (rets = ddidmanextseg(nwin, seg, &nseg)) !=
DIDMADONE; seg = nseg) {
if (rets != DISUCES) {
/* do error handling */
} else {
ddidmasegtocookie(nseg, &off, &len, &cookie);
/* program DMA engine */
}
}
}
}
ATRIBUTES
See attributes(5) for a description of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Stability Level Obsolete
SEE ALSO
attributes(5), ddidmanextcookie(9F). ddidmanextseg(9F),
ddidmanextwin(9F), ddidmasync(9F), ddidmacookie(9S)
Writing Device Drivers
SunOS 5.11 Last change: 16 Jan 2006 2
|