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_PIPE_HANDLE_DATA 9S
18 .Nm usba_pipe_handle_data
19 .Nm usba_pipe_handle_data_t
20 .Nd USBA Pipe Handle Data Structure
22 .In sys/usb/usba/hcdi.h
25 illumos USB HCD private
27 This is a private data structure that is not part of the stable DDI. It
28 may be removed or changed at any time.
31 .Sy usba_pipe_handle_data
32 structure is the USB architecture's (USBA) way of representing a pipe.
33 Every pipe is a part of a USB device. Pipe's may be shared between
34 client drivers or be exclusive to one. For more background on pipe's
36 .Sy USB Endpoint Background
40 This structure is provided to HCD driver's when performing requests of
41 various kinds. The majority of the structures listed here are
43 however, HCD drivers are allowed to update a single member, listed
44 below. All of the writable members are protected by a lock, the member
50 for more information on lock ordering and when HCD drivers should enter
53 A pipe handle has an explicit life cycle wih a device driver. The driver
54 first sees the pipe handle when its
55 .Xr usba_hcdi_pipe_open 9E
56 entry point is called. At that time, the HCD driver has the change to
57 store private data on the handle. This pipe handle will be used in
58 subsequent requests until the handle is closed, through a call to the
60 .Xr usba_hcdi_pipe_close 9E
64 .Sy usba_pipe_handle_data_t
65 structure includes the following members:
66 .Bd -literal -offset -indent
67 usba_device_t *p_usba_device;
69 usb_ep_xdescr_t p_xep;
71 usb_opaque_t p_hcd_private;
80 structure that this pipe belongs to. This member should always be set
81 for an endpoint handed to an HCD driver.
85 member is filled in with the endpoint descriptor that represents this
86 device. The endpoint structure is documented in
91 member is filled in with the endpoint descriptor and any additional
92 endpoint descriptors that may exist. The structure is documented in
93 .Xr usb_ep_xdescr 9S .
94 The endpoint descriptor is the same in both
101 member is reserved for use with HCD drivers. An HCD driver may set
103 .Xr usba_hcdi_pipe_open 9E .
104 If set, it can reference this member throughout the life time of the
105 pipe. The driver should ensure to clean it up when its
106 .Xr usba_hcdi_pipe_close 9E
107 entry point is called.
111 member protects the member
113 The mutex should be entered whenever the value is being manipulated.
117 member indicates the number of outstanding requests on the pipe. When
120 interrupt or isochronous transfers, it is the responsibility of the HCD
121 driver to increment the value of
123 if it duplicates a request with either
124 .Xr usba_hcdi_dup_intr_req 9F
126 .Xr usba_hcdi_dup_isoc_req 9F .
128 Similarly, if the device driver for some reasons removes a request it
129 duplicated without submitting it to the USBA, it should decrement the
132 The HCD driver should take special care to ensure that the value of
134 is always greater than one. There should always be an outstanding
135 request that an HCD driver has for the pipe, especially if it is a
136 periodic endpoint. It should only manipulate this member while it owns
139 .Xr usba_hcdi_pipe_close 9E ,
140 .Xr usba_hcdi_pipe_open 9E ,
141 .Xr usba_hcdi_dup_intr_req 9F ,
142 .Xr usba_hcdi_dup_isoc_req 9F ,
143 .Xr usb_ep_descr 9S ,
144 .Xr usb_ep_xdescr 9S ,