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 May 10, 2016
159b0e7716SRobert Mustacchi.Dt USBA_HCDI_DUP_INTER_REQ 9F
169b0e7716SRobert Mustacchi.Os
179b0e7716SRobert Mustacchi.Sh NAME
189b0e7716SRobert Mustacchi.Nm usba_hcdi_dup_intr_req
199b0e7716SRobert Mustacchi.Nd duplicate an interrupt request
209b0e7716SRobert Mustacchi.Sh SYNOPSIS
219b0e7716SRobert Mustacchi.In sys/usb/usba/hcdi.h
229b0e7716SRobert Mustacchi.Ft usb_intr_req_t *
239b0e7716SRobert Mustacchi.Fo usba_hcdi_dup_intr_req
249b0e7716SRobert Mustacchi.Fa "dev_info_t *dip"
259b0e7716SRobert Mustacchi.Fa "usb_intr_req_t *irqp"
269b0e7716SRobert Mustacchi.Fa "size_t size"
279b0e7716SRobert Mustacchi.Fa "usb_flags_t flags"
289b0e7716SRobert Mustacchi.Fc
299b0e7716SRobert Mustacchi.Sh INTERFACE LEVEL
309b0e7716SRobert Mustacchi.Sy Volatile -
319b0e7716SRobert Mustacchiillumos USB HCD private function
329b0e7716SRobert Mustacchi.Pp
33*72d3dbb9SYuri PankovThis is a private function that is not part of the stable DDI.
34*72d3dbb9SYuri PankovIt may be removed or changed at any time.
359b0e7716SRobert Mustacchi.Sh PARAMETERS
369b0e7716SRobert Mustacchi.Bl -tag -width Fa
379b0e7716SRobert Mustacchi.It Fa dip
389b0e7716SRobert MustacchiA pointer to the HCD driver's
399b0e7716SRobert Mustacchi.Sy dev_info
409b0e7716SRobert Mustacchistructure.
419b0e7716SRobert Mustacchi.It Fa irqp
429b0e7716SRobert MustacchiA pointer to the USB interrupt request which will be duplicated.
439b0e7716SRobert Mustacchi.It Fa size
449b0e7716SRobert MustacchiThe number of bytes in the allocated data block
459b0e7716SRobert Mustacchi.Sy mblk_t .
469b0e7716SRobert Mustacchi.It Fa flags
47*72d3dbb9SYuri PankovFlags which describe how allocations should be performed.
48*72d3dbb9SYuri PankovValid flags are:
499b0e7716SRobert Mustacchi.Bl -tag -width Sy
509b0e7716SRobert Mustacchi.It Sy USB_FLAGS_NOSLEEP
51*72d3dbb9SYuri PankovDo not block waiting for memory.
52*72d3dbb9SYuri PankovIf memory is not available the allocation will fail.
539b0e7716SRobert Mustacchi.It Sy USB_FLAGS_SLEEP
54*72d3dbb9SYuri PankovPerform a blocking allocation.
55*72d3dbb9SYuri PankovIf memory is not available, the function will wait until memory is made
56*72d3dbb9SYuri Pankovavailable.
579b0e7716SRobert Mustacchi.Pp
589b0e7716SRobert MustacchiNote, the request may still fail even if
599b0e7716SRobert Mustacchi.Sy USB_FLAGS_SLEEP
609b0e7716SRobert Mustacchiis specified.
619b0e7716SRobert Mustacchi.El
629b0e7716SRobert Mustacchi.El
639b0e7716SRobert Mustacchi.Sh DESCRIPTION
649b0e7716SRobert MustacchiThe
659b0e7716SRobert Mustacchi.Fn usba_hcdi_dup_intr_req
669b0e7716SRobert Mustacchifunction is used to duplicate an existing interrupt request,
679b0e7716SRobert Mustacchi.Fa irqp .
689b0e7716SRobert Mustacchi.Pp
699b0e7716SRobert MustacchiThe USBA framework initiates interrupt operations through the
709b0e7716SRobert Mustacchi.Xr usba_hcdi_pipe_intr_xfer 9E
71*72d3dbb9SYuri Pankoventry point.
72*72d3dbb9SYuri PankovIt provides an initial USB interrupt request as an argument.
739b0e7716SRobert MustacchiWhen the HCD driver has interrupt data to return, it needs to duplicate
749b0e7716SRobert Mustacchithat initial interrupt request each time that it submits data through
759b0e7716SRobert Mustacchithe
769b0e7716SRobert Mustacchi.Xr usba_hcdi_cb 9F
77*72d3dbb9SYuri Pankovfunction.
78*72d3dbb9SYuri PankovIn addition to duplicating the request, callers may also need to increase the
79*72d3dbb9SYuri Pankovpipe handle's request count.
80*72d3dbb9SYuri PankovFor more information, see
819b0e7716SRobert Mustacchi.Xr usba_hcdi_pipe_intr_xfer 9E .
829b0e7716SRobert Mustacchi.Pp
839b0e7716SRobert MustacchiThe
849b0e7716SRobert Mustacchi.Fa dip
859b0e7716SRobert Mustacchiargument should correspond to the HCD driver's
869b0e7716SRobert Mustacchi.Sy dev_info_t
87*72d3dbb9SYuri Pankovstructure.
88*72d3dbb9SYuri PankovThe
899b0e7716SRobert Mustacchi.Fa irqp
90*72d3dbb9SYuri Pankovpointer should correspond to the initial interrupt request.
91*72d3dbb9SYuri PankovThe
929b0e7716SRobert Mustacchi.Fa size
93*72d3dbb9SYuri Pankovargument should describe the maximum amount of data needed for this request.
94*72d3dbb9SYuri PankovThe amount of data will be dependent on the endpoint and device.
95*72d3dbb9SYuri PankovThe value of
969b0e7716SRobert Mustacchi.Fa flags
97*72d3dbb9SYuri Pankovshould depend on the caller's context.
98*72d3dbb9SYuri PankovIf
999b0e7716SRobert Mustacchi.Dv USB_FLAGS_SLEEP
1009b0e7716SRobert Mustacchiis passed while in interrupt context, then this function will fail.
1019b0e7716SRobert Mustacchi.Sh CONTEXT
1029b0e7716SRobert MustacchiThe
1039b0e7716SRobert Mustacchi.Fn usba_hcdi_dup_intr_req
1049b0e7716SRobert Mustacchifunction may be called from
1059b0e7716SRobert Mustacchi.Sy user ,
1069b0e7716SRobert Mustacchi.Sy kernel ,
1079b0e7716SRobert Mustacchior
1089b0e7716SRobert Mustacchi.Sy interrupt
1099b0e7716SRobert Mustacchicontext; however, when in interrupt context, the value of
1109b0e7716SRobert Mustacchi.Fa flags
1119b0e7716SRobert Mustacchimust be
1129b0e7716SRobert Mustacchi.Sy USB_FLAGS_NOSLEEP .
1139b0e7716SRobert Mustacchi.Sh RETURN VALUES
1149b0e7716SRobert MustacchiUpon successful completion, the
1159b0e7716SRobert Mustacchi.Fn usba_hcdi_dup_intr_req
116*72d3dbb9SYuri Pankovfunction returns a pointer to a duplicated interrupt request.
117*72d3dbb9SYuri PankovOtherwise,
1189b0e7716SRobert Mustacchi.Sy NULL
1199b0e7716SRobert Mustacchiis returned to indicate that the request could not be duplicated.
1209b0e7716SRobert Mustacchi.Sh SEE ALSO
1219b0e7716SRobert Mustacchi.Xr usba_hcdi 9E ,
1229b0e7716SRobert Mustacchi.Xr usba_hcdi_pipe_intr_xfer 9E ,
1239b0e7716SRobert Mustacchi.Xr usba_hcdi_cb 9F
124