2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright 2016 Joyent, Inc.
15 .Dt USBA_HCDI_PIPE_STOP_INTR_POLLING 9E
18 .Nm usba_hcdi_pipe_stop_intr_polling ,
19 .Nm usba_hcdi_pipe_stop_isoc_polling
20 .Nd stop polling on an interrupt or isochronous pipe
22 .In sys/usb/usba/hcdi.h
24 .Fo prefix_hcdi_pipe_stop_intr_polling
25 .Fa "usba_pipe_handle_data_t *ph"
26 .Fa "usba_flags_t usb_flags"
29 .Fo prefix_hcdi_pipe_stop_isoc_polling
30 .Fa "usba_pipe_handle_data_t *ph"
31 .Fa "usba_flags_t usb_flags"
35 illumos USB HCD private function
37 This is a private function that is not part of the stable DDI. It may be
38 removed or changed at any time.
42 A pointer to a USB pipe handle as defined in
43 .Xr usba_pipe_handle_data 9S .
45 Flags which describe how allocations should be performed. Valid flags
48 .It Sy USB_FLAGS_NOSLEEP
49 Do not block waiting for memory. If memory is not available the allocation
51 .It Sy USB_FLAGS_SLEEP
52 Perform a blocking allocation. If memory is not available, the function
53 will wait until memory is made available.
55 Note, the request may still fail even if
62 .Fn usba_hcdi_pipe_stop_intr_polling
64 .Fn usba_hcdi_pipe_stop_isoc_polling
65 entry points are called when a client driver wishes to cease polling on
66 an interrupt or isochronous pipe as describe by
68 While these functions should only be called on pipes that have
69 outstanding periodic interrupt and isochronous requests started through
71 .Xr usba_hcdi_pipe_intr_xfer 9E
73 .Xr usba_hcdi_pipe_isoc_xfer 9E ,
74 as part of device driver hardening, device drivers should verify that
75 there are outstanding transfers.
77 For interrupt transfers,
79 may refer to the root hub and so the driver may need to cease any
80 synthetic polling it is performing. Isochronous transfers are forbidden
81 on the root hub, so the
82 .Fn usba_hcdi_pipe_stop_isoc_polling
83 will only be called on a pipe that corresponds to an actual device.
87 requests. In all cases, the driver should take the following steps
88 before returning from these entry points:
91 Quiesce and stop the endpoint.
93 Remove any remaining scheduled transfers.
97 on the original interrupt or isochronous request with the code
98 .Sy USB_CR_STOPPED_POLLING .
100 Optionally, free all associated resources. If resources aren't freed
101 at this time, they must be freed when
102 .Xr usba_hcdi_pipe_close 9E
105 Any other steps needed such that a call to perform one-shot or periodic
106 transfers on this endpoint again may be enabled.
109 It is possible that this function may be called concurrently with a call
111 .Xr usba_hcdi_pipe_reset 9E
112 entry point. In such cases, the host controller driver is required to
113 perform synchronization on its data structures.
115 Upon successful completion, the
116 .Fn usba_hcdi_pipe_stop_intr_polling
118 .Fn uba_hcdi_pipe_stop_isoc_polling
119 functions should return
121 Otherwise, it should return the appropriate USB error. If uncertain, use
124 .Xr usba_hcdi_pipe_close 9E ,
125 .Xr usba_hcdi_pipe_intr_xfer 9E ,
126 .Xr usba_hcdi_pipe_isoc_xfer 9E ,
127 .Xr usba_hcdi_pipe_reset 9E ,
128 .Xr usba_hcdi_cb 9F ,
129 .Xr usba_pipe_handle_data 9S