MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers               ddidmanextcookie(9F)



NAME
     ddidmanextcookie - retrieve subsequent DMA cookie

SYNOPSIS
     #include 
     #include 



     void ddidmanextcookie(ddidmahandlet handle,
          ddidmacookiet *cookiep);


PARAMETERS
     handle     The handle previously  allocated  by  a  call  to
                ddidmaallochandle(9F).


     cookiep    A pointer to a  ddidmacookie(9S) structure.


INTERFACE LEVEL
     Solaris DI specific (Solaris DI).

DESCRIPTION
     ddidmanextcookie() retrieves subsequent  DMA cookies for a
     DMA    object.      ddidmanextcookie()    fills   in   the
     ddidmacookie(9S) structure pointed  to  by   cookiep.  The
     ddidmacookie(9S) structure must be allocated prior to cal-
     ling  ddidmanextcookie().


     The      DMA      cookie       count       returned       by
     ddidmabufbindhandle(9F),   ddidmaaddrbindhandle(9F),
     or ddidmagetwin(9F) indicates the number of DMA cookies  a
     DMA  object  consists of. If the resulting cookie count,  N,
     is larger than 1,  ddidmanextcookie() must be  called  N-1
     times to retrieve all  DMA cookies.

CONTEXT
     ddidmanextcookie() can be called  from  user,  kernel,  or
     interrupt context.

EXAMPLES
     Example 1 Process a scatter-gather list of I/O requests.


     This example demonstrates the use  of   ddidmanextcookie()
     to process a scatter-gather list of I/O requests.


       /* setup scatter-gather list with multiple DMA cookies */



SunOS 5.11          Last change: 26 Sep 1994                    1






Kernel Functions for Drivers               ddidmanextcookie(9F)



       ddidmacookiet  dmacookie;
       uintt            ccount;
       ...

       status = ddidmabufbindhandle(handle, bp, DIDMAREAD,
            NUL, NUL, &dmacookie, &ccount);

       if (status == DIDMAMAPED) {

            /* program DMA engine with first cookie */

            while (--ccount > 0) {
                 ddidmanextcookie(handle, &dmacookie);
                 /* program DMA engine with next cookie */
            }
       }
       ...


SEE ALSO
     ddidmaaddrbindhandle(9F),      ddidmaallochandle(9F),
     ddidmabufbindhandle(9F),      ddidmaunbindhandle(9F),
     ddidmacookie(9S)


     Writing Device Drivers





























SunOS 5.11          Last change: 26 Sep 1994                    2



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™