1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc.,
.\" All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH USB_CLR_FEATURE 9F "Feb 9, 2004"
.SH NAME
usb_clr_feature \- Clear feature of USB device, interface or endpoint
.SH SYNOPSIS
.LP
.nf
#include <sys/usb/usba.h>
\fBint\fR \fBusb_clr_feature\fR(\fBdev_info_t *\fR\fIdip\fR,
\fBuint_t\fR \fIrequest_type\fR, \fBuint_t\fR \fIfeature\fR,
\fBuint_t\fR \fIwhich\fR, \fBusb_flags_t\fR \fIflags\fR,
\fBvoid (\fR\fI*callback)\fR (usb_pipe_handle_t \fIpipe_handle\fR,
\fBusb_opaque_t\fR \fIcallback_arg\fR, \fBint\fR \fIrval\fR, \fBusb_cb_flags_t\fR \fIflags)\fR,
\fBusb_opaque_t\fR \fIcallback_arg\fR);
.fi
.SH INTERFACE LEVEL
.sp
.LP
Solaris DDI specific (Solaris DDI)
.SH PARAMETERS
.sp
.ne 2
.na
\fB\fIdip\fR\fR
.ad
.RS 16n
Pointer to the device's dev_info structure.
.RE
.sp
.ne 2
.na
\fB\fIpipe_handle\fR\fR
.ad
.RS 16n
Pipe handle to device, device interface or endpoint.
.RE
.sp
.ne 2
.na
\fB\fIrequest_type\fR\fR
.ad
.RS 16n
bmRequestType to be used. One of the following:
.sp
USB_DEV_REQ_RCPT_DEV - Clear feature on device.
.sp
USB_DEV_REQ_RCPT_IF - Clear feature on interface.
.sp
USB_DEV_REQ_RCPT_EP - Clear feature on endpoint.
.RE
.sp
.ne 2
.na
\fB\fIfeature\fR\fR
.ad
.RS 16n
Feature to be cleared. Can be any device-defined device-, interface-, or
endpoint-specific feature, including the following which are defined in the
\fIUSB 2.0\fR specification:
.sp
USB_EP_HALT - Clear a HALT on an endpoint.
.sp
USB_DEV_REMOTE_WAKEUP - Clear REMOTE_WAKEUP on a device.
.sp
USB_DEV_TEST_MODE - Clear TEST_MODE on a device.
.RE
.sp
.ne 2
.na
\fBwhich\fR
.ad
.RS 9n
Device, interface or endpoint on which to clear the feature. One of:
.br
.in +2
Interface number, for interfaces.
.in -2
.br
.in +2
Endpoint number, for endpoints.
.in -2
.br
.in +2
0 for devices.
.in -2
.RE
.sp
.ne 2
.na
\fBflags\fR
.ad
.RS 16n
USB_FLAGS_SLEEP is the only flag recognized. Wait for completion and do not
call callback.
.RE
.sp
.ne 2
.na
\fBcallback\fR
.ad
.RS 16n
Callback handler to notify of asynchronous completion.
.RE
.sp
.ne 2
.na
\fBcallback_arg\fR
.ad
.RS 16n
Second argument passed to callback handler.
.RE
.SH DESCRIPTION
.sp
.LP
The \fBusb_clr_feature()\fR function clears a specific feature of a device,
interface or endpoint. This function always blocks and waits for resources if
not available, regardless of the flags argument.
.sp
.LP
This call blocks for completion if USB_FLAGS_SLEEP is set in flags. It returns
immediately and calls the callback upon completion if USB_FLAGS_SLEEP is not
set.
.SH RETURN VALUES
.sp
.ne 2
.na
\fBUSB_SUCCESS\fR
.ad
.RS 23n
Feature was successfully cleared.
.RE
.sp
.ne 2
.na
\fBUSB_INVALID_ARGS\fR
.ad
.RS 23n
\fIdip\fR argument is NULL.
.RE
.sp
.ne 2
.na
\fBUSB_INVALID_PIPE\fR
.ad
.RS 23n
\fIpipe_handle\fR argument is NULL
.RE
.sp
.ne 2
.na
\fBUSB_INVALID_CONTEXT\fR
.ad
.RS 23n
Called from interrupt context with USB_FLAGS_SLEEP flag set.
.RE
.sp
.ne 2
.na
\fBUSB_FAILURE\fR
.ad
.RS 23n
Clearing of feature was unsuccessful.
.RE
.SH CONTEXT
.sp
.LP
May always be called from user or kernel context. May be called from interrupt
context only if USB_FLAGS_SLEEP is not set in flags.
.sp
.LP
If the USB_CB_ASYNC_REQ_FAILED bit is clear in usb_cb_flags_t, the callback, if
supplied, can block because it is executing in kernel context. Otherwise the
callback cannot block. Please see \fBusb_callback_flags\fR(9S) for more
information on callbacks.
.SH EXAMPLES
.sp
.in +2
.nf
if (usb_clr_feature(dip, pipe_handle, USB_DEV_REQ_RCPT_EP,
USB_EP_HALT, data_endpoint_num, 0) == USB_FAILURE) {
cmn_err (CE_WARN,
"%s%d: Error clearing halt condition on data endpoint %d.",
ddi_driver_name(dip), ddi_get_instance(dip),
data_endpoint_num);
}
.fi
.in -2
.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE ATTRIBUTE VALUE
_
Architecture PCI-based systems
_
Interface stability Committed
.TE
.SH SEE ALSO
.sp
.LP
\fBattributes\fR(5), \fBusb_get_status\fR(9F), \fBusb_pipe_reset\fR(9F),
\fBusb_pipe_get_state\fR(9F), \fBusb_callback_flags\fR(9S)
|