'\" te .\" Copyright (c) 2004, Sun Microsystems, Inc., All Rights Reserved .TH usb_get_current_frame_number 9F "25 July 2004" "SunOS 5.11" "Kernel Functions for Drivers" .SH NAME usb_get_current_frame_number \- Return current logical usb frame number .SH SYNOPSIS .LP .nf #include \fBusb_frame_number_t\fR \fBusb_get_current_frame_number\fR(\fBdev_info_t *\fR\fIdip\fR); .fi .SH INTERFACE LEVEL .sp .LP Solaris DDI specific (Solaris DDI) .SH PARAMETERS .sp .ne 2 .mk .na \fB\fIdip\fR\fR .ad .RS 7n .rt Pointer to the device's \fBdev_info\fR structure. .RE .SH DESCRIPTION .sp .LP The \fBusb_get_current_frame_number()\fR function retrieves the current logical USB frame number. .sp .LP Isochronous requests can be started on a particular numbered frame. An offset number of frames (typically between 4 and 10) can be added to the current logical frame number to specify the number of an upcoming frame to start an isochronous request. .sp .LP The USB specification requires that the frame frequency (the period between start-of-frame packets) is one millisecond. The Solaris operating environment USB implementation uses a running counter of the number of milliseconds since boot as the current logical frame number. .SH RETURN VALUES .sp .LP On success, the \fBusb_get_current_frame_number()\fR function returns the current USB frame number. On failure it returns \fB0\fR. The function fails if \fIdip\fR is NULL. .SH CONTEXT .sp .LP May be called from user, kernel or interrupt context. .SH EXAMPLES .sp .in +2 .nf usb_pipe_handle_t handle; usb_frame_number_t offset = 10; usb_isoc_req_t *isoc_req; isoc_req = usb_alloc_isoc_req(...); ... ... isoc_req->isoc_frame_no = usb_get_current_frame_number(dip) + offset; isoc_req->isoc_attributes = USB_ATTRS_ISOC_START_FRAME; ... ... if (usb_pipe_isoc_xfer(handle, isoc_req, 0) != USB_SUCCESS) { ... } .fi .in -2 .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ ArchitecturePCI-based systems _ Interface StabilityCommitted _ Availabilitysystem/io/usb .TE .SH SEE ALSO .sp .LP \fBattributes\fR(5), \fBusb_alloc_isoc_req\fR(9F), \fBusb_get_max_pkts_per_isoc_request\fR(9F), \fBusb_pipe_isoc_xfer\fR(9F), \fBusb_pipe_get_max_bulk_transfer_size\fR(9F), \fBusb_isoc_request\fR(9S)