1usb_clr_feature(9F) Kernel Functions for Drivers usb_clr_feature(9F)
2
3
4
6 usb_clr_feature - Clear feature of USB device, interface or endpoint
7
9 #include <sys/usb/usba.h>
10
11
12
13 int usb_clr_feature(dev_info_t *dip,
14 uint_t request_type, uint_t feature,
15 uint_t which, usb_flags_t flags,
16 void (*callback) (usb_pipe_handle_t pipe_handle,
17 usb_opaque_t callback_arg, int rval, usb_cb_flags_t flags),
18 usb_opaque_t callback_arg);
19
20
22 Solaris DDI specific (Solaris DDI)
23
25 dip Pointer to the device's dev_info structure.
26
27
28 pipe_handle Pipe handle to device, device interface or endpoint.
29
30
31 request_type bmRequestType to be used. One of the following:
32
33 USB_DEV_REQ_RCPT_DEV - Clear feature on device.
34
35 USB_DEV_REQ_RCPT_IF - Clear feature on interface.
36
37 USB_DEV_REQ_RCPT_EP - Clear feature on endpoint.
38
39
40 feature Feature to be cleared. Can be any device-defined
41 device-, interface-, or endpoint-specific feature,
42 including the following which are defined in the USB
43 2.0 specification:
44
45 USB_EP_HALT - Clear a HALT on an endpoint.
46
47 USB_DEV_REMOTE_WAKEUP - Clear REMOTE_WAKEUP on a
48 device.
49
50 USB_DEV_TEST_MODE - Clear TEST_MODE on a device.
51
52
53 which Device, interface or endpoint on which to clear the feature.
54 One of:
55 Interface number, for interfaces.
56 Endpoint number, for endpoints.
57 0 for devices.
58
59
60 flags USB_FLAGS_SLEEP is the only flag recognized. Wait for
61 completion and do not call callback.
62
63
64 callback Callback handler to notify of asynchronous completion.
65
66
67 callback_arg Second argument passed to callback handler.
68
69
71 The usb_clr_feature() function clears a specific feature of a device,
72 interface or endpoint. This function always blocks and waits for
73 resources if not available, regardless of the flags argument.
74
75
76 This call blocks for completion if USB_FLAGS_SLEEP is set in flags. It
77 returns immediately and calls the callback upon completion if
78 USB_FLAGS_SLEEP is not set.
79
81 USB_SUCCESS Feature was successfully cleared.
82
83
84 USB_INVALID_ARGS dip argument is NULL.
85
86
87 USB_INVALID_PIPE pipe_handle argument is NULL
88
89
90 USB_INVALID_CONTEXT Called from interrupt context with
91 USB_FLAGS_SLEEP flag set.
92
93
94 USB_FAILURE Clearing of feature was unsuccessful.
95
96
98 May always be called from user or kernel context. May be called from
99 interrupt context only if USB_FLAGS_SLEEP is not set in flags.
100
101
102 If the USB_CB_ASYNC_REQ_FAILED bit is clear in usb_cb_flags_t, the
103 callback, if supplied, can block because it is executing in kernel
104 context. Otherwise the callback cannot block. Please see usb_call‐
105 back_flags(9S) for more information on callbacks.
106
108 if (usb_clr_feature(dip, pipe_handle, USB_DEV_REQ_RCPT_EP,
109 USB_EP_HALT, data_endpoint_num, 0) == USB_FAILURE) {
110 cmn_err (CE_WARN,
111 "%s%d: Error clearing halt condition on data endpoint %d.",
112 ddi_driver_name(dip), ddi_get_instance(dip),
113 data_endpoint_num);
114 }
115
116
117
119 See attributes(5) for descriptions of the following attributes:
120
121
122
123
124 ┌─────────────────────────────┬─────────────────────────────┐
125 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
126 ├─────────────────────────────┼─────────────────────────────┤
127 │Architecture │PCI-based systems │
128 ├─────────────────────────────┼─────────────────────────────┤
129 │Interface stability │Committed │
130 ├─────────────────────────────┼─────────────────────────────┤
131 │Availability │SUNWusb │
132 └─────────────────────────────┴─────────────────────────────┘
133
135 attributes(5), usb_get_status(9F), usb_pipe_reset(9F),
136 usb_pipe_get_state(9F), usb_callback_flags(9S)
137
138
139
140SunOS 5.11 Feb 9 2004 usb_clr_feature(9F)