Composite Function
Framework for USB
Using Composite Functions
Belcarra Technologies (2005) Corp.
June 5, 2008
Overview Plan
This presentation is divided into the following sections:
The IAD model - basics
USB hosts decompose a USB device of class USB_CLASS_MISC (0EFh) into smaller virtual devices using Internet Association (IAD) descriptors
The IAD model - Device Descriptors
In the IAD model, the host OS builds a virtual descriptor for each virtual device based on the actual device descriptor for
the device
The IAD model - interface indexing
For host OS matching rules, it is very important to know the value of bFirstInterface for all functions. On the host side bFirstInterface is known as MI (matching interface)
Example, if there are three functions then
bFirstInterface[0]=0
bFirstInterface[1]=bFirstInterface[0]+bInterfaceCount[0]
bFirstInterface[2]=bFirstInterface[1]+bInterfaceCount[1]
The values of bInterfaceCount in turn depend on the protocol:
mouse.interfaceCount=1
msc.interfaceCount=1
eem.interfaceCount=1
ecm.interfaceCount=2
acm.interfaceCount=2
Configuration 1: hid2
Interface functions:mouse-if:mouse-if
Class drivers
Vendor drivers
All other USB drivers are vendor drivers.
Configuration 2: hid-serial
Interface functions: mouse-if:tty-if
Interface 0
Interface 1
Configuration 2: Interface 1
Interface 1 of Configuration 2 is ACM
Notes:
Configuration 3: hid-eem
Interface functions: mouse-if:eem-if
Interface 0
Interface 1
Configuration 3: Interface 1
Interface 1 of Configuration 3 is EEM
Notes:
Composite Configuration: details
A new composite configuration will have the following minimum details (with values from Configuration 3).
Some details follow
Configuration fields - Part 1
composite_function.driver.name = "hid-eem"
This is the name used by generic_cf to refer to the configuration internally
iConfiguration = "hid-eem"
this name is placed in the Configuration Desciptor. This name is visible by use of tools such as USBVIEW but is not used by the host for device identification.
bDeviceClass = USB_CLASS_MISC
This symbolic value = 0EFh is prescribed for all IAD (composite) configurations.
Belcarra automatically inserts matching required bDeviceSubclass and bDeviceProtocol values.
Configuration fields - Part 2
VendorID
Standard VendorID value issued by usb.org. For test purposes only, Belcarra's Vendor ID 15ec can be used.
ProductID
Product ID value issued by device manufacturer. Belcarra issues demo versions of its USBLAN driver with Vendor ID 15ec (Belcarra) and specified Product ID
IAD Descriptor details
IAD Descriptors contain fields of two types:
Specifically, fields of the first type are:
Fields of the second type: bFunctionClass, bFunctionSubClass, bFunctionProtocol.
The values for these fields are taken from similarly named fields in other descriptors for single-function devices
Configuration 3, IAD Descriptors
IAD descriptors are generated automatically based on values from the interface functions
IAD0 values are from Function 0 : mouse-if
bFirstInterface:0
bInterfaceCount:1
bFunctionClass:3 (Human interface device)
bFunctionSubClass:1 (Boot interface subclass)
bFunctionProtocol:2 (Mouse)
IAD1 uses values from Function 1: eem-if
bFirstInterface:1
bInterfaceCount:1
bFunctionClass:2 (Communications class code)
bFunctionSubClass:0C (EEM Subclass code)
bFunctionProtocol:07 (EEM protocol code)
I
Interface functions
Interface Function Instances
For each interface function named in a composite configuration, the Belcarra USB system creates functionally separate interface instances via the interface_names parameter
Vendor composite framework
Belcarra's generic_cf has two roles
For a final product product, the generic_cf should be cloned and adapted to specific needs
The new module vendor_cf should be used instead
USB target milestones
USB host milestones
Host side -- repeated for each supported Host OS
Note: IAD concept of firstInterface is mapped to the earlier/legacy host concept of matching interface # (MI)
Example of possible matching conflicts
In each example we give the list of interface drivers, then the firstInterface values, and comments
1. mouse-if:tty-if 0/1 ACM driver must match MI_1
2. mouse-if:eem-if 0/1 EEM driver must match MI_1. This configuration must use a different PID to avoid conflict
3. eem-if:mouse-if EEM driver must match MI_0. No conflict with Example 1 because HID is a class driver
4. tty-if:tty-if ACM driver(s) must match MI_0 and MI_2. Conflicts with Example 3. Compatible with Examples 1
& 2
5. tty-if:tty-if:eem-if Extends Example 4. EEM must match MI_4. EEM host driver must not match MI_0 or MI_2
6. msc-if:eem-if:tty-if Compatible with Example 4 and 5 (if EEM also matches MI-1). Conflicts with Example 1