Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / share / man / man9f / usb_get_current_frame_number.9f
bloba0ac6a4916ccc81dcd975296668869541793ed7e
1 '\" te
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_CURRENT_FRAME_NUMBER 9F "Jul 25, 2004"
7 .SH NAME
8 usb_get_current_frame_number \- Return current logical usb frame number
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <sys/usb/usba.h>
16 \fBusb_frame_number_t\fR \fBusb_get_current_frame_number\fR(\fBdev_info_t *\fR\fIdip\fR);
17 .fi
19 .SH INTERFACE LEVEL
20 .sp
21 .LP
22 Solaris DDI specific (Solaris DDI)
23 .SH PARAMETERS
24 .sp
25 .ne 2
26 .na
27 \fB\fIdip\fR\fR
28 .ad
29 .RS 7n
30 Pointer to the device's \fBdev_info\fR structure.
31 .RE
33 .SH DESCRIPTION
34 .sp
35 .LP
36 The \fBusb_get_current_frame_number()\fR function retrieves the current logical
37 USB frame number.
38 .sp
39 .LP
40 Isochronous requests can be started on a particular numbered frame. An offset
41 number of frames (typically between 4 and 10) can be added to the current
42 logical frame number to specify the number of an upcoming frame to start an
43 isochronous request.
44 .sp
45 .LP
46 The USB specification requires that the frame frequency (the period between
47 start-of-frame packets) is one millisecond.  The Solaris operating environment
48 USB implementation uses a running counter of the number of milliseconds since
49 boot as the current logical frame number.
50 .SH RETURN VALUES
51 .sp
52 .LP
53 On success, the \fBusb_get_current_frame_number()\fR function returns the
54 current USB frame number. On failure it returns \fB0\fR. The function fails if
55 \fIdip\fR is NULL.
56 .SH CONTEXT
57 .sp
58 .LP
59 May be called from user, kernel or interrupt context.
60 .SH EXAMPLES
61 .sp
62 .in +2
63 .nf
64     usb_pipe_handle_t handle;
65     usb_frame_number_t offset = 10;
66     usb_isoc_req_t *isoc_req;
68     isoc_req = usb_alloc_isoc_req(...);
69       ...
70       ...
71     isoc_req->isoc_frame_no = usb_get_current_frame_number(dip) + offset;
72     isoc_req->isoc_attributes = USB_ATTRS_ISOC_START_FRAME;
73       ...
74       ...
75     if (usb_pipe_isoc_xfer(handle, isoc_req, 0) != USB_SUCCESS) {
76       ...
77     }
78 .fi
79 .in -2
81 .SH ATTRIBUTES
82 .sp
83 .LP
84 See \fBattributes\fR(5) for descriptions of the following attributes:
85 .sp
87 .sp
88 .TS
89 box;
90 c | c
91 l | l .
92 ATTRIBUTE TYPE  ATTRIBUTE VALUE
94 Architecture    PCI-based systems
96 Interface stability     Committed
97 .TE
99 .SH SEE ALSO
102 \fBattributes\fR(5), \fBusb_alloc_isoc_req\fR(9F),
103 \fBusb_get_max_pkts_per_isoc_request\fR(9F), \fBusb_pipe_isoc_xfer\fR(9F),
104 \fBusb_pipe_get_max_bulk_transfer_size\fR(9F), \fBusb_isoc_request\fR(9S)