Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / usb_pipe_get_max_bulk_transfer_size.9f
blob4612777264d108c9b1b1fae52335c592638d1365
1 '\" te
2 .\" Copyright (c) 2004, Sun Microsystems, Inc.,
3 .\" All Rights Reserved
4 .\" 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.
5 .\" 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.
6 .\" 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]
7 .TH USB_PIPE_GET_MAX_BULK_TRANSFER_SIZE 9F "Jan 5, 2004"
8 .SH NAME
9 usb_pipe_get_max_bulk_transfer_size \- Get maximum bulk transfer size
10 .SH SYNOPSIS
11 .LP
12 .nf
13 #include <sys/usb/usba.h>
17 \fBint\fR \fBusb_pipe_get_max_bulk_transfer_size\fR(\fBdev_info_t\fR \fIdip\fR, \fBsize_t *\fR\fIsize\fR);
18 .fi
20 .SH INTERFACE LEVEL
21 .sp
22 .LP
23 Solaris DDI specific (Solaris DDI)
24 .SH PARAMETERS
25 .sp
26 .ne 2
27 .na
28 \fB\fIdip\fR\fR
29 .ad
30 .RS 8n
31 Pointer to the device's dev_info structure.
32 .RE
34 .sp
35 .ne 2
36 .na
37 \fB\fIsize\fR\fR
38 .ad
39 .RS 8n
40 Returns the bulk transfer size.
41 .RE
43 .SH DESCRIPTION
44 .sp
45 .LP
46 The \fBusb_pipe_get_max_bulk_transfer_size()\fR function returns the maximum
47 data transfer size in bytes that the host controller driver can support per
48 bulk request. This information can be used to limit or break down larger
49 requests to manageable sizes.
50 .SH RETURN VALUES
51 .sp
52 .ne 2
53 .na
54 \fBUSB_SUCCESS\fR
55 .ad
56 .RS 20n
57 Size is returned in size argument.
58 .RE
60 .sp
61 .ne 2
62 .na
63 \fBUSB_INVALID_ARGS\fR
64 .ad
65 .RS 20n
66 \fIdip\fR and/or \fIsize\fR argument is \fBNULL\fR.
67 .RE
69 .sp
70 .ne 2
71 .na
72 \fBUSB_FAILURE\fR
73 .ad
74 .RS 20n
75 Size could not be returned. Zero is returned in \fIsize\fR arg.
76 .RE
78 .SH CONTEXT
79 .sp
80 .LP
81 May be called from user, kernel or interrupt context.
82 .SH EXAMPLES
83 .sp
84 .in +2
85 .nf
86     int xxx_attach(dev_info_t *dip, int command)
87     {
88            ...
89            usb_pipe_get_max_bulk_transfer_size(dip, &state>max_xfer_size);
90            ...
91     }
93     void xxx_minphys(struct buf bp)
94     {
95            ...
96            if (bp->b_bcount > state->max_xfer_size) {
97                    bp->b_bcount = state->max_xfer_size;
98            }
99            ...
100     }
104 .in -2
106 .SH ATTRIBUTES
109 See \fBattributes\fR(5) for descriptions of the following attributes:
114 box;
115 c | c
116 l | l .
117 ATTRIBUTE TYPE  ATTRIBUTE VALUE
119 Architecture    PCI-based systems
121 Interface stability     Committed
124 .SH SEE ALSO
127 \fBattributes\fR(5), \fBusb_pipe_bulk_xfer\fR(9F), \fBusb_alloc_request\fR(9F),
128 \fBusb_bulk_request\fR(9S)