From sacadmin Mon Nov 20 11:34:37 2006
Received: from sfbaymail2sca.sfbay.sun.com (sfbaymail2sca.SFBay.Sun.COM [129.145.155.42])
	by sac.sfbay.sun.com (8.13.6+Sun/8.13.6) with ESMTP id kAKJYat9003406
	for <PSARC@sac.sfbay.sun.com>; Mon, 20 Nov 2006 11:34:36 -0800 (PST)
Received: from nwk-ea-fw-1.sun.com (nwkes-gis-mail-2.SFBay.Sun.COM [10.4.134.6])
	by sfbaymail2sca.sfbay.sun.com (8.13.6+Sun/8.12.10/ENSMAIL,v2.2) with ESMTP id kAKJYaTj023614
	for <PSARC@sac.sfbay.sun.com>; Mon, 20 Nov 2006 11:34:36 -0800 (PST)
Received: from d1-sfbay-10.sun.com ([192.18.39.120])
	by nwk-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id kAKJYVTi004435
	for <PSARC@sac.sfbay.sun.com>; Mon, 20 Nov 2006 11:34:31 -0800 (PST)
Received: from conversion-daemon.d1-sfbay-10.sun.com by d1-sfbay-10.sun.com
 (Sun Java System Messaging Server 6.2-6.01 (built Apr  3 2006))
 id <0J9100301NLGYU00@d1-sfbay-10.sun.com> (original mail from frits@sun.com)
 for PSARC@sac.sfbay.sun.com; Mon, 20 Nov 2006 11:34:31 -0800 (PST)
Received: from [10.192.22.174] ([192.18.45.134])
 by d1-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3
 2006)) with ESMTPSA id <0J9100D0ONPINS65@d1-sfbay-10.sun.com>; Mon,
 20 Nov 2006 11:34:31 -0800 (PST)
Date: Mon, 20 Nov 2006 11:34:32 -0800
From: frits vanderlinden <frits@sun.com>
Subject: USB Interface Association support [PSARC/2006/649]
Sender: Frits.Vanderlinden@sun.com
To: PSARC@sac.sfbay.sun.com
Cc: usb-tech <usb-tech@sun.com>, Tarl Neustaedter <Tarl.Neustaedter@sun.com>
Message-id: <45620348.8050508@sun.com>
MIME-version: 1.0
Content-type: multipart/mixed; boundary="Boundary_(ID_IbYjtq5PdL9yxWnX8RTZSg)"
User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025)
Status: RO
Content-Length: 10025

This is a multi-part message in MIME format.

--Boundary_(ID_IbYjtq5PdL9yxWnX8RTZSg)
Content-type: text/plain; format=flowed; charset=ISO-8859-1
Content-transfer-encoding: 7BIT

I am sponsoring this fasttrack for Gaopeng Chen.
I believe this proposal qualifies for self-review and I am marking this
case "closed approved automatic".

Extensive discussions have taken place on updating the USB 1275 bindings 
with FWARC folks for Interface Associations and there appears to be 
agreement on the approach. I have deposited the draft update of the USB 
bindings in the case directory.

In the unlikely case FWARC derails or requires a major change, this case 
will have to be reopened/updated.

The reason I am submitting this case now is because 11/23 is my last day 
(I will retire).
I wanted to wrap this up personally after working with the team for 
quite a while on this proposal.

cheers

fritS


--Boundary_(ID_IbYjtq5PdL9yxWnX8RTZSg)
Content-type: text/plain; name=proposal; x-mac-creator=0; x-mac-type=0
Content-transfer-encoding: 7BIT
Content-disposition: inline; filename=proposal


1. Background
-------------

USB IAD (Interface Association Descriptor) was introduced in a USB ECN doc in 2003 
(refer to 2.1). It defines a new standard descriptor that lists multiple interfaces 
which are associated with one device function. This allows the OS to optionally bind
one driver instance to a group of interfaces.

IAD has already been included in audio class (after spec 1.7i), video class and the
Wireless USB.  New class drivers depend on the IAD feature.

The project team is in the process of submitting a FWARC fasttrack to update the
USB bindings. The new draft bindings are in the case directory.
The original bindings can be found in:
	 http://playground.sun.com/1275/home.html#OFDbusUSB.

