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.
19 .Nd USBA transfer callback
21 .In sys/usb/usba/hcdi.h
24 .Fa "usba_pipe_handle_data_t *ph"
25 .Fa "usb_opaque_t req"
30 illumos USB HCD private function
32 This is a private function that is not part of the stable DDI.
33 It may be removed or changed at any time.
37 A pointer to the USBA pipe handle that was passed to the HCD driver
39 .Xr usba_hcdi_pipe_open 9E
42 A pointer to the request structure that is being completed.
44 The completion code for the request.
49 function is used when the HCD controller has completed processing a USB
50 transfer request, whether
53 The USB transfer will have been initiated by a call to
54 .Xr usba_hcdi_pipe_bulk_xfer 9E ,
55 .Xr usba_hcdi_pipe_ctrl_xfer 9E ,
56 .Xr usba_hcdi_pipe_intr_xfer 9E ,
58 .Xr usba_hcdi_pipe_isoc_xfer 9E .
59 If the transfer initiated was a periodic transfer (certain Interrupt-IN
60 and Isochronous-IN transfers), then there may be more than one callback
61 performed over the life of the transfer.
63 This function must not be used if the HCD driver returned a value
66 to one of the transfer initialization functions listed above.
67 For more information on transfer request handling, see
72 argument corresponds to the USBA framework's pipe handle that was given
73 to the HCDI when the pipe was opened.
75 .Xr usba_hcdi_pipe_open 9E
82 argument is one of the four request structures,
88 which have been cast to the type
90 The caller should ensure that all appropriate members of the request
91 structure have been filled in.
92 For example, if expecting data from the device and the request has completed
93 successfully, then that data should be copied into the request structure's
95 prior to handing the request structure to the
102 member should be filled in with the appropriate data.
104 Once the request structure has been passed to the
106 function, the HCD driver must not access the structure ever again.
107 It should be treated as freed memory.
111 argument us used to indicate whether the transfer was successful or not.
116 that indicates that the transfer completed successfully.
117 This should also be used when a permitted short transfer has occurred.
118 Otherwise, it should be set to one of the completion reasons.
120 The HCD driver should not hold its own internal locks across a call to
124 It is possible that the driver will have once of its
126 entry points called based on the return value specified.
130 function may be called from
138 .Xr usba_hcdi_pipe_bulk_xfer 9E ,
139 .Xr usba_hcdi_pipe_ctrl_xfer 9E ,
140 .Xr usba_hcdi_pipe_intr_xfer 9E ,
141 .Xr usba_hcdi_pipe_isoc_xfer 9E ,
142 .Xr usba_hcdi_pipe_open 9E ,
144 .Xr usb_bulk_req 9S ,
145 .Xr usb_ctrl_req 9S ,
146 .Xr usb_intr_req 9S ,