I am sponsoring this fast track for Raymond Chen.
Requested binding is patch/micro, timeout 11/21/2007.
-Artem
Template Version: @(#)sac_nextcase 1.64 07/13/07 SMI
This information is Copyright 2007 Sun Microsystems
1. Introduction
1.1. Project/Component Working Name:
Support for isochronous transfer in ugen(7D)
1.2. Name of Document Author/Supplier:
Author: Raymond Chen
1.3 Date of This Document:
13 November, 2007
4. Technical Description
4.1. Problem
Ugen(7D) was introduced in PSARC/2001/137 USB Generic Driver Support.
It supports USB control, bulk and interrupt transfers. Isochronous
support was deferred in that case, while today it is extensively used
in USB streaming devices, such as audio and video. Applications
depending on ugen or libusb(3LIB) can not communicate with USB
devices using isochronous transfer.
4.2. Proposal
We propose to add isochronous transfer support to ugen(7D).
This proposal uses the existing ugen data access model for
isochronous endpoints, which means that applications will continue
using read(2) and write(2) system calls to communicate with ugen,
just as with other transfer types.
Isochronous transfer is time-sensitive and does not guarantee
reliable data delivery. Data is transmitted in packets, with one
packet per USB frame or microframe, and the transfer results are
returned by packet. Therefore, to make an isochronous transfer
request, the application needs to specify packets information to the
ugen driver, including packet count and packet length of each packet.
And the ugen driver should return the transfer result for each
packet. This is one aspect where isochronous is is different from
control, bulk and interrupt transfers.
Two new structures are proposed for setting and getting packet
information for isochronous packets. One structure is used to
describe a single isochronous packet information:
typedef struct ugen_isoc_pkt_descr {
/*
* Set by the application, for all isochronous
* requests, to the number of bytes to transfer
* in a packet.
*/
ushort_t dsc_isoc_pkt_len;
/*
* Set by ugen to actual number of bytes sent/received
* in a packet.
*/
ushort_t dsc_isoc_pkt_actual_len;
/*
* Per packet status set by ugen driver both for the
* isochronous IN and OUT requests. Application can
* use USB_LC_STAT_* to parse the status.
*/
int dsc_isoc_pkt_status;
} ugen_isoc_pkt_descr_t;
Another structure is for applications to pass to ugen isochronous
transfer requests:
typedef struct ugen_isoc_req_head {
/* pkt count of the isoc request */
int req_isoc_pkts_count;
/* pkt descriptor array */
ugen_isoc_pkt_descr_t req_isoc_pkt_descrs[1];
} ugen_isoc_req_head_t;
For isochronous IN endpoint, applications start by write(2)'ing a
packet request in order for ugen to set up data transfer with the
device. Then applications can continuously receive payload data along
with packet transfer results as follows:
1) application write(2)'s a request to ugen:
packet count + packet descriptors
2) ugen starts isochronous polling on the endpoint and sets packet
status
3) application continuously consumes device data via read(2):
packet descriptors + payload data
For isochronous OUT endpoint, application will write data to ugen
with isochronous packets information at the beginning of data stream.
Based on received information, ugen will take proper action to
transfer the payload data:
1) application write(2)'s a request and payload data to ugen:
packet count + packet descriptors + payload data
2) ugen transfers the data and sets packet status
3) application can read(2) the same device node to retrieve transfer
status of packets in last request:
packet descriptors
See ugen(7D) man page changes in case directory for code examples.
4.3. Interfaces
-------------------------------+-----------+--------------------------
ugen_isoc_pkt_descr_t | Committed | packet descriptor
ugen_isoc_req_head_t | Committed | Isoc request header
USB_LC_STAT_ISOC_POLLING_FAILED| Committed | Isoc polling failed
USB_LC_STAT_ISOC_UNINITIALIZED | Committed | Isoc info not initialized
USB_LC_STAT_ISOC_PKT_ERROR | Committed | All isoc packets in the
| | request fail
-------------------------------+-----------+--------------------------
Binding: patch/micro
4.4. References
PSARC/2001/137 USB Generic Driver Support
PSARC/2002/124 USB UGEN driver, update 1
6. Resources and Schedule
6.4. Steering Committee requested information
6.4.1. Consolidation C-team Name:
ON
6.5. ARC review type: FastTrack
6.6. ARC Exposure: open