1usb_get_status(9F)       Kernel Functions for Drivers       usb_get_status(9F)
2
3
4

NAME

6       usb_get_status - Get status of a USB device/endpoint/interface
7

SYNOPSIS

9       #include <sys/usb/usba.h>
10
11
12
13       int usb_get_status(dev_info_t *dip, usb_pipe_handle_t pipe_handle,
14            uint_t request_type, uint_t which, uint16_t *status,
15            usb_flags_t flags);
16
17

INTERFACE LEVEL

19       Solaris DDI specific (Solaris DDI)
20

PARAMETERS

22       dip             Pointer to device's dev_info structure.
23
24
25       pipe_handle     Default control pipe handle on which request is made.
26
27
28       request_type    bmRequestType. Either:
29
30                       USB_DEV_REQ_RCPT_DEV — Get device status.
31
32                       USB_DEV_REQ_RCPT_IF — Get interface status.
33
34                       USB_DEV_REQ_RCPT_EP — Get endpoint status.
35
36
37       which           Device, interface or endpoint from which to get status.
38                       Either  number of  interface  or  endpoint,  or   0  if
39                       device status requested.
40
41
42       status          Address into which the status is written.
43
44
45       flags           None are recognized.
46
47

DESCRIPTION

49       The usb_get_status() function returns the status of a device, interface
50       or endpoint.  All status requests use the default control pipe.  Length
51       of  data  returned  is USB_GET_STATUS_LEN bytes.  Always block and wait
52       for resources if not available, regardless of the flags argument.
53
54
55       When the request_type recipient is USB_DEV_REQ_RCPT_DEV, device  status
56       is requested. Status returned includes bits for USB_DEV_SLF_PWRD_STATUS
57       (device is  currently  self-powered) and USB_DEV_RWAKEUP_STATUS (device
58       has remote  wakeup enabled). A set bit indicates the corresponding sta‐
59       tus.
60
61
62       When  the  request_type  is  USB_DEV_REQ_RCPT_EP,  endpoint  status  is
63       requested.  Status  returned includes bits for USB_EP_HALT_STATUS (end‐
64       point is halted). A set bit indicates the corresponding status.
65
66
67       When the  request_type  is  USB_DEV_REQ_RCPT_IF,  interface  status  is
68       requested and USB_IF_STATUS (zero) is returned.
69

RETURN VALUES

71       USB_SUCCESS         Status  returned  successfully  in the status argu‐
72                           ment.
73
74
75       USB_INVALID_ARGS    Status pointer and/or dip argument is NULL.
76
77
78       USB_INVALID_PIPE    Pipe handle is NULL.
79
80
81       USB_FAILURE         Status not returned successfully.
82
83

CONTEXT

85       May be called from user or kernel context.
86

EXAMPLES

88           uint16_t status;
89
90           if (usb_get_status(
91               dip, pipe_handle, USB_DEV_REQ_RCPT_DEV, 0 &status, 0) ==
92               USB_SUCCESS) {
93                   if (status & USB_DEV_SLF_PWRD_STATUS) {
94                           cmn_err (CE_WARN,
95                               "%s%d: USB device is running on its own power.",
96                               ddi_driver_name(dip), ddi_get_instance(dip));
97                   }
98           }
99
100

ATTRIBUTES

102       See attributes(5) for descriptions of the following attributes:
103
104
105
106
107       ┌─────────────────────────────┬─────────────────────────────┐
108       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
109       ├─────────────────────────────┼─────────────────────────────┤
110       │Architecture                 │PCI-based systems            │
111       ├─────────────────────────────┼─────────────────────────────┤
112       │Interface stability          │Committed                    │
113       ├─────────────────────────────┼─────────────────────────────┤
114       │Availability                 │SUNWusb                      │
115       └─────────────────────────────┴─────────────────────────────┘
116

SEE ALSO

118       attributes(5),         usb_clr_feature(9F),         usb_get_alt_if(9F),
119       usb_pipe_get_state(9F), usb_get_cfg(9F),
120
121
122
123SunOS 5.11                        5 Jan 2004                usb_get_status(9F)
Impressum