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_DUP_INTER_REQ 9F
18 .Nm usba_hcdi_dup_intr_req
19 .Nd duplicate an interrupt request
21 .In sys/usb/usba/hcdi.h
23 .Fo usba_hcdi_dup_intr_req
25 .Fa "usb_intr_req_t *irqp"
27 .Fa "usb_flags_t flags"
31 illumos USB HCD private function
33 This is a private function that is not part of the stable DDI.
34 It may be removed or changed at any time.
38 A pointer to the HCD driver's
42 A pointer to the USB interrupt request which will be duplicated.
44 The number of bytes in the allocated data block
47 Flags which describe how allocations should be performed.
50 .It Sy USB_FLAGS_NOSLEEP
51 Do not block waiting for memory.
52 If memory is not available the allocation will fail.
53 .It Sy USB_FLAGS_SLEEP
54 Perform a blocking allocation.
55 If memory is not available, the function will wait until memory is made
58 Note, the request may still fail even if
65 .Fn usba_hcdi_dup_intr_req
66 function is used to duplicate an existing interrupt request,
69 The USBA framework initiates interrupt operations through the
70 .Xr usba_hcdi_pipe_intr_xfer 9E
72 It provides an initial USB interrupt request as an argument.
73 When the HCD driver has interrupt data to return, it needs to duplicate
74 that initial interrupt request each time that it submits data through
78 In addition to duplicating the request, callers may also need to increase the
79 pipe handle's request count.
80 For more information, see
81 .Xr usba_hcdi_pipe_intr_xfer 9E .
85 argument should correspond to the HCD driver's
90 pointer should correspond to the initial interrupt request.
93 argument should describe the maximum amount of data needed for this request.
94 The amount of data will be dependent on the endpoint and device.
97 should depend on the caller's context.
100 is passed while in interrupt context, then this function will fail.
103 .Fn usba_hcdi_dup_intr_req
104 function may be called from
109 context; however, when in interrupt context, the value of
112 .Sy USB_FLAGS_NOSLEEP .
114 Upon successful completion, the
115 .Fn usba_hcdi_dup_intr_req
116 function returns a pointer to a duplicated interrupt request.
119 is returned to indicate that the request could not be duplicated.
122 .Xr usba_hcdi_pipe_intr_xfer 9E ,