ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
USBSpec.h |
Include Path : | <IOKit/usb/USBSpec.h> |
Path: | /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/usb/USBSpec.h |
This header contains constants and definitions of parameters that are used in communicating with USB devices and interfaces.
Device Class Codes |
enum { kUSBCompositeClass = 0, kUSBCommClass = 2, // Deprecated kUSBCommunicationClass = 2, kUSBHubClass = 9, kUSBDataClass = 10, kUSBDiagnosticClass = 220, kUSBWirelessControllerClass = 224, kUSBMiscellaneousClass = 239, kUSBApplicationSpecificClass = 254, kUSBVendorSpecificClass = 255 };
Constants for USB Device classes (bDeviceClass).
Device Request |
enum { kUSBRqGetStatus = 0, kUSBRqClearFeature = 1, kUSBRqGetState = 2, kUSBRqSetFeature = 3, kUSBRqReserved2 = 4, kUSBRqSetAddress = 5, kUSBRqGetDescriptor = 6, kUSBRqSetDescriptor = 7, kUSBRqGetConfig = 8, kUSBRqSetConfig = 9, kUSBRqGetInterface = 10, kUSBRqSetInterface = 11, kUSBRqSyncFrame = 12 };
Specifies values for the bRequest field of a Device Request.
Device Request Recipient |
enum { kUSBDevice = 0, kUSBInterface = 1, kUSBEndpoint = 2, kUSBOther = 3 };
This recipient is encoded in the bmRequestType field of a Device Request. It specifies the type of recipient for a request: the device, the interface, or an endpoint.
Device Request Type |
enum { kUSBStandard = 0, kUSBClass = 1, kUSBVendor = 2 };
This type is encoded in the bmRequestType field of a Device Request. It specifies the type of request: standard, class or vendor specific.
DFU Class Attributes |
enum { kUSBDFUAttributesMask = 0x07, kUSBDFUCanDownloadBit = 0, kUSBDFUCanUploadBit = 1, kUSBDFUManifestationTolerantBit = 2 };
Endpoint Descriptor bits |
enum { kUSBbEndpointAddressMask = 0x0f, kUSBbEndpointDirectionBit = 7, kUSBbEndpointDirectionMask = ( 1 << kUSBbEndpointDirectionBit ), kUSBEndpointDirectionOut = 0x00, kUSBEndpointDirectionIn = 0x80, kUSBEndpointbmAttributesTransferTypeMask = 0x03, kUSBEndpointbmAttributesSynchronizationTypeMask = 0x0c, kUSBEndpointbmAttributesSynchronizationTypeShift = 2, kUSBEndpointbmAttributesUsageTypeMask = 0x30, kUSBEndpointbmAttributesUsageTypeShift = 4 };
Bit definitions for endpoint descriptor fields
Endpoint direction |
enum { kUSBOut = 0, kUSBIn = 1, kUSBNone = 2, kUSBAnyDirn = 3 };
Used in IOUSBFindEndpointRequest's direction field
Endpoint type |
enum { kUSBControl = 0, kUSBIsoc = 1, kUSBBulk = 2, kUSBInterrupt = 3, kUSBAnyType = 0xFF };
Used in IOUSBFindEndpointRequest's type field
Feature Selectors |
enum { kUSBFeatureEndpointStall = 0, kUSBFeatureDeviceRemoteWakeup = 1 };
Used with SET/CLEAR_FEATURE requests.
HID Protocol |
enum { kHIDBootProtocolValue = 0, kHIDReportProtocolValue = 1 };
Used in the SET_PROTOCOL device request
HID report types |
enum { kHIDRtInputReport = 1, kHIDRtOutputReport = 2, kHIDRtFeatureReport = 3 };
Constants for the three kinds of HID reports.
HID requests |
enum { kHIDRqGetReport = 1, kHIDRqGetIdle = 2, kHIDRqGetProtocol = 3, kHIDRqSetReport = 9, kHIDRqSetIdle = 10, kHIDRqSetProtocol = 11 };
Constants for HID requests.
Interface Class |
enum { kUSBAudioClass = 1, // Deprecated kUSBAudioInterfaceClass = 1, kUSBCommunicationControlInterfaceClass = 2, kUSBCommunicationDataInterfaceClass = 10, kUSBHIDClass = 3, kUSBHIDInterfaceClass = 3, kUSBPhysicalInterfaceClass = 5, kUSBImageInterfaceClass = 6, kUSBPrintingClass = 7, // Deprecated kUSBPrintingInterfaceClass = 7, kUSBMassStorageClass = 8, // Deprecated kUSBMassStorageInterfaceClass = 8, kUSBChipSmartCardInterfaceClass = 11, kUSBContentSecurityInterfaceClass = 12, kUSBVideoInterfaceClass = 14, kUSBDiagnosticDeviceInterfaceClass = 220, kUSBWirelessControllerInterfaceClass = 224, kUSBApplicationSpecificInterfaceClass = 254, kUSBVendorSpecificInterfaceClass = 255 };
Constants for Interface classes (bInterfaceClass).
Interface Protocol |
enum { // For kUSBHIDInterfaceClass // kHIDNoInterfaceProtocol = 0, kHIDKeyboardInterfaceProtocol = 1, kHIDMouseInterfaceProtocol = 2, kUSBVendorSpecificProtocol = 0xff, // For kUSBDiagnosticDeviceInterfaceClass // kUSB2ComplianceDeviceProtocol = 0x01, // For kUSBWirelessControllerInterfaceClass // kUSBBluetoothProgrammingInterfaceProtocol = 0x01, // For kUSBMiscellaneousClass // KUSBInterfaceAssociationDescriptorProtocol = 0x01 };
Reported in the bInterfaceProtocol field of the Interface Descriptor.
Interface SubClass |
enum { kUSBCompositeSubClass = 0, kUSBHubSubClass = 0, // For the kUSBAudioInterfaceClass // kUSBAudioControlSubClass = 0x01, kUSBAudioStreamingSubClass = 0x02, kUSBMIDIStreamingSubClass = 0x03, // For the kUSBApplicationSpecificInterfaceClass // kUSBDFUSubClass = 0x01, kUSBIrDABridgeSubClass = 0x02, kUSBTestMeasurementSubClass = 0x03, // For the kUSBMassStorageInterfaceClass // kUSBMassStorageRBCSubClass = 0x01, kUSBMassStorageATAPISubClass = 0x02, kUSBMassStorageQIC157SubClass = 0x03, kUSBMassStorageUFISubClass = 0x04, kUSBMassStorageSFF8070iSubClass = 0x05, kUSBMassStorageSCSISubClass = 0x06, // For the kUSBHIDInterfaceClass // kUSBHIDBootInterfaceSubClass = 0x01, // For the kUSBCommunicationDataInterfaceClass // kUSBCommDirectLineSubClass = 0x01, kUSBCommAbstractSubClass = 0x02, kUSBCommTelephoneSubClass = 0x03, kUSBCommMultiChannelSubClass = 0x04, kUSBCommCAPISubClass = 0x05, kUSBCommEthernetNetworkingSubClass = 0x06, kUSBATMNetworkingSubClass = 0x07, // For the kUSBDiagnosticDeviceInterfaceClass // kUSBReprogrammableDiagnosticSubClass = 0x01, // For the kUSBWirelessControllerInterfaceClass // kUSBRFControllerSubClass = 0x01, // For the kUSBMiscellaneousClass // kUSBCommonClassSubClass = 0x02, // For the kUSBVideoInterfaceClass // kUSBVideoControlSubClass = 0x01, kUSBVideoStreamingSubClass = 0x02, kUSBVideoInterfaceCollectionSubClass = 0x03 };
Constants for USB Interface SubClasses (bInterfaceSubClass).
USB Descriptors |
enum { kUSBAnyDesc = 0, // Wildcard for searches kUSBDeviceDesc = 1, kUSBConfDesc = 2, kUSBStringDesc = 3, kUSBInterfaceDesc = 4, kUSBEndpointDesc = 5, kUSBDeviceQualifierDesc = 6, kUSBOtherSpeedConfDesc = 7, kUSBInterfacePowerDesc = 8, kUSBOnTheGoDesc = 9, kUSDebugDesc = 10, kUSBInterfaceAssociationDesc = 11, kUSBHIDDesc = 0x21, kUSBReportDesc = 0x22, kUSBPhysicalDesc = 0x23, kUSBHUBDesc = 0x29 };
Specifies values for diffent descriptor types.
USB Power constants |
enum { kUSB100mAAvailable = 50, kUSB500mAAvailable = 250, kUSB100mA = 50, kUSBAtrBusPowered = 0x80, kUSBAtrSelfPowered = 0x40, kUSBAtrRemoteWakeup = 0x20 };
Constants relating to USB Power.
USB Release constants |
enum { kUSBRel10 = 0x0100, kUSBRel11 = 0x0110, kUSBRel20 = 0x0200 };
Constants relating to USB releases as found in the bcdUSB field of the Device Descriptor.
kUSBAlternateSetting |
#define kUSBAlternateSetting "bAlternateSetting"
USB property names taken from the field names in various descriptors
kUSBConfigurationValue |
#define kUSBConfigurationValue "bConfigurationValue"
USB property names taken from the field names in various descriptors
kUSBDeviceClass |
#define kUSBDeviceClass "bDeviceClass"
USB property names taken from the field names in various descriptors
kUSBDeviceMaxPacketSize |
#define kUSBDeviceMaxPacketSize "bMaxPacketSize0"
USB property names taken from the field names in various descriptors
kUSBDeviceNumConfigs |
#define kUSBDeviceNumConfigs "bNumConfigurations"
USB property names taken from the field names in various descriptors
kUSBDeviceProtocol |
#define kUSBDeviceProtocol "bDeviceProtocol"
USB property names taken from the field names in various descriptors
kUSBDeviceReleaseNumber |
#define kUSBDeviceReleaseNumber "bcdDevice"
USB property names taken from the field names in various descriptors
kUSBDeviceSubClass |
#define kUSBDeviceSubClass "bDeviceSubClass"
USB property names taken from the field names in various descriptors
kUSBInterfaceClass |
#define kUSBInterfaceClass "bInterfaceClass"
USB property names taken from the field names in various descriptors
kUSBInterfaceNumber |
#define kUSBInterfaceNumber "bInterfaceNumber"
USB property names taken from the field names in various descriptors
kUSBInterfaceProtocol |
#define kUSBInterfaceProtocol "bInterfaceProtocol"
USB property names taken from the field names in various descriptors
kUSBInterfaceStringIndex |
#define kUSBInterfaceStringIndex "iInterface"
USB property names taken from the field names in various descriptors
kUSBInterfaceSubClass |
#define kUSBInterfaceSubClass "bInterfaceSubClass"
USB property names taken from the field names in various descriptors
kUSBManufacturerStringIndex |
#define kUSBManufacturerStringIndex "iManufacturer"
USB property names taken from the field names in various descriptors
kUSBNumEndpoints |
#define kUSBNumEndpoints "bNumEndpoints"
USB property names taken from the field names in various descriptors
kUSBProductID |
#define kUSBProductID "idProduct" // good name
USB property names taken from the field names in various descriptors
kUSBProductName |
#define kUSBProductName "idProduct" // bad name - keep for backward compatibility
USB property names taken from the field names in various descriptors
kUSBProductStringIndex |
#define kUSBProductStringIndex "iProduct"
USB property names taken from the field names in various descriptors
kUSBSerialNumberStringIndex |
#define kUSBSerialNumberStringIndex "iSerialNumber"
USB property names taken from the field names in various descriptors
kUSBVendorID |
#define kUSBVendorID "idVendor" // good name
USB property names taken from the field names in various descriptors
kUSBVendorName |
#define kUSBVendorName "idVendor" // bad name - keep for backward compatibility
USB property names taken from the field names in various descriptors
Property Names |
kUSBDeviceClass
kUSBDeviceSubClass
kUSBDeviceProtocol
kUSBDeviceMaxPacketSize
kUSBVendorID
kUSBVendorName
kUSBProductID
kUSBProductName
kUSBDeviceReleaseNumber
kUSBManufacturerStringIndex
kUSBProductStringIndex
kUSBSerialNumberStringIndex
kUSBDeviceNumConfigs
kUSBInterfaceNumber
kUSBAlternateSetting
kUSBNumEndpoints
kUSBInterfaceClass
kUSBInterfaceSubClass
kUSBInterfaceProtocol
kUSBInterfaceStringIndex
kUSBConfigurationValue
#define kUSBDeviceClass "bDeviceClass" #define kUSBDeviceSubClass "bDeviceSubClass" #define kUSBDeviceProtocol "bDeviceProtocol" #define kUSBDeviceMaxPacketSize "bMaxPacketSize0" #define kUSBVendorID "idVendor" // good name #define kUSBVendorName "idVendor" // bad name - keep for backward compatibility #define kUSBProductID "idProduct" // good name #define kUSBProductName "idProduct" // bad name - keep for backward compatibility #define kUSBDeviceReleaseNumber "bcdDevice" #define kUSBManufacturerStringIndex "iManufacturer" #define kUSBProductStringIndex "iProduct" #define kUSBSerialNumberStringIndex "iSerialNumber" #define kUSBDeviceNumConfigs "bNumConfigurations" #define kUSBInterfaceNumber "bInterfaceNumber" #define kUSBAlternateSetting "bAlternateSetting" #define kUSBNumEndpoints "bNumEndpoints" #define kUSBInterfaceClass "bInterfaceClass" #define kUSBInterfaceSubClass "bInterfaceSubClass" #define kUSBInterfaceProtocol "bInterfaceProtocol" #define kUSBInterfaceStringIndex "iInterface" #define kUSBConfigurationValue "bConfigurationValue"
USB property names taken from the field names in various descriptors
|
Last Updated: 2008-12-19