MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Kernel Functions for Drivers                   usbgetstatus(9F)



NAME
     usbgetstatus     -     Get     status     of     a     USB
     device/endpoint/interface

SYNOPSIS
     #include 



     int usbgetstatus(devinfot *dip, usbpipehandlet pipehandle,
          uintt requesttype, uintt which, uint16t *status,
          usbflagst flags);


INTERFACE LEVEL
     Solaris DI specific (Solaris DI)

PARAMETERS
     dip             Pointer to device's devinfo structure.


     pipehandle     Default control pipe handle on which request
                     is made.


     requesttype    bmRequestType. Either:

                     USBDEVREQRCPTDEV - Get device status.

                     USBDEVREQRCPTIF - Get interface status.

                     USBDEVREQRCPTEP - Get endpoint status.


     which           Device, interface or endpoint from which  to
                     get  status.  Either  number of interface or
                     endpoint, or  0 if device status requested.


     status          Address into which the status is written.


     flags           None are recognized.


DESCRIPTION
     The usbgetstatus() function returns the status of  a  dev-
     ice,  interface  or  endpoint.   All status requests use the
     default  control  pipe.   Length   of   data   returned   is
     USBGETSTATUSLEN   bytes.    Always  block  and  wait  for
     resources if not available, regardless of  the  flags  argu-
     ment.



SunOS 5.11           Last change: 5 Jan 2004                    1






Kernel Functions for Drivers                   usbgetstatus(9F)



     When the  requesttype  recipient  is  USBDEVREQRCPTDEV,
     device  status  is  requested. Status returned includes bits
     for USBDEVSLFPWRDSTATUS  (device  is   currently   self-
     powered)   and  USBDEVRWAKEUPSTATUS  (device  has  remote
     wakeup enabled).  A  set  bit  indicates  the  corresponding
     status.


     When  the  requesttype  is  USBDEVREQRCPTEP,   endpoint
     status  is  requested.  Status  returned  includes  bits for
     USBEPHALTSTATUS (endpoint is halted). A set bit indicates
     the corresponding status.


     When  the  requesttype  is  USBDEVREQRCPTIF,  interface
     status is requested and USBIFSTATUS (zero) is returned.

RETURN VALUES
     USBSUCES         Status  returned  successfully  in   the
                         status argument.


     USBINVALIDARGS    Status pointer and/or  dip  argument  is
                         NUL.


     USBINVALIDPIPE    Pipe handle is NUL.


     USBFAILURE         Status not returned successfully.


CONTEXT
     May be called from user or kernel context.

EXAMPLES
         uint16t status;

         if (usbgetstatus(
             dip, pipehandle, USBDEVREQRCPTDEV, 0 &status, 0) ==
             USBSUCES) {
                 if (status & USBDEVSLFPWRDSTATUS) {
                         cmnerr (CEWARN,
                             "%s%d: USB device is running on its own power.",
                             ddidrivername(dip), ddigetinstance(dip));
                 }
         }


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



SunOS 5.11           Last change: 5 Jan 2004                    2






Kernel Functions for Drivers                   usbgetstatus(9F)



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


SEE ALSO
     attributes(5),   usbclrfeature(9F),    usbgetaltif(9F),
     usbpipegetstate(9F), usbgetcfg(9F),









































SunOS 5.11           Last change: 5 Jan 2004                    3



OpenSolaris man pages main menu

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