2 .\" Copyright (c) 2004, Sun Microsystems, Inc.,
3 .\" All Rights Reserved
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH USB_CLR_FEATURE 9F "Feb 9, 2004"
9 usb_clr_feature \- Clear feature of USB device, interface or endpoint
13 #include <sys/usb/usba.h>
17 \fBint\fR \fBusb_clr_feature\fR(\fBdev_info_t *\fR\fIdip\fR,
18 \fBuint_t\fR \fIrequest_type\fR, \fBuint_t\fR \fIfeature\fR,
19 \fBuint_t\fR \fIwhich\fR, \fBusb_flags_t\fR \fIflags\fR,
20 \fBvoid (\fR\fI*callback)\fR (usb_pipe_handle_t \fIpipe_handle\fR,
21 \fBusb_opaque_t\fR \fIcallback_arg\fR, \fBint\fR \fIrval\fR, \fBusb_cb_flags_t\fR \fIflags)\fR,
22 \fBusb_opaque_t\fR \fIcallback_arg\fR);
28 Solaris DDI specific (Solaris DDI)
36 Pointer to the device's dev_info structure.
42 \fB\fIpipe_handle\fR\fR
45 Pipe handle to device, device interface or endpoint.
51 \fB\fIrequest_type\fR\fR
54 bmRequestType to be used. One of the following:
56 USB_DEV_REQ_RCPT_DEV - Clear feature on device.
58 USB_DEV_REQ_RCPT_IF - Clear feature on interface.
60 USB_DEV_REQ_RCPT_EP - Clear feature on endpoint.
69 Feature to be cleared. Can be any device-defined device-, interface-, or
70 endpoint-specific feature, including the following which are defined in the
71 \fIUSB 2.0\fR specification:
73 USB_EP_HALT - Clear a HALT on an endpoint.
75 USB_DEV_REMOTE_WAKEUP - Clear REMOTE_WAKEUP on a device.
77 USB_DEV_TEST_MODE - Clear TEST_MODE on a device.
86 Device, interface or endpoint on which to clear the feature. One of:
89 Interface number, for interfaces.
93 Endpoint number, for endpoints.
107 USB_FLAGS_SLEEP is the only flag recognized. Wait for completion and do not
117 Callback handler to notify of asynchronous completion.
126 Second argument passed to callback handler.
132 The \fBusb_clr_feature()\fR function clears a specific feature of a device,
133 interface or endpoint. This function always blocks and waits for resources if
134 not available, regardless of the flags argument.
137 This call blocks for completion if USB_FLAGS_SLEEP is set in flags. It returns
138 immediately and calls the callback upon completion if USB_FLAGS_SLEEP is not
147 Feature was successfully cleared.
153 \fBUSB_INVALID_ARGS\fR
156 \fIdip\fR argument is NULL.
162 \fBUSB_INVALID_PIPE\fR
165 \fIpipe_handle\fR argument is NULL
171 \fBUSB_INVALID_CONTEXT\fR
174 Called from interrupt context with USB_FLAGS_SLEEP flag set.
183 Clearing of feature was unsuccessful.
189 May always be called from user or kernel context. May be called from interrupt
190 context only if USB_FLAGS_SLEEP is not set in flags.
193 If the USB_CB_ASYNC_REQ_FAILED bit is clear in usb_cb_flags_t, the callback, if
194 supplied, can block because it is executing in kernel context. Otherwise the
195 callback cannot block. Please see \fBusb_callback_flags\fR(9S) for more
196 information on callbacks.
201 if (usb_clr_feature(dip, pipe_handle, USB_DEV_REQ_RCPT_EP,
202 USB_EP_HALT, data_endpoint_num, 0) == USB_FAILURE) {
204 "%s%d: Error clearing halt condition on data endpoint %d.",
205 ddi_driver_name(dip), ddi_get_instance(dip),
215 See \fBattributes\fR(5) for descriptions of the following attributes:
223 ATTRIBUTE TYPE ATTRIBUTE VALUE
225 Architecture PCI-based systems
227 Interface stability Committed
233 \fBattributes\fR(5), \fBusb_get_status\fR(9F), \fBusb_pipe_reset\fR(9F),
234 \fBusb_pipe_get_state\fR(9F), \fBusb_callback_flags\fR(9S)