To ensure proper device and driver matching, additional information regarding the device is examined if none or more than one driver matches the product ID and vendor ID values for the device. There are several classes of drivers defined by various USB specifications, and new classes are being proposed all the time. The Macintosh USB software includes HID class drivers for the HID interfaces in the USB keyboard and mouse. A USB device includes an interface or interfaces, which are defined in device descriptor data structures associated with the device. The interfaces are like sub devices within the device, each having a function specified by numerical class and sub class identifiers.
Interfaces also define how a function in a device is accessed by the host system.
The functional features of the device are accessed by the USL when given an interface reference. The Macintosh system software maintains a driver dispatch table for USB class drivers that defines among other things the driver initialization routine, driver gestalt, and the driver callback notification routine. For more information, see the driver descriptor structure defined in the USBServices.lib.h file. The USB Services library is the programming interface that USB device drivers use to communicate with the USB on a Macintosh computer. The USL provides the services necessary to find a device with the appropriate interface, open an interface to the device, open the device, instantiate the appropriate pipe connections, determine device status, and perform read and write transactions with the device.