2. References
-------------

  2.1 "Interface Association Descriptor Engineering Change Notice (ECN)"
	http://www.usb.org/developers/docs

  2.2 "USB Interface Association Descriptor Device Class Code 
	and Use Model White Paper"
	http://www.usb.org/developers/whitepapers

  2.3 USB video class spec (v1.1)
         (http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip)

  2.4 USB audio class spec (v2.0)
      (http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip)

  2.5 Wireless USB specs (http://www.usb.org/developers/wusb/)

  2.6 FWARC/TBD  update of USB bindings (in preparation)

  2.7 PSARC/1998/111  Universal Serial Bus Framework Support

  2.8 PSARC/2000/542  USB Architecture Update project

  2.9 PSARC/2003/207  USBA2.0: adding USBA interfaces to the DDI


3. Solution
-----------

This case proposes supporting the IAD in Solaris. It makes the devices work
with either IA leaf drivers (in other words, a driver bound to an IA) or
interface leaf drivers (children of the IA nexus driver).

3.1 Update of USBA framework
----------------------------

A new type of node, IA (Interface-Association) node is created for each
IA descriptor. USBA allows users to bind a driver to a device, IA or
interface node. 

If no driver is found for the device node, the generic multi interface driver
(usb_mid(7D) will be bound. It creates interface and IA children.

If no driver is found for an IA node, a generic nexus driver usb_ia will be bound.
This driver creates child nodes for the set of interfaces belonging to the IA
allowing interface drivers to attach. 
   
Example:
  
A video device with IAD will have the following device tree. A new video driver
is bound to video interface association. No driver is available for the audio IA,
so usb_ia manages it and creates interface nodes for audio control and stream
(these are drivers that are in Solaris today).

      device, instance # (usb_mid)
          interface, instance # (...)
          video, instance # (usb_video)             <<<< interface association
          audio, instance # (usb_ia)                <<<< interface association
              interface, instance # (usb_ac)
              interface, instance # (usb_as)    

Note that this approach allows using existing interface leaf drivers within an IA
group but provides the option to write a new single audio driver which will be 
bound to the interface association node.

3.2 Update of node names and binding rules
------------------------------------------

The properties of an IA node are defined in [2.6].

The name of the node should be chosen from the following table, using the first
name applicable:

        bFunction   bFunctionSub   bFunction   Name
        Class       Class          Protocol
        __________________________________________________________
        0x01        any            any         audio
        0x0E        any            any         video
        0xE0        0x02           0x02        device-wire-adapter
        0xE0        any            any         wireless-controller
        any         any            any         interface-association

The new IA node will have the following compatible names for driver binding.
"usb,ia" is appended to the tail for binding the default driver usb_ia.

        VID     idVendor
        PID     idProduct
        REV     bcdDevice
        FN      bFirstInterface
        FC      bFunctionClass
        FSC     bFunctionSubClass
        FPROTO  bFunctionProtocol

        1) usbiaVID,PID.REV.configCN.FN
        2) usbiaVID,PID.configCN.FN
        3) usbiaVID,classFC.FSC.FPROTO
        4) usbiaVID,classFC.FSC
        5) usbiaVID,classFC
        6) usbia,classFC.FSC.FPROTO
        7) usbia,classFC.FSC
        8) usbia,classFC
        9) usb,ia

    Refer to [2.6] for more details.

3.3 Update of USBA interfaces
-----------------------------

    3.3.1 Changes in public header files

      A new type of descriptor IAD has been added to usbai.h. In addition, more class
      types are defined for the related USB classes (see interface table).

    3.3.2 The change of USBA committed functions

      usb_set_alt_if() is the only interface that is affected by this project.
      The old function requires the driver to be bound to the entire device or
      the same interface to avoid contending with another driver for a different
      part of the device.  Now the driver is allowed to be bound to the entire
      device, or the IA node which includes this alternative interface, or the
      corresponding interface. Therefore an IA driver can completely control the
      whole interface association. This change is backwards compatible.

3.4 Questions and Answers
-------------------------

    3.4.1 Why create a new type of device node?

      This is a  new USB feature and is also supported by Windows and new devices
      are appearing on the market. It allows a driver to be bound to a function
      which has multiple interfaces or leverage existing interface drivers.
      
    3.4.2 Why is a nexus driver necessary?

      If there is no driver found for IA nodes, usb_ia can be bound to IA nodes and 
      create children nodes for interfaces. 
      It gives user two choices: to bind a driver to an IA or interface nodes.
      
    3.4.3 What is the impact on the use of devices and existing drivers?

      No impact on devices without IAD. No impact on existing client drivers.  
      Those devices that have an IAD and old class drivers are binary compatible
      and work well in the new USBA, such as audio 2.0 class devices. In other
      words, the existing devices and drivers are compatible with this 
      approach. 
      New class devices with IAD will work with the new driver bound to IA node,
      such as video class devices.

    3.4.4 What is the benefit of IAD support?

      It provides a way to bind a single driver to multiple interfaces.  It 
      makes the development of complicated device drivers easier. A video class 
      driver with IAD support will be released soon. And the upcoming Wireless 
      USB drivers will depend on IA as well.


4. Documentation updates
------------------------

Draft man pages with changebars are in the case directory.

Man page usba(7D), usb_mid(7D), usb_set_alt_if(9F) will be updated.

usb_ia(7D) man page will be added for the new driver usb_ia. 

WDD (Write Device Drivers) guide will be updated. 


5. Interface table
------------------

        Com =   Committed

Interface                     Level       Comments
+------------------------------------------------------------------------------+
|                        Interface exported                                    |
+------------------------------------------------------------------------------+
usb_ia_descr_t               | Com | Interface Association Descriptor ECN
USB_DESCR_TYPE_IA            | Com | Interface Association Descriptor ECN
USB_CLASS_IMAGE              | Com | Image interface class
USB_CLASS_VIDEO              | Com | Video interface class
USB_CLASS_WIRELESS           | Com | Wireless controller interface class
USB_SUBCLS_VIDEO_CONTROL     | Com | Video-control subclass
USB_SUBCLS_VIDEO_STREAM      | Com | Video-stream subclass
USB_SUBCLS_VIDEO_COLLECTION  | Com | Video collection subclass
USB_SUBCLS_WUSB_1            | Com | Wireless subclass 1
USB_SUBCLS_WUSB_2            | Com | Wireless subclass 2
USB_PROTO_WUSB_HWA           | Com | Wireless Host Wire Adapter protocol
USB_PROTO_WUSB_DWA           | Com | Wireless Device Wire Adapter protocol
USB_PROTO_WUSB_DWA_ISO       | Com | Wireless Device Wire Adapter isoc protocol
usb_ia                       | Com | interface association driver name
+------------------------------------------------------------------------------+
|                        Interface changed                                     |
+------------------------------------------------------------------------------+
 usb_set_alt_if              | Com | Set an alt iface to current iface         
+------------------------------------------------------------------------------+


6. Release binding
Patch/Update.



--Boundary_(ID_IbYjtq5PdL9yxWnX8RTZSg)--

