Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

usb_get_max_pkts_per_isoc_request(9f) [sunos man page]

usb_get_max_pkts_per_isoc_request(9F)			   Kernel Functions for Drivers 		     usb_get_max_pkts_per_isoc_request(9F)

NAME
usb_get_max_pkts_per_isoc_request - Get maximum number of packets allowed per isochronous request SYNOPSIS
#include <sys/usb/usba.h> uint_t usb_get_max_pkts_per_isoc_request(dev_info_t *dip); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
dip Pointer to the device's dev_info structure. DESCRIPTION
The usb_get_max_pkts_per_isoc_request() function returns the maximum number of isochronous packets per request that the host control driver can support. This number can be used to determine the maximum amount of data which can be handled by a single isochronous request. That length is found by: max = usb_get_max_pkts_per_isoc_request(dip) * endpoint_max_packet_size; where endpoint_max_packet_size is the wMaxPacketSize field of the isochronous endpoint over which the transfer will take place. RETURN VALUES
On success, the usb_get_current_frame_number() function returns the maximum number of isochronous pkts per request. On failure it returns 0. The function fails if dip is NULL. CONTEXT
May be called from user, kernel or interrupt context. EXAMPLES
/* * Set up to receive periodic isochronous data, requesting * the maximum amount for each transfer. */ int pkt; /* Get max packet size from endpoint descriptor. */ uint_t ep_max_pkt_size = ep_descr.wMaxPacketSize; uint_t isoc_pkts_count = usb_get_max_pkts_per_isoc_request(dip); /* * Allocate an isoc request, specifying the max number of packets * and the greatest size transfer possible. */ usb_isoc_req_t *isoc_req = usb_alloc_isoc_req(dip, isoc_pkts_count, isoc_pkts_count * ep_max_pkt_size, USB_FLAGS_SLEEP); /* Init each packet descriptor for maximum size. */ for (pkt = 0; pkt < isoc_pkts_count; pkt++) { isoc_req->isoc_pkt_descr[pkt].isoc_pkt_length = ep_max_pkt_size; } /* Set the length of a packet in the request too. */ isoc_req->isoc_pkts_length = ep_max_pkt_size; /* Other isoc request initialization. */ ... ... if (usb_pipe_isoc_xfer(pipe, isoc_req, USB_FLAGS_NOSLEEP) != USB_SUCCESS) { ... } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |PCI-based systems | +-----------------------------+-----------------------------+ |Interface stability |Evolving | +-----------------------------+-----------------------------+ |Availability |SUNWusb | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), usb_pipe_isoc_xfer(9F), usb_alloc_request(9F), usb_get_current_frame_number(9F). usb_ep_descr(9S), usb_isoc_request(9S) SunOS 5.10 5 Jan 2004 usb_get_max_pkts_per_isoc_request(9F)

Check Out this Related Man Page

usb_get_current_frame_number(9F)			   Kernel Functions for Drivers 			  usb_get_current_frame_number(9F)

NAME
usb_get_current_frame_number - Return current logical usb frame number SYNOPSIS
#include <sys/usb/usba.h> usb_frame_number_t usb_get_current_frame_number(dev_info_t *dip); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
dip Pointer to the device's dev_info structure. DESCRIPTION
The usb_get_current_frame_number() function retrieves the current logical USB frame number. 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. The USB specification requires that the frame frequency (the period between start-of-frame packets) is one millisecond. The Solaris oper- ating environment USB implementation uses a running counter of the number of milliseconds since boot as the current logical frame number. RETURN VALUES
On success, the usb_get_current_frame_number() function returns the current USB frame number. On failure it returns 0. The function fails if dip is NULL. CONTEXT
May be called from user, kernel or interrupt context. EXAMPLES
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) { ... } ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Architecture |PCI-based systems | +-----------------------------+-----------------------------+ |Interface stability |Committed | +-----------------------------+-----------------------------+ |Availability |SUNWusb | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5), usb_alloc_isoc_req(9F), usb_get_max_pkts_per_isoc_request(9F), usb_pipe_isoc_xfer(9F), usb_pipe_get_max_bulk_trans- fer_size(9F), usb_isoc_request(9S) SunOS 5.11 25 July 2004 usb_get_current_frame_number(9F)
Man Page