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

NAME

6       usb_pipe_get_state - Return USB pipe state
7

SYNOPSIS

9       #include <sys/usb/usba.h>
10
11
12
13       int usb_pipe_get_state(usb_pipe_handle_t pipe_handle,
14            usb_pipe_state_t *pipe_state, usb_flags_t usb_flags);
15
16

INTERFACE LEVEL

18       Solaris DDI specific (Solaris DDI)
19

PARAMETERS

21       pipe_handle    Handle of the pipe to retrieve the state.
22
23
24       pipe_state     Pointer to where pipe state is returned.
25
26
27       usb_flags      No flags are recognized. Reserved for future expansion.
28
29

DESCRIPTION

31       The  usb_pipe_get_state()  function  retrieves  the  state  of the pipe
32       referred to by pipe_handle into the location pointed to by pipe_state.
33
34
35       Possible pipe states are:
36
37       USB_PIPE_STATE_CLOSED     Pipe is closed.
38
39
40       USB_PIPE_STATE_ACTIVE     Pipe is active  and  can  send/receive  data.
41                                 Polling  is active for isochronous and inter‐
42                                 rupt pipes.
43
44
45       USB_PIPE_STATE_IDLE       Polling is stopped for isochronous and inter‐
46                                 rupt-IN pipes.
47
48
49       USB_PIPE_STATE_ERROR      An   error   occurred.   Client   must   call
50                                 usb_pipe_reset(). Note that  this  status  is
51                                 not    seen    by    a   client   driver   if
52                                 USB_ATTRS_AUTOCLEARING is set in the  request
53                                 attributes.
54
55
56       USB_PIPE_STATE_CLOSING    Pipe  is  being  closed.  Requests  are being
57                                 drained from the pipe and other cleanup is in
58                                 progress.
59
60

RETURN VALUES

62       USB_SUCCESS         Pipe state returned in second argument.
63
64
65       USB_INVALID_ARGS    Pipe_state argument is NULL.
66
67
68       USB_INVALID_PIPE    Pipe_handle argument is NULL.
69
70

CONTEXT

72       May be called from user, kernel or interrupt context.
73

EXAMPLES

75             usb_pipe_handle_t pipe;
76             usb_pipe_state_t state;
77
78             /* Recover if the pipe is in an error state. */
79             if ((usb_pipe_get_state(pipe, &state, 0) == USB_SUCCESS) &&
80                 (state == USB_PIPE_STATE_ERROR)) {
81                     cmn_err (CE_WARN, "%s%d: USB Pipe error.",
82                         ddi_driver_name(dip), ddi_get_instance(dip));
83                     do_recovery();
84             }
85
86
87

ATTRIBUTES

89       See attributes(5) for descriptions of the following attributes:
90
91
92
93
94       ┌─────────────────────────────┬─────────────────────────────┐
95       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
96       ├─────────────────────────────┼─────────────────────────────┤
97       │Architecture                 │PCI-based systems            │
98       ├─────────────────────────────┼─────────────────────────────┤
99       │Interface stability          │Committed                    │
100       ├─────────────────────────────┼─────────────────────────────┤
101       │Availability                 │SUNWusb                      │
102       └─────────────────────────────┴─────────────────────────────┘
103

SEE ALSO

105       attributes(5),   usb_clr_feature(9F),   usb_get_cfg(9F).   usb_get_sta‐
106       tus(9F), usb_pipe_close(9F), usb_pipe_ctrl_xfer(9F), usb_pipe_open(9F).
107       usb_pipe_reset(9F)
108
109
110
111SunOS 5.11                        5 Jan 2004            usb_pipe_get_state(9F)
Impressum