19b0e7716SRobert Mustacchi.\"
29b0e7716SRobert Mustacchi.\" This file and its contents are supplied under the terms of the
39b0e7716SRobert Mustacchi.\" Common Development and Distribution License ("CDDL"), version 1.0.
49b0e7716SRobert Mustacchi.\" You may only use this file in accordance with the terms of version
59b0e7716SRobert Mustacchi.\" 1.0 of the CDDL.
69b0e7716SRobert Mustacchi.\"
79b0e7716SRobert Mustacchi.\" A full copy of the text of the CDDL should have accompanied this
89b0e7716SRobert Mustacchi.\" source.  A copy of the CDDL is also available via the Internet at
99b0e7716SRobert Mustacchi.\" http://www.illumos.org/license/CDDL.
109b0e7716SRobert Mustacchi.\"
119b0e7716SRobert Mustacchi.\"
129b0e7716SRobert Mustacchi.\" Copyright 2016 Joyent, Inc.
139b0e7716SRobert Mustacchi.\"
149b0e7716SRobert Mustacchi.Dd Sep 16, 2016
159b0e7716SRobert Mustacchi.Dt USBA_HCDI_DUP_ISOC_REQ 9F
169b0e7716SRobert Mustacchi.Os
179b0e7716SRobert Mustacchi.Sh NAME
189b0e7716SRobert Mustacchi.Nm usba_hcdi_dup_isoc_req
199b0e7716SRobert Mustacchi.Nd duplicate an isochronous request
209b0e7716SRobert Mustacchi.Sh SYNOPSIS
219b0e7716SRobert Mustacchi.In sys/usb/usba/hcdi.h
229b0e7716SRobert Mustacchi.Ft "usb_isoc_req_t *"
239b0e7716SRobert Mustacchi.Fo usba_hcdi_dup_isoc_req
249b0e7716SRobert Mustacchi.Fa "dev_info_t *dip"
259b0e7716SRobert Mustacchi.Fa "usb_isoc_req_t *usrp"
269b0e7716SRobert Mustacchi.Fa "usb_flags_t flags"
279b0e7716SRobert Mustacchi.Fc
289b0e7716SRobert Mustacchi.Sh INTERFACE LEVEL
299b0e7716SRobert Mustacchi.Sy Volatile -
309b0e7716SRobert Mustacchiillumos USB HCD private function
319b0e7716SRobert Mustacchi.Pp
32*72d3dbb9SYuri PankovThis is a private function that is not part of the stable DDI.
33*72d3dbb9SYuri PankovIt may be removed or changed at any time.
349b0e7716SRobert Mustacchi.Sh PARAMETERS
359b0e7716SRobert Mustacchi.Bl -tag -width Fa
369b0e7716SRobert Mustacchi.It Fa dip
379b0e7716SRobert MustacchiA pointer to the HCD driver's
389b0e7716SRobert Mustacchi.Sy dev_info
399b0e7716SRobert Mustacchistructure.
409b0e7716SRobert Mustacchi.It Fa usrp
419b0e7716SRobert MustacchiA pointer to the USB isochronous request which will be duplicated.
429b0e7716SRobert Mustacchi.It Fa flags
439b0e7716SRobert Mustacchi.Bl -tag -width Sy
449b0e7716SRobert Mustacchi.It Sy USB_FLAGS_NOSLEEP
45*72d3dbb9SYuri PankovDo not block waiting for memory.
46*72d3dbb9SYuri PankovIf memory is not available the allocation will fail.
479b0e7716SRobert Mustacchi.It Sy USB_FLAGS_SLEEP
48*72d3dbb9SYuri PankovPerform a blocking allocation.
49*72d3dbb9SYuri PankovIf memory is not available, the function will wait until memory is made
50*72d3dbb9SYuri Pankovavailable.
519b0e7716SRobert Mustacchi.Pp
529b0e7716SRobert MustacchiNote, the request may still fail even if
539b0e7716SRobert Mustacchi.Sy USB_FLAGS_SLEEP
549b0e7716SRobert Mustacchiis specified.
559b0e7716SRobert Mustacchi.El
569b0e7716SRobert Mustacchi.El
579b0e7716SRobert Mustacchi.Sh DESCRIPTION
589b0e7716SRobert MustacchiThe
599b0e7716SRobert Mustacchi.Fn usba_hcdi_dup_isoc_req
609b0e7716SRobert Mustacchifunction is used to duplicate an existing isochronous request,
619b0e7716SRobert Mustacchi.Fa usrp .
629b0e7716SRobert Mustacchi.Pp
639b0e7716SRobert MustacchiWhen the USBA framework initiates an isochronous in transfer with the
649b0e7716SRobert Mustacchi.Xr usba_hcdi_pipe_isoc_xfer 9E
659b0e7716SRobert Mustacchientry point, it is the HCD driver's responsibility to receive the
66*72d3dbb9SYuri Pankovperiodic data from the pipe.
67*72d3dbb9SYuri PankovWhen there is data available, the HCD must duplicate the original isochronous
68*72d3dbb9SYuri Pankovrequest and copy the available data into the request structure's
699b0e7716SRobert Mustacchi.Fa isoc_data
709b0e7716SRobert Mustacchimember, before handing over the request structure to the USBA framework
719b0e7716SRobert Mustacchiby calling the
729b0e7716SRobert Mustacchi.Xr usba_hcdi_cb 9F
739b0e7716SRobert Mustacchifunction.
749b0e7716SRobert Mustacchi.Pp
759b0e7716SRobert MustacchiIn addition to duplicating the request, it is the callers responsibility
76*72d3dbb9SYuri Pankovto increase the pipe handle's request count.
77*72d3dbb9SYuri PankovFor more information, see
789b0e7716SRobert Mustacchi.Xr usba_hcdi_pipe_isoc_xfer 9E .
799b0e7716SRobert Mustacchi.Pp
809b0e7716SRobert MustacchiThe
819b0e7716SRobert Mustacchi.Fa dip
829b0e7716SRobert Mustacchiargument should correspond to the HCD driver's
839b0e7716SRobert Mustacchi.Sy dev_info_t
84*72d3dbb9SYuri Pankovstructure.
85*72d3dbb9SYuri PankovThe
869b0e7716SRobert Mustacchi.Fa usrp
87*72d3dbb9SYuri Pankovpointer should correspond to the initial isochronous request.
88*72d3dbb9SYuri PankovThe
899b0e7716SRobert Mustacchi.Fa flags
90*72d3dbb9SYuri Pankovmember must be appropriate for the context.
91*72d3dbb9SYuri PankovIf
929b0e7716SRobert Mustacchi.Dv USB_FLAGS_SLEEP
939b0e7716SRobert Mustacchiis passed while in interrupt context, then this function may fail.
949b0e7716SRobert Mustacchi.Sh CONTEXT
959b0e7716SRobert MustacchiThe
969b0e7716SRobert Mustacchi.Fn usba_hcdi_dup_isoc_req
979b0e7716SRobert Mustacchifunction may be called from
989b0e7716SRobert Mustacchi.Sy user ,
999b0e7716SRobert Mustacchi.Sy kernel ,
1009b0e7716SRobert Mustacchior
1019b0e7716SRobert Mustacchi.Sy interrupt
1029b0e7716SRobert Mustacchicontext; however, when in interrupt context, the value of
1039b0e7716SRobert Mustacchi.Fa flags
1049b0e7716SRobert Mustacchimust be
1059b0e7716SRobert Mustacchi.Sy USB_FLAGS_NOSLEEP .
1069b0e7716SRobert Mustacchi.Sh RETURN VALUES
1079b0e7716SRobert MustacchiUpon successful completion, the
1089b0e7716SRobert Mustacchi.Fn usba_hcdi_dup_isoc_req
1099b0e7716SRobert Mustacchifunction returns a pointer to a duplicate isochronous request.
1109b0e7716SRobert MustacchiOtherwise,
1119b0e7716SRobert Mustacchi.Sy NULL
1129b0e7716SRobert Mustacchiis returned to indicate that the request could not be duplicated.
1139b0e7716SRobert Mustacchi.Sh SEE ALSO
1149b0e7716SRobert Mustacchi.Xr usba_hcdi 9E ,
1159b0e7716SRobert Mustacchi.Xr usba_hcdi_pipe_isoc_xfer 9E ,
1169b0e7716SRobert Mustacchi.Xr usba_hcdi_cb 9F
117