MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers               usbpipebulkxfer(9F)



NAME
     usbpipebulkxfer - USB bulk transfer function

SYNOPSIS
     #include 



     int usbpipebulkxfer(usbpipehandlet pipehandle,
          usbbulkreqt *request, usbflagst flags);


INTERFACE LEVEL
     Solaris DI specific (Solaris DI)

PARAMETERS
     pipehandle    Bulk pipe handle on which request is made.


     request        Pointer to bulk transfer request.


     flags          USBFLAGSLEP is the only flag  recognized.
                    Wait for request to complete.


DESCRIPTION
     The usbpipebulkxfer() function requests the  USBA  frame-
     work  to  perform  a  transfer  through a USB bulk pipe. The
     request is passed to the host controller driver (HCD), which
     performs the necessary transactions to complete the request.
     Requests  are  synchronous  when  USBFLAGSLEP  has  been
     specified  in flags. Calls for synchronous requests will not
     return until their transaction has  completed.  Asynchronous
     requests  (made without specifying the USBFLAGSLEP flag)
     notify the caller of their completion via a  callback  func-
     tion.


     Requests for bulk transfers  must  have  mblks  attached  to
     store  data.  Allocate  an  mblk  for data when a request is
     allocated  via  usballocbulkreq(9F)  by  passing  a  non-
     negative value for the len argument.

RETURN VALUES
     USBSUCES              Transfer was successful.


     USBINVALIDARGS         Request is NUL.






SunOS 5.11           Last change: 3 Aug 2006                    1






Kernel Functions for Drivers               usbpipebulkxfer(9F)



     USBINVALIDCONTEXT      Called from interrupt context  with
                              the USBFLAGSLEP flag set.


     USBINVALIDREQUEST      The request has been freed or  oth-
                              erwise invalidated.

                              A  set  of  conflicting  attributes
                              were         specified.         See
                              usbbulkrequest(9S).

                              The normal and/or  exception  call-
                              back  was  NUL and USBFLAGSLEP
                              was not set.

                              Data space is  not  provided  to  a
                              non-zero length bulk request:

                                (bulkdata == NUL and bulklen != 0)



     USBINVALIDPIPE         Pipe handle is NUL or invalid.

                              Pipe is closing or closed.


     USBPIPEROR           Pipe handle refers to a pipe  which
                              is   in   the  USBPIPESTATEROR
                              state.


     USBNORESOURCES         Memory,   descriptors   or    other
                              resources are unavailable.


     USBHCHARDWAREROR    Host controller is in error state.


     USBFAILURE              An asynchronous transfer failed  or
                              an internal error occurred.

                              A bulk request requested  too  much
                              data:

                                (length > usbgetmaxbulkxfer size())

                              The pipe is in a  unsuitable  state
                              (error, busy, not ready).






SunOS 5.11           Last change: 3 Aug 2006                    2






Kernel Functions for Drivers               usbpipebulkxfer(9F)



     Additional  status  information  may  be  available  in  the
     bulkcompletionreason   and  bulkcbflags  fields  of  the
     request.   Please    see    usbcompletionreason(9S)    and
     usbcallbackflags(9S) for more information.

CONTEXT
     May be called from kernel or user context without regard  to
     arguments.  May  be  called from interrupt context only when
     the USBFLAGSLEP flag is clear.

EXAMPLES
          /* Allocate, initialize and issue a synchronous bulk request. */

           usbbulkreqt bulkreq;
           mblkt *mblk;

           bulkreq = usballocbulkreq(dip, bp->bbcount, USBFLAGSLEP);

           bulkreq->bulkattributes   = USBATRSAUTOCLEARING;
           mblk = bulkreq->bulkdata;
           bcopy(buffer, mblk->bwptr, bp->bbcount);
           mblk->bwptr ]= bp->bbcount;

           if ((rval = usbpipebulkxfer(pipe, bulkreq, USBFLAGSLEP))
               != USBSUCES) {
                   cmnerr (CEWARN, "%s%d: Error writing bulk data.",
                       ddidrivername(dip), ddigetinstance(dip));
           }



ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:





















SunOS 5.11           Last change: 3 Aug 2006                    3






Kernel Functions for Drivers               usbpipebulkxfer(9F)



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Architecture                 PCI-based systems           
    
     Interface stability          Committed                   
    
     Availability                 SUNWusb                     
    


SEE ALSO
     attributes(5),    usballocrequest(9F),    usbgetcfg(9F),
     usbgetstatus(9F),                  usbpipectrlxfer(9F),
     usbpipegetstate(9F),              usbpipeintrxfer(9F),
     usbpipeisocxfer(9F),                   usbpipeopen(9F),
     usbpipereset(9F),                    usbbulkrequest(9S),
     usbcallbackflags(9S),           usbcompletionreason(9S),
     usbctrlrequest(9S),                  usbintrrequest(9S),
     usbisocrequest(9S)



































SunOS 5.11           Last change: 3 Aug 2006                    4



OpenSolaris man pages main menu

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