2 .\" Copyright (c) 2004, Sun Microsystems, Inc., All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH USB_GET_MAX_PKTS_PER_ISOC_REQUEST 9F "Nov 10, 2016"
8 usb_get_max_pkts_per_isoc_request \- Get maximum number of packets allowed per
13 #include <sys/usb/usba.h>
17 \fB\fR\fBuint_t\fR usb_get_max_pkts_per_isoc_request(\fBdev_info_t *\fR\fIdip\fR);
22 Solaris DDI specific (Solaris DDI)
29 Pointer to the device's \fBdev_info\fR structure.
34 The \fBusb_get_max_pkts_per_isoc_request()\fR function returns the maximum
35 number of isochronous packets per request that the host control driver can
36 support. This number can be used to determine the maximum amount of data which
37 can be handled by a single isochronous request. That length is found by:
41 max = usb_get_max_pkts_per_isoc_request(dip) * endpoint_max_packet_size;
47 where endpoint_max_packet_size is the wMaxPacketSize field of the isochronous
48 endpoint over which the transfer will take place.
51 On success, the \fBusb_get_max_pkts_per_isoc_request()\fR function returns the
52 maximum number of isochronous pkts per request. On failure it returns \fB0\fR.
53 The function fails if \fIdip\fR is NULL.
56 May be called from user, kernel or interrupt context.
61 * Set up to receive periodic isochronous data, requesting
62 * the maximum amount for each transfer.
66 /* Get max packet size from endpoint descriptor. */
67 uint_t ep_max_pkt_size = ep_descr.wMaxPacketSize;
68 uint_t isoc_pkts_count = usb_get_max_pkts_per_isoc_request(dip);
71 * Allocate an isoc request, specifying the max number of packets
72 * and the greatest size transfer possible.
74 usb_isoc_req_t *isoc_req = usb_alloc_isoc_req(dip,
76 isoc_pkts_count * ep_max_pkt_size,
79 /* Init each packet descriptor for maximum size. */
80 for (pkt = 0; pkt < isoc_pkts_count; pkt++) {
81 isoc_req->isoc_pkt_descr[pkt].isoc_pkt_length = ep_max_pkt_size;
86 /* Set the length of a packet in the request too. */
87 isoc_req->isoc_pkts_length = ep_max_pkt_size;
89 /* Other isoc request initialization. */
93 if (usb_pipe_isoc_xfer(pipe, isoc_req, USB_FLAGS_NOSLEEP) != USB_SUCCESS) {
101 See \fBattributes\fR(5) for descriptions of the following attributes:
109 ATTRIBUTE TYPE ATTRIBUTE VALUE
111 Architecture PCI-based systems
113 Interface stability Committed
118 \fBattributes\fR(5), \fBusb_pipe_isoc_xfer\fR(9F), \fBusb_alloc_request\fR(9F),
119 \fBusb_get_current_frame_number\fR(9F), \fBusb_ep_descr\fR(9S),
120 \fBusb_isoc_request\fR(9S)