#include <IOKit/usb/USB.h>
IOKit/usb/USB.h
Nothing to define
macroUSBToHostWord
@defineblock Endian conversion definitions
@discussion The USB API's use a convention of specifying parameters in the host order. The USB spec specifies that multi-byte items should be
formatted in little endian order. The following macros allow one to translate multi-byte values from Host order to USB order and vice versa. There are separate macros for
in-kernel use and for user space use.
#define USBToHostWord USBToHost16
macroHostToUSBWord
#define HostToUSBWord HostToUSB16
macroUSBToHostLong
#define USBToHostLong USBToHost32
macroHostToUSBLong
#define HostToUSBLong HostToUSB32
macroUSBBitRange
#define USBBitRange(start, end) IOUSBBitRange(start, end)
macroUSBBitRangePhase
#define USBBitRangePhase(start, end) IOUSBBitRangePhase(start, end)
enum(anonymous)
@enum Miscellaneous Constants
@discussion
| kUSBDeviceIDShift | 7 | |
| kUSBMaxDevices | 128 | |
| kUSBMaxDevice | 127 | |
| kUSBDeviceIDMask | 127 | |
| kUSBTooManyDevicesAddress | 65534 | |
| kUSBPipeIDMask | 15 | |
| kUSBMaxPipes | 32 | In and Out pipes can have same pipe number. |
| kUSBInterfaceIDShift | 8 | |
| kUSBMaxInterfaces | 256 | |
| kUSBInterfaceIDMask | 255 | |
| kUSBEndPtShift | 7 | |
| kUSBDeviceMask | 127 | |
| kUSBNoPipeIdx | -1 | |
| kUSBUCRequestWithoutUSBNotificationMask | 1073741824 | In order to ameliorate the effects of PCI Pause on drivers that do not subscribe to the USB Notifications for it, we have decided to sleep threads that come into the UIM while we are in PCI Pause. We will wake those threads up after the root hub drivers are back ON. However, we needed a way to detect that an I/O was coming from user space. One way to solve that would be to power manage the user client and do the sleep/wake there, but that was a big undertaking. Another way is for the user client to somehow let the UIM know through some APIs. We decided on a quick way by using bits that are part of the API to communicate that the request is coming from user space. For device requests we use the wLenDone field, a 32-bit quantity, but whose maximum value is only 16 bits. Same goes for the streamID of bulk requests. Those bits are set by the user client and cleared by the controller after checking them. If they are set and PCI Pause is active, we will sleep that request. |
| kUSBEndpointTransferTypeUCMask | 128 | |
| kUSBStream0 | 0 | Constants for streams |
| kUSBMaxStream | 65533 | |
| kUSBPRimeStream | 65534 | |
| kUSBNoStream | 65535 | |
| kUSBAllStreams | 4294967295 | Obsolete, use kUSBStreamIDAllStreamsMask |
| kUSBStreamIDMask | 65535 | |
| kUSBStreamIDAllStreamsMask | -2147483648 |
enum(anonymous)
@enum bRequest Shifts and Masks
@discussion These are used to create the macro to encode the bRequest field of a Device Request
| kUSBRqDirnShift | 7 | |
| kUSBRqDirnMask | 1 | |
| kUSBRqTypeShift | 5 | |
| kUSBRqTypeMask | 3 | |
| kUSBRqRecipientMask | 31 |
macroUSBmakebmRequestType
@defined USBmakebmRequestType
@discussion Macro to encode the bmRequestType field of a Device Request. It is used when constructing an IOUSBDevRequest.
#define USBmakebmRequestType(direction, type, recipient) (((direction & kUSBRqDirnMask) << kUSBRqDirnShift) | ((type & kUSBRqTypeMask) << kUSBRqTypeShift) | (recipient & kUSBRqRecipientMask))
enum(anonymous)
@enum kUSBMaxIsocFrameReqCount
@discussion Maximum size in bytes allowed for one Isochronous frame
| kUSBMaxFSIsocEndpointReqCount | 1023 | max size (bytes) of any one Isoc frame for 1 FS endpoint |
| kUSBMaxHSIsocEndpointReqCount | 3072 | max size (bytes) of any one Isoc frame for 1 HS endpoint |
| kUSBMaxHSIsocFrameCount | 7168 | max size (bytes) of all Isoc transfers in a HS frame |
macroEncodeRequest
@defined EncodeRequest
@discussion Macro that encodes the bRequest and bRequestType fields of a IOUSBDevRequest into a single value. It is useful when one needs
to know what type of request the IOUSBDevRequest encodes and simplifies comparisons.
#define EncodeRequest(request, direction, type, recipient) (((UInt16)request << 8) + ((UInt16)recipient + ((UInt16)type << kUSBRqTypeShift) + ((UInt16)direction << kUSBRqDirnShift)))
enum(anonymous)
@enum Standard Device Requests
@discussion Encoding of the standard device requests.
<tt>
<pre><b>
bmRequestType bRequest wValue wIndex wLength Data</b>
00000000B CLEAR_FEATURE Feature Zero Zero None (device)
00000001B Feature Interface Zero None (Interface)
00000010B Feature Endpoint Zero None (Endpoint)
10000000B GET_CONFIGURATION Zero Zero One Configuration
10000000B GET_DESCRIPTOR Type LangID Length Descriptor
10000001B GET_INTERFACE Zero Interface One Alternate
10000000B GET_STATUS Zero Zero Two status (device)
10000001B Zero Interface Two status (Interface)
10000010B Zero Endpoint Two status (Endpoint)
00000000B SET_ADDRESS Address Zero Zero None
00000000B SET_CONFIGURATION Configuration Zero Zero None
00000000B SET_DESCRIPTOR Type LangID Length Descriptor
00000000B SET_FEATURE Feature Zero Zero None (device)
00000001B Feature Interface Zero None (Interface)
00000010B Feature Endpoint Zero None (Endpoint)
00000001B SET_INTERFACE Alternate Interface Zero None
10000010B SYNCH_FRAME Zero Endpoint Two Frame Number
</pre>
</tt>
| kClearDeviceFeature | 256 | |
| kClearInterfaceFeature | 257 | |
| kClearEndpointFeature | 258 | |
| kGetConfiguration | 2176 | |
| kGetDescriptor | 1664 | |
| kGetInterface | 2689 | |
| kGetDeviceStatus | 128 | |
| kGetInterfaceStatus | 129 | |
| kGetEndpointStatus | 130 | |
| kSetAddress | 1280 | |
| kSetConfiguration | 2304 | |
| kSetDescriptor | 1792 | |
| kSetDeviceFeature | 768 | |
| kSetInterfaceFeature | 769 | |
| kSetEndpointFeature | 770 | |
| kSetInterface | 2817 | |
| kSyncFrame | 3202 |
macrokCallInterfaceOpenWithGate
@defined kCallInterfaceOpenWithGate
@discussion If the USB Device has this property, drivers for any of its interfaces will have their handleOpen method called while holding the workloop gate.
#define kCallInterfaceOpenWithGate "kCallInterfaceOpenWithGate"
typedefUSBDeviceAddress
typedef UInt16 USBDeviceAddress
typedefUSBPhysicalAddress32
typedef uint32_t USBPhysicalAddress32
structIOUSBIsocFrame
@typedef IOUSBIsocFrame
@discussion Structure used to encode information about each isoc frame.
@param frStatus Returns status associated with the frame.
@param frReqCount Input specifiying how many bytes to read or write.
@param frActCount Actual # of bytes transferred.
| IOReturn | frStatus | |
| UInt16 | frReqCount | |
| UInt16 | frActCount |
typedefIOUSBIsocFrame
typedef struct IOUSBIsocFrame IOUSBIsocFrame;
structIOUSBLowLatencyIsocFrame
@typedef IOUSBLowLatencyIsocFrame
@discussion Structure used to encode information about each isoc frame that is processed
at hardware interrupt time (low latency).
@param frStatus Returns status associated with the frame.
@param frReqCount Input specifiying how many bytes to read or write.
@param frActCount Actual # of bytes transferred.
@param frTimeStamp Time stamp that indicates time when frame was procesed.
| IOReturn | frStatus | |
| UInt16 | frReqCount | |
| UInt16 | frActCount | |
| AbsoluteTime | frTimeStamp |
typedefIOUSBLowLatencyIsocFrame
typedef struct IOUSBLowLatencyIsocFrame IOUSBLowLatencyIsocFrame
typedefIOUSBCompletionAction
@typedef IOUSBCompletionAction
@discussion Function called when USB I/O completes.
@param target The target specified in the IOUSBCompletion struct.
@param parameter The parameter specified in the IOUSBCompletion struct.
@param status Completion status.
@param bufferSizeRemaining Bytes left to be transferred.
typedef void (*)(void *, void *, IOReturn, UInt32) IOUSBCompletionAction;
typedefIOUSBCompletionActionWithTimeStamp
@typedef IOUSBCompletionActionWithTimeStamp
@discussion Function called when USB I/O completes.
@param target The target specified in the IOUSBCompletion struct.
@param parameter The parameter specified in the IOUSBCompletion struct.
@param status Completion status.
@param bufferSizeRemaining Bytes left to be transferred.
@param timeStamp Time at which the transaction was processed.
typedef void (*)(void *, void *, IOReturn, UInt32, AbsoluteTime) IOUSBCompletionActionWithTimeStamp;
typedefIOUSBIsocCompletionAction
@typedef IOUSBIsocCompletionAction
@discussion Function called when Isochronous USB I/O completes.
@param target The target specified in the IOUSBIsocCompletionn struct.
@param parameter The parameter specified in the IOUSBIsocCompletion struct.
@param status Completion status.
@param pFrames Pointer to the frame list containing the status for each frame transferred.
typedef void (*)(void *, void *, IOReturn, IOUSBIsocFrame *) IOUSBIsocCompletionAction;
typedefIOUSBLowLatencyIsocCompletionAction
@typedef IOUSBLowLatencyIsocCompletionAction
@discussion Function called when Low Latency Isochronous USB I/O completes.
@param target The target specified in the IOUSBLowLatencyIsocCompletion struct.
@param parameter The parameter specified in the IOUSBLowLatencyIsocCompletion struct.
@param status Completion status.
@param pFrames Pointer to the low latency frame list containing the status for each frame transferred.
typedef void (*)(void *, void *, IOReturn, IOUSBLowLatencyIsocFrame *) IOUSBLowLatencyIsocCompletionAction;
structIOUSBCompletion
@typedef IOUSBCompletion
@discussion Struct specifying action to perform when a USB I/O completes.
@param target The target to pass to the action function.
@param action The function to call.
@param parameter The parameter to pass to the action function.
| void * | target | |
| IOUSBCompletionAction | action | |
| void * | parameter |
typedefIOUSBCompletion
typedef struct IOUSBCompletion IOUSBCompletion;
structIOUSBCompletionWithTimeStamp
@typedef IOUSBCompletionWithTimeStamp
@discussion Struct specifying action to perform when a USB I/O completes.
@param target The target to pass to the action function.
@param action The function to call.
@param parameter The parameter to pass to the action function.
| void * | target | |
| IOUSBCompletionActionWithTimeStamp | action | |
| void * | parameter |
typedefIOUSBCompletionWithTimeStamp
typedef struct IOUSBCompletionWithTimeStamp IOUSBCompletionWithTimeStamp;
structIOUSBIsocCompletion
@typedef IOUSBIsocCompletion
@discussion Struct specifying action to perform when an Isochronous USB I/O completes.
@param target The target to pass to the action function.
@param action The function to call.
@param parameter The parameter to pass to the action function.
| void * | target | |
| IOUSBIsocCompletionAction | action | |
| void * | parameter |
typedefIOUSBIsocCompletion
typedef struct IOUSBIsocCompletion IOUSBIsocCompletion;
structIOUSBLowLatencyIsocCompletion
@typedef IOUSBLowLatencyIsocCompletion
@discussion Struct specifying action to perform when an Low Latency Isochronous USB I/O completes.
@param target The target to pass to the action function.
@param action The function to call.
@param parameter The parameter to pass to the action function.
| void * | target | |
| IOUSBLowLatencyIsocCompletionAction | action | |
| void * | parameter |
typedefIOUSBLowLatencyIsocCompletion
typedef struct IOUSBLowLatencyIsocCompletion IOUSBLowLatencyIsocCompletion;
macroiokit_usb_err
#define iokit_usb_err(return) (IOReturn)(sys_iokit | sub_iokit_usb | return )
macrokIOUSBUnknownPipeErr
#define kIOUSBUnknownPipeErr iokit_usb_err(0x61)
0xe0004061 Pipe ref not recognized
macrokIOUSBTooManyPipesErr
#define kIOUSBTooManyPipesErr iokit_usb_err(0x60)
0xe0004060 Too many pipes
macrokIOUSBNotEnoughPipesErr
#define kIOUSBNotEnoughPipesErr iokit_usb_err(0x5e)
0xe000405e not enough pipes in interface
macrokIOUSBNotEnoughPowerErr
#define kIOUSBNotEnoughPowerErr iokit_usb_err(0x5d)
0xe000405d not enough power for selected configuration
macrokIOUSBEndpointNotFound
#define kIOUSBEndpointNotFound iokit_usb_err(0x57)
0xe0004057 Endpoint Not found
macrokIOUSBConfigNotFound
#define kIOUSBConfigNotFound iokit_usb_err(0x56)
0xe0004056 Configuration Not found
macrokIOUSBPortWasSuspended
#define kIOUSBPortWasSuspended iokit_usb_err(0x52)
0xe0004052 The transaction was returned because the port was suspended
macrokIOUSBPipeStalled
#define kIOUSBPipeStalled iokit_usb_err(0x4f)
0xe000404f Pipe has stalled, error needs to be cleared
macrokIOUSBInterfaceNotFound
#define kIOUSBInterfaceNotFound iokit_usb_err(0x4e)
0xe000404e Interface ref not recognized
macrokIOUSBLowLatencyBufferNotPreviouslyAllocated
#define kIOUSBLowLatencyBufferNotPreviouslyAllocated iokit_usb_err(0x4d)
0xe000404d Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the data buffer) first
macrokIOUSBLowLatencyFrameListNotPreviouslyAllocated
#define kIOUSBLowLatencyFrameListNotPreviouslyAllocated iokit_usb_err(0x4c)
0xe000404c Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the frame list) first
macrokIOUSBHighSpeedSplitError
#define kIOUSBHighSpeedSplitError iokit_usb_err(0x4b)
0xe000404b Error to hub on high speed bus trying to do split transaction
macrokIOUSBSyncRequestOnWLThread
#define kIOUSBSyncRequestOnWLThread iokit_usb_err(0x4a)
0xe000404a A synchronous USB request was made on the workloop thread (from a callback?). Only async requests are permitted in that case
macrokIOUSBDeviceNotHighSpeed
#define kIOUSBDeviceNotHighSpeed iokit_usb_err(0x49)
0xe0004049 Name is deprecated, see below
macrokIOUSBDeviceTransferredToCompanion
#define kIOUSBDeviceTransferredToCompanion iokit_usb_err(0x49)
0xe0004049 The device has been tranferred to another controller for enumeration
macrokIOUSBClearPipeStallNotRecursive
#define kIOUSBClearPipeStallNotRecursive iokit_usb_err(0x48)
0xe0004048 IOUSBPipe::ClearPipeStall should not be called recursively
macrokIOUSBDevicePortWasNotSuspended
#define kIOUSBDevicePortWasNotSuspended iokit_usb_err(0x47)
0xe0004047 Port was not suspended
macrokIOUSBEndpointCountExceeded
#define kIOUSBEndpointCountExceeded iokit_usb_err(0x46)
0xe0004046 The endpoint was not created because the controller cannot support more endpoints
macrokIOUSBDeviceCountExceeded
#define kIOUSBDeviceCountExceeded iokit_usb_err(0x45)
0xe0004045 The device cannot be enumerated because the controller cannot support more devices
macrokIOUSBStreamsNotSupported
#define kIOUSBStreamsNotSupported iokit_usb_err(0x44)
0xe0004044 The request cannot be completed because the XHCI controller does not support streams
macrokIOUSBInvalidSSEndpoint
#define kIOUSBInvalidSSEndpoint iokit_usb_err(0x43)
0xe0004043 An endpoint found in a SuperSpeed device is invalid (usually because there is no Endpoint Companion Descriptor)
macrokIOUSBTooManyTransactionsPending
#define kIOUSBTooManyTransactionsPending iokit_usb_err(0x42)
0xe0004042 The transaction cannot be submitted because it would exceed the allowed number of pending transactions
macrokIOUSBTransactionReturned
#define kIOUSBTransactionReturned iokit_usb_err(0x50)
0xe0004050 The transaction has been returned to the caller
macrokIOUSBTransactionTimeout
#define kIOUSBTransactionTimeout iokit_usb_err(0x51)
0xe0004051 Transaction timed out
macrokIOUSBLinkErr
@definedblock IOUSBFamily hardware error codes
@discussion These errors are returned by the OHCI controller. The # in parenthesis (xx) corresponds to the OHCI Completion Code.
For the following Completion codes, we return a generic IOKit error instead of a USB specific error.
<tt>
<pre>
Completion Code Error Returned Description
9 kIOReturnUnderrun (Data Underrun) EP returned less data than max packet size
8 kIOReturnOverrun (Data Overrun) Packet too large or more data than buffer
5 kIOReturnNotResponding Device Not responding
4 kIOUSBPipeStalled Endpoint returned a STALL PID
</pre>
</tt>
#define kIOUSBLinkErr iokit_usb_err(0x10)
0xe0004010
macrokIOUSBBufferUnderrunErr
#define kIOUSBBufferUnderrunErr iokit_usb_err(0x0d)
0xe000400d Buffer Underrun (Host hardware failure on data out, PCI busy?)
macrokIOUSBBufferOverrunErr
#define kIOUSBBufferOverrunErr iokit_usb_err(0x0c)
0xe000400c Buffer Overrun (Host hardware failure on data out, PCI busy?)
macrokIOUSBWrongPIDErr
#define kIOUSBWrongPIDErr iokit_usb_err(0x07)
0xe0004007 Pipe stall, Bad or wrong PID
macrokIOUSBPIDCheckErr
#define kIOUSBPIDCheckErr iokit_usb_err(0x06)
0xe0004006 Pipe stall, PID CRC error
macrokIOUSBDataToggleErr
#define kIOUSBDataToggleErr iokit_usb_err(0x03)
0xe0004003 Pipe stall, Bad data toggle
macroiokit_usb_msg
@defineblock IOUSBFamily message codes
@discussion Messages specific to the IOUSBFamily. Note that the iokit_usb_msg(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number.
#define iokit_usb_msg(message) (UInt32)(sys_iokit | sub_iokit_usb | message)
macrokIOUSBMessageHubResetPort
#define kIOUSBMessageHubResetPort iokit_usb_msg(0x01)
0xe0004001 Message sent to a hub to reset a particular port
macrokIOUSBMessageHubSuspendPort
#define kIOUSBMessageHubSuspendPort iokit_usb_msg(0x02)
0xe0004002 Message sent to a hub to suspend a particular port
macrokIOUSBMessageHubResumePort
#define kIOUSBMessageHubResumePort iokit_usb_msg(0x03)
0xe0004003 Message sent to a hub to resume a particular port
macrokIOUSBMessageHubIsDeviceConnected
#define kIOUSBMessageHubIsDeviceConnected iokit_usb_msg(0x04)
0xe0004004 Message sent to a hub to inquire whether a particular port has a device connected or not
macrokIOUSBMessageHubIsPortEnabled
#define kIOUSBMessageHubIsPortEnabled iokit_usb_msg(0x05)
0xe0004005 Message sent to a hub to inquire whether a particular port is enabled or not
macrokIOUSBMessageHubReEnumeratePort
#define kIOUSBMessageHubReEnumeratePort iokit_usb_msg(0x06)
0xe0004006 Message sent to a hub to reenumerate the device attached to a particular port
macrokIOUSBMessagePortHasBeenReset
#define kIOUSBMessagePortHasBeenReset iokit_usb_msg(0x0a)
0xe000400a Message sent to a device indicating that the port it is attached to has been reset
macrokIOUSBMessagePortHasBeenResumed
#define kIOUSBMessagePortHasBeenResumed iokit_usb_msg(0x0b)
0xe000400b Message sent to a device indicating that the port it is attached to has been resumed
macrokIOUSBMessageHubPortClearTT
#define kIOUSBMessageHubPortClearTT iokit_usb_msg(0x0c)
0xe000400c Message sent to a hub to clear the transaction translator
macrokIOUSBMessagePortHasBeenSuspended
#define kIOUSBMessagePortHasBeenSuspended iokit_usb_msg(0x0d)
0xe000400d Message sent to a device indicating that the port it is attached to has been suspended
macrokIOUSBMessageFromThirdParty
#define kIOUSBMessageFromThirdParty iokit_usb_msg(0x0e)
0xe000400e Message sent from a third party. Uses IOUSBThirdPartyParam to encode the sender's ID
macrokIOUSBMessagePortWasNotSuspended
#define kIOUSBMessagePortWasNotSuspended iokit_usb_msg(0x0f)
0xe000400f Message indicating that the hub driver received a resume request for a port that was not suspended
macrokIOUSBMessageExpressCardCantWake
#define kIOUSBMessageExpressCardCantWake iokit_usb_msg(0x10)
0xe0004010 Message from a driver to a bus that an express card will disconnect on sleep and thus shouldn't wake
macrokIOUSBMessageCompositeDriverReconfigured
#define kIOUSBMessageCompositeDriverReconfigured iokit_usb_msg(0x11)
0xe0004011 Message from the composite driver indicating that it has finished re-configuring the device after a reset
macrokIOUSBMessageHubSetPortRecoveryTime
#define kIOUSBMessageHubSetPortRecoveryTime iokit_usb_msg(0x12)
0xe0004012 Message sent to a hub to set the # of ms required when resuming a particular port
macrokIOUSBMessageOvercurrentCondition
#define kIOUSBMessageOvercurrentCondition iokit_usb_msg(0x13)
0xe0004013 Message sent to the clients of the device's hub parent, when a device causes an overcurrent condition. The message argument contains the locationID of the device
macrokIOUSBMessageNotEnoughPower
#define kIOUSBMessageNotEnoughPower iokit_usb_msg(0x14)
0xe0004014 Message sent to the clients of the device's hub parent, when a device causes an low power notice to be displayed. The message argument contains the locationID of the device
macrokIOUSBMessageController
#define kIOUSBMessageController iokit_usb_msg(0x15)
0xe0004015 Generic message sent from controller user client to controllers
macrokIOUSBMessageRootHubWakeEvent
#define kIOUSBMessageRootHubWakeEvent iokit_usb_msg(0x16)
0xe0004016 Message from the HC Wakeup code indicating that a Root Hub port has a wake event
macrokIOUSBMessageReleaseExtraCurrent
#define kIOUSBMessageReleaseExtraCurrent iokit_usb_msg(0x17)
0xe0004017 Message to ask any clients using extra current to release it if possible
macrokIOUSBMessageReallocateExtraCurrent
#define kIOUSBMessageReallocateExtraCurrent iokit_usb_msg(0x18)
0xe0004018 Message to ask any clients using extra current to attempt to allocate it some more
macrokIOUSBMessageEndpointCountExceeded
#define kIOUSBMessageEndpointCountExceeded iokit_usb_msg(0x19)
0xe0004019 Message sent to a device when endpoints cannot be created because the USB controller ran out of resources
macrokIOUSBMessageDeviceCountExceeded
#define kIOUSBMessageDeviceCountExceeded iokit_usb_msg(0x1a)
0xe000401a Message sent by a hub when a device cannot be enumerated because the USB controller ran out of resources
macrokIOUSBMessageHubPortDeviceDisconnected
#define kIOUSBMessageHubPortDeviceDisconnected iokit_usb_msg(0x1b)
0xe000401b Message sent by a built-in hub when a device was disconnected
macrokIOUSBMessageUnsupportedConfiguration
#define kIOUSBMessageUnsupportedConfiguration iokit_usb_msg(0x1c)
0xe000401c Message sent to the clients of the device when a device is not supported in the current configuration. The message argument contains the locationID of the device
macrokIOUSBMessageHubCountExceeded
#define kIOUSBMessageHubCountExceeded iokit_usb_msg(0x1d)
0xe000401d Message sent when a 6th hub was plugged in and was not enumerated, as the USB spec only support 5 hubs in a chain
macrokIOUSBMessageTDMLowBattery
#define kIOUSBMessageTDMLowBattery iokit_usb_msg(0x1e)
0xe000401e Message sent when when an attached TDM system battery is running low.
macrokIOUSBMessageLegacySuspendDevice
#define kIOUSBMessageLegacySuspendDevice iokit_usb_msg(0x1f)
0xe000401f Message sent to legacy interfaces when SuspedDevice() is called .
macrokIOUSBMessageLegacyResetDevice
#define kIOUSBMessageLegacyResetDevice iokit_usb_msg(0x20)
0xe0004020 Message sent to legacy interfaces when ResetDevice() is called .
macrokIOUSBMessageLegacyReEnumerateDevice
#define kIOUSBMessageLegacyReEnumerateDevice iokit_usb_msg(0x21)
0xe0004021 Message sent to legacy interfaces when ReEnumerateDevice() is called .
macrokIOUSBMessageRenegotiateCurrent
#define kIOUSBMessageRenegotiateCurrent kUSBHostMessageRenegotiateCurrent
macrokIOUSBMessageConfigurationSet
#define kIOUSBMessageConfigurationSet iokit_usb_msg(0x22)
0xe0004022 Message sent upon a SetConfiguration call
typedefIOUSBMouseData
typedef struct IOUSBMouseData IOUSBMouseData
typedefIOUSBMouseDataPtr
typedef IOUSBMouseData* IOUSBMouseDataPtr
typedefIOUSBKeyboardData
typedef struct IOUSBKeyboardData IOUSBKeyboardData
typedefIOUSBKeyboardDataPtr
typedef IOUSBKeyboardData* IOUSBKeyboardDataPtr
typedefIOUSBHIDData
typedef union IOUSBHIDData IOUSBHIDData
typedefIOUSBHIDDataPtr
typedef IOUSBHIDData* IOUSBHIDDataPtr
typedefIOUSBDeviceDescriptorPtr
typedef IOUSBDeviceDescriptor* IOUSBDeviceDescriptorPtr
typedefIOUSBDescriptorHeaderPtr
typedef IOUSBDescriptorHeader* IOUSBDescriptorHeaderPtr
typedefIOUSBBOSDescriptorPtr
typedef IOUSBBOSDescriptor* IOUSBBOSDescriptorPtr
typedefIOUSBDeviceCapabilityDescriptorHeaderPtr
typedef IOUSBDeviceCapabilityDescriptorHeader* IOUSBDeviceCapabilityDescriptorHeaderPtr
typedefIOUSBDeviceCapabilityUSB2ExtensionPtr
typedef IOUSBDeviceCapabilityUSB2Extension* IOUSBDeviceCapabilityUSB2ExtensionPtr
typedefIOUSBDeviceCapabilitySuperSpeedUSBPtr
typedef IOUSBDeviceCapabilitySuperSpeedUSB* IOUSBDeviceCapabilitySuperSpeedUSBPtr
typedefIOUSBDeviceCapabilitySuperSpeedPlusUSBPtr
typedef IOUSBDeviceCapabilitySuperSpeedPlusUSB* IOUSBDeviceCapabilitySuperSpeedPlusUSBPtr
typedefIOUSBDeviceCapabilityContainerIDPtr
typedef IOUSBDeviceCapabilityContainerID* IOUSBDeviceCapabilityContainerIDPtr
typedefIOUSBPlatformCapabilityDescriptorPtr
typedef IOUSBPlatformCapabilityDescriptor* IOUSBPlatformCapabilityDescriptorPtr
typedefIOUSBDeviceCapabilityBillboardAltConfigPtr
typedef IOUSBDeviceCapabilityBillboardAltConfig* IOUSBDeviceCapabilityBillboardAltConfigPtr
typedefIOUSBDeviceCapabilityBillboardPtr
typedef IOUSBDeviceCapabilityBillboard* IOUSBDeviceCapabilityBillboardPtr
typedefIOUSBDeviceCapabilityBillboardAltModePtr
typedef IOUSBDeviceCapabilityBillboardAltMode* IOUSBDeviceCapabilityBillboardAltModePtr
typedefIOUSBConfigurationDescriptorPtr
typedef IOUSBConfigurationDescriptor* IOUSBConfigurationDescriptorPtr
typedefIOUSBConfigurationDescHeaderPtr
typedef IOUSBConfigurationDescHeader* IOUSBConfigurationDescHeaderPtr
typedefIOUSBInterfaceDescriptorPtr
typedef IOUSBInterfaceDescriptor* IOUSBInterfaceDescriptorPtr
typedefIOUSBEndpointDescriptorPtr
typedef IOUSBEndpointDescriptor* IOUSBEndpointDescriptorPtr
typedefIOUSBStringDescriptorPtr
typedef IOUSBStringDescriptor* IOUSBStringDescriptorPtr
typedefIOUSBSuperSpeedEndpointCompanionDescriptorPtr
typedef IOUSBSuperSpeedEndpointCompanionDescriptor* IOUSBSuperSpeedEndpointCompanionDescriptorPtr
typedefIOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptorPtr
typedef IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptor* IOUSBSuperSpeedPlusIsochronousEndpointCompanionDescriptorPtr
typedefUASPipeDescriptorPtr
typedef UASPipeDescriptor* UASPipeDescriptorPtr
typedefIOUSBHIDDescriptorPtr
typedef IOUSBHIDDescriptor* IOUSBHIDDescriptorPtr
typedefIOUSBHIDReportDescPtr
typedef IOUSBHIDReportDesc* IOUSBHIDReportDescPtr
typedefIOUSBDeviceQualifierDescriptorPtr
typedef IOUSBDeviceQualifierDescriptor* IOUSBDeviceQualifierDescriptorPtr
typedefIOUSBDFUDescriptorPtr
typedef IOUSBDFUDescriptor* IOUSBDFUDescriptorPtr
typedefIOUSBInterfaceAssociationDescriptorPtr
typedef IOUSBInterfaceAssociationDescriptor* IOUSBInterfaceAssociationDescriptorPtr
enum(anonymous)
| kIOUSBDeviceCapabilityDescriptorType | 16 | |
| kIOUSBDeviceCapabilityDescriptorLengthMin | 3 |
enum(anonymous)
| kUSB_EPDesc_bmAttributes_TranType_Mask | 3 | |
| kUSB_EPDesc_bmAttributes_TranType_Shift | 0 | |
| kUSB_EPDesc_bmAttributes_SyncType_Mask | 12 | |
| kUSB_EPDesc_bmAttributes_SyncType_Shift | 2 | |
| kUSB_EPDesc_bmAttributes_UsageType_Mask | 48 | |
| kUSB_EPDesc_bmAttributes_UsageType_Shift | 4 | |
| kUSB_EPDesc_wMaxPacketSize_MPS_Mask | 2047 | |
| kUSB_EPDesc_wMaxPacketSize_MPS_Shift | 0 | |
| kUSB_EPDesc_MaxMPS | 1024 | this is the maximum no matter what |
| kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Mask | 6144 | |
| kUSB_HSFSEPDesc_wMaxPacketSize_Mult_Shift | 11 |
enum(anonymous)
| kUSB_SSCompDesc_Bulk_MaxStreams_Mask | 31 | |
| kUSB_SSCompDesc_Bulk_MaxStreams_Shift | 0 | |
| kUSB_SSCompDesc_Isoc_Mult_Mask | 3 | |
| kUSB_SSCompDesc_Isoc_Mult_Shift | 0 |
enum(anonymous)
these following 2 lines are deprecated and should not be used.
| addPacketShift | 11 | Bits for additional packets in maxPacketField. (Table 9-13) |
macromungeMaxPacketSize
#define mungeMaxPacketSize(w) ((w > 1024) ? (((w >> (addPacketShift)) + 1) * (w & ((1 << addPacketShift) - 1))) : w)
structIOUSBEndpointProperties
@typedef IOUSBEndpointProperties
@discussion Structure used with the IOUSBLib GetEndpointPropertiesV3 and GetPipePropertiesV3 API. Most of the fields are taken directly from corresponding Standard Endpoint Descriptor and SuperSpeed Endpoint Companion Descriptor. wBytesPerInterval will be synthesized for High Speed High Bandwidth Isochronous endpoints.
@field bVersion Version of the structure. Currently kUSBEndpointPropertiesVersion3. Need to set this when using this structure
@field bAlternateSetting Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3
@field bDirection Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3. One of kUSBIn or kUSBOut.
@field bEndpointNumber Used as an input for GetEndpointPropertiesV3. Used as an output for GetPipePropertiesV3
@field bTransferType One of kUSBControl, kUSBBulk, kUSBIsoc, or kUSBInterrupt
@field bUsageType For interrupt and isoc endpoints, the usage type. For Bulk endpoints of the UAS Mass Storage Protocol, the pipe ID.
@field bSyncType For isoc endpoints only
@field bInterval The bInterval field from the Standard Endpoint descriptor.
@field wMaxPacketSize The meaning of this value depends on whether this is called with GetPipePropertiesV3 or GetEndpointPropertiesV3. See the documentation of those calls for more info.
@field bMaxBurst For SuperSpeed endpoints, maximum number of packets the endpoint can send or receive as part of a burst
@field bMaxStreams For SuperSpeed bulk endpoints, maximum number of streams this endpoint supports.
@field bMult For SuperSpeed isoc endpoints, this is the mult value from the SuperSpeed Endpoint Companion Descriptor. For High Speed isoc and interrupt endpoints, this is bits 11 and 12 of the Standard Endpoint Descriptor, which represents a similar value.
@field wBytesPerInterval For SuperSpeed interrupt and isoc endpoints, this is the wBytesPerInterval from the SuperSpeed Endpoint Companion Descriptor. For High Speed High Bandwidth isoc endpoints, this will be equal to wMaxPacketSize * (bMult+1).
| UInt8 | bVersion | |
| UInt8 | bAlternateSetting | |
| UInt8 | bDirection | |
| UInt8 | bEndpointNumber | |
| UInt8 | bTransferType | |
| UInt8 | bUsageType | |
| UInt8 | bSyncType | |
| UInt8 | bInterval | |
| UInt16 | wMaxPacketSize | |
| UInt8 | bMaxBurst | |
| UInt8 | bMaxStreams | |
| UInt8 | bMult | |
| UInt16 | wBytesPerInterval |
typedefIOUSBEndpointProperties
typedef struct IOUSBEndpointProperties IOUSBEndpointProperties
typedefIOUSBEndpointPropertiesPtr
typedef IOUSBEndpointProperties* IOUSBEndpointPropertiesPtr
enum(anonymous)
@enum USBGetEndpointVersion
@discussion Version of the IOUSBEndpointProperties structure.
@constant kUSBEndpointPropertiesVersion3 Version that has support for USB3 SuperSpeed Endpoint Companion fields.
| kUSBEndpointPropertiesVersion3 | 3 |
typedefUSBStatus
@typedef USBStatus
@discussion Type used to get a DeviceStatus as a single quantity.
typedef UInt16 USBStatus
typedefUSBStatusPtr
typedef USBStatus* USBStatusPtr
enum(anonymous)
These constants are obsolete
| kIOUSBAnyClass | 65535 | |
| kIOUSBAnySubClass | 65535 | |
| kIOUSBAnyProtocol | 65535 | |
| kIOUSBAnyVendor | 65535 | |
| kIOUSBAnyProduct | 65535 |
structIOUSBMatch
This structure are obsolete
| UInt16 | usbClass | |
| UInt16 | usbSubClass | |
| UInt16 | usbProtocol | |
| UInt16 | usbVendor | |
| UInt16 | usbProduct |
typedefIOUSBMatch
typedef struct IOUSBMatch IOUSBMatch;
structIOUSBFindEndpointRequest
@typedef IOUSBFindEndpointRequest
@discussion Struct used to find endpoints of an interface
type and direction are used to match endpoints,
type, direction, maxPacketSize and interval are updated
with the properties of the found endpoint.
@field type Type of endpoint: kUSBControl, kUSBIsoc, kUSBBulk, kUSBInterrupt, kUSBAnyType. If kUSBAnyType is specified, this field is treated as a don't care.
@field direction Direction of endpoint: kUSBOut, kUSBIn, kUSBAnyDirn. If kUSBAnyDirn is specified, this field is treated as a don't care.
@field maxPacketSize maximum packet size of endpoint.
@field interval Polling interval in mSec for endpoint.
| UInt8 | type | |
| UInt8 | direction | |
| UInt16 | maxPacketSize | |
| UInt8 | interval |
typedefIOUSBFindEndpointRequest
typedef struct IOUSBFindEndpointRequest IOUSBFindEndpointRequest;
structIOUSBDevRequest
@struct IOUSBDevRequest
@discussion Parameter block for control requests, using a simple pointer
for the data to be transferred.
@field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor
@field bRequest Request code
@field wValue 16 bit parameter for request, host endianess
@field wIndex 16 bit parameter for request, host endianess
@field wLength Length of data part of request, 16 bits, host endianess
@field pData Pointer to data for request - data returned in bus endianess
@field wLenDone Set by standard completion routine to number of data bytes
actually transferred
| UInt8 | bmRequestType | |
| UInt8 | bRequest | |
| UInt16 | wValue | |
| UInt16 | wIndex | |
| UInt16 | wLength | |
| void * | pData | |
| UInt32 | wLenDone |
typedefIOUSBDevRequest
typedef struct IOUSBDevRequest IOUSBDevRequest;
typedefIOUSBDeviceRequestPtr
typedef IOUSBDevRequest* IOUSBDeviceRequestPtr
structIOUSBDevRequestTO
@struct IOUSBDevRequestTO
@discussion Parameter block for control requests with timeouts, using a simple pointer
for the data to be transferred. Same as a IOUSBDevRequest except for the two extra timeout fields.
@field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor
@field bRequest Request code
@field wValue 16 bit parameter for request, host endianess
@field wIndex 16 bit parameter for request, host endianess
@field wLength Length of data part of request, 16 bits, host endianess
@field pData Pointer to data for request - data returned in bus endianess
@field wLenDone Set by standard completion routine to number of data bytes
actually transferred
@field noDataTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if no data is transferred in this amount of time, the request will be aborted and returned.
@field completionTimeout Specifies a time value in milliseconds. Once the request is queued on the bus, if the entire request is not completed in this amount of time, the request will be aborted and returned
| UInt8 | bmRequestType | |
| UInt8 | bRequest | |
| UInt16 | wValue | |
| UInt16 | wIndex | |
| UInt16 | wLength | |
| void * | pData | |
| UInt32 | wLenDone | |
| UInt32 | noDataTimeout | |
| UInt32 | completionTimeout |
typedefIOUSBDevRequestTO
typedef struct IOUSBDevRequestTO IOUSBDevRequestTO;
enum(anonymous)
@enum Default timeout values
@discussion default values used for data and completion timeouts.
| kUSBDefaultControlNoDataTimeoutMS | 5000 | |
| kUSBDefaultControlCompletionTimeoutMS | 0 |
structIOUSBBulkPipeReq
Internal structure to pass parameters between IOUSBLib and UserClient
| UInt32 | pipeRef | |
| void * | buf | |
| UInt32 | size | |
| UInt32 | noDataTimeout | |
| UInt32 | completionTimeout |
typedefIOUSBBulkPipeReq
typedef struct IOUSBBulkPipeReq IOUSBBulkPipeReq;
structIOUSBDevRequestDesc
@struct IOUSBDevRequestDesc
@discussion Parameter block for control requests, using a memory descriptor
for the data to be transferred. Only available in the kernel.
@field bmRequestType Request type: kUSBStandard, kUSBClass or kUSBVendor
@field bRequest Request code
@field wValue 16 bit parameter for request, host endianess
@field wIndex 16 bit parameter for request, host endianess
@field wLength Length of data part of request, 16 bits, host endianess
@field pData Pointer to memory descriptor for data for request - data returned in bus endianess
@field wLenDone Set by standard completion routine to number of data bytes
actually transferred
| UInt8 | bmRequestType | |
| UInt8 | bRequest | |
| UInt16 | wValue | |
| UInt16 | wIndex | |
| UInt16 | wLength | |
| IOMemoryDescriptor * | pData | |
| UInt32 | wLenDone |
typedefIOUSBDevRequestDesc
typedef struct IOUSBDevRequestDesc IOUSBDevRequestDesc;
enum(anonymous)
@enum IOUSBFamilyIOOptionBit
@discussion Options used exclusively by the USB Family when calling calling IOService APIs, such as open() and close().
@constant kIOUSBInterfaceOpenAlt Open the alternate interface specified when creating the interface.
@constant kUSBOptionBitOpenExclusivelyBit Used in open()'ing the IOUSBDevice or IOUSBInterface by the corresponding user client. Only 1 user client can have exclusive access to those objects
| kIOUSBInterfaceOpenAlt | 65536 | |
| kIOUSBInterfaceOpenAlternateInterfaceBit | 16 | |
| kUSBOptionBitOpenExclusivelyBit | 17 | |
| kIOUSBInterfaceOpenAlternateInterfaceMask | 65536 | |
| kUSBOptionBitOpenExclusivelyMask | 131072 |
structIOUSBDevReqOOL
Internal structure to pass parameters between IOUSBLib and UserClient
use a structure because there's a limit of 6 total arguments
to a user client method.
| UInt8 | bmRequestType | |
| UInt8 | bRequest | |
| UInt16 | wValue | |
| UInt16 | wIndex | |
| UInt16 | wLength | |
| void * | pData | data pointer |
| UInt32 | wLenDone | # bytes transferred |
| UInt8 | pipeRef |
typedefIOUSBDevReqOOL
typedef struct IOUSBDevReqOOL IOUSBDevReqOOL;
structIOUSBDevReqOOLTO
Internal structure to pass parameters between IOUSBLib and UserClient
| UInt8 | bmRequestType | |
| UInt8 | bRequest | |
| UInt16 | wValue | |
| UInt16 | wIndex | |
| UInt16 | wLength | |
| void * | pData | data pointer |
| UInt32 | wLenDone | # bytes transferred |
| UInt8 | pipeRef | |
| UInt32 | noDataTimeout | |
| UInt32 | completionTimeout |
typedefIOUSBDevReqOOLTO
typedef struct IOUSBDevReqOOLTO IOUSBDevReqOOLTO;
structIOUSBIsocStruct
Internal structure to pass parameters between IOUSBLib and UserClient
Structure to request isochronous transfer
| UInt32 | fPipe | |
| void * | fBuffer | |
| UInt32 | fBufSize | |
| UInt64 | fStartFrame | |
| UInt32 | fNumFrames | |
| IOUSBIsocFrame * | fFrameCounts |
typedefIOUSBIsocStruct
typedef struct IOUSBIsocStruct IOUSBIsocStruct;
structIOUSBLowLatencyIsocStruct
Internal structure to pass parameters between IOUSBLib and UserClient
Structure to request low latency isochronous transfer
| UInt32 | fPipe | |
| UInt32 | fBufSize | |
| UInt64 | fStartFrame | |
| UInt32 | fNumFrames | |
| UInt32 | fUpdateFrequency | |
| UInt32 | fDataBufferCookie | |
| UInt32 | fDataBufferOffset | |
| UInt32 | fFrameListBufferCookie | |
| UInt32 | fFrameListBufferOffset |
typedefIOUSBLowLatencyIsocStruct
typedef struct IOUSBLowLatencyIsocStruct IOUSBLowLatencyIsocStruct
structIOUSBGetFrameStruct
@struct IOUSBGetFrameStruct
@discussion Structure used from user space to return the frame number and a timestamp on when the frame register was read.
@field frame frame number
@field timeStamp AbsoluteTime when the frame was updated
| UInt64 | frame | |
| AbsoluteTime | timeStamp |
typedefIOUSBGetFrameStruct
typedef struct IOUSBGetFrameStruct IOUSBGetFrameStruct;
structIOUSBFindInterfaceRequest
@struct IOUSBFindInterfaceRequest
@discussion Structure used with FindNextInterface.
| UInt16 | bInterfaceClass | requested class |
| UInt16 | bInterfaceSubClass | requested subclass |
| UInt16 | bInterfaceProtocol | requested protocol |
| UInt16 | bAlternateSetting | requested alt setting |
typedefIOUSBFindInterfaceRequest
typedef struct IOUSBFindInterfaceRequest IOUSBFindInterfaceRequest;
enum(anonymous)
@enum kIOUSBFindInterfaceDontCare
@discussion Constant that can be used for the fields of IOUSBFindInterfaceRequest to specify that they should not be matched.
| kIOUSBFindInterfaceDontCare | 65535 |
enum(anonymous)
@enum kIOUSBVendorIDApple
@discussion USB Vendor ID for Apple, Inc.
| kIOUSBVendorIDAppleComputer | 1452 | |
| kIOUSBVendorIDApple | 1452 |
enum(anonymous)
@enum USBDeviceSpeed
@discussion Returns the speed of a particular USB device.
@constant kUSBDeviceSpeedLow The device is a low speed device.
@constant kUSBDeviceSpeedFull The device is a full speed device.
@constant kUSBDeviceSpeedHigh The device is a high speed device.
@constant kUSBDeviceSpeedSuper The device is a SuperSpeed (Gen 1) 5Gbps device
@constant kUSBDeviceSpeedSuperPlus The device is a SuperSpeed Plus (Gen 2) 10Gbps device
@constant kUSBDeviceSpeedSuperPlusBy2 The device is a SuperSpeed Plus (Gen 2 X 2) 20Gbps device
| kUSBDeviceSpeedLow | 0 | |
| kUSBDeviceSpeedFull | 1 | |
| kUSBDeviceSpeedHigh | 2 | |
| kUSBDeviceSpeedSuper | 3 | |
| kUSBDeviceSpeedSuperPlus | 4 | |
| kUSBDeviceSpeedSuperPlusBy2 | 5 |
enum(anonymous)
@enum MicrosecondsInFrame
@discussion Returns the number of microseconds in a USB frame.
@constant kUSBFullSpeedMicrosecondsInFrame The device is attached to a bus running at full speed (1 ms / frame).
@constant kUSBHighSpeedMicrosecondsInFrame The device is attached to a bus running at high speed (125 microseconds / frame).
| kUSBFullSpeedMicrosecondsInFrame | 1000 | |
| kUSBHighSpeedMicrosecondsInFrame | 125 |
enum(anonymous)
During low latency transfers, the stack will set the frStatus for each frame to this value. A client can check that to see if the transfer has completed. We set the frStatus to a
valid return code when the transfer completes.
| kUSBLowLatencyIsochTransferKey | 1819044212 | Set frStatus field of first frame in isoch transfer to designate as low latency |
typedefLowLatencyUserBufferInfo
This structure is DEPRECATED. See the LowLatencyUserBufferInfoV2
typedef struct LowLatencyUserBufferInfo LowLatencyUserBufferInfo
structLowLatencyUserBufferInfo
| UInt32 | cookie | |
| void * | bufferAddress | |
| IOByteCount | bufferSize | |
| UInt32 | bufferType | |
| Boolean | isPrepared | |
| LowLatencyUserBufferInfo * | nextBuffer |
typedefLowLatencyUserBufferInfoV2
typedef struct LowLatencyUserBufferInfoV2 LowLatencyUserBufferInfoV2
structLowLatencyUserBufferInfoV2
| UInt32 | cookie | |
| void * | bufferAddress | |
| IOByteCount | bufferSize | |
| UInt32 | bufferType | |
| Boolean | isPrepared | |
| void * | mappedUHCIAddress | |
| LowLatencyUserBufferInfoV2 * | nextBuffer |
typedefLowLatencyUserBufferInfoV3
This structure is used to pass information for the low latency calls between user space and the kernel.
typedef struct LowLatencyUserBufferInfoV3 LowLatencyUserBufferInfoV3
structLowLatencyUserBufferInfoV3
| uint64_t | cookie | |
| mach_vm_address_t | bufferAddress | |
| mach_vm_size_t | bufferSize | |
| uint64_t | bufferType | |
| uint64_t | isPrepared | |
| mach_vm_address_t | mappedUHCIAddress | |
| LowLatencyUserBufferInfoV3 * | nextBuffer |
enumUSBLowLatencyBufferType
@enum USBLowLatencyBufferType
@discussion Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer().
@constant kUSBLowLatencyWriteBuffer The buffer will be used to write data out to a device.
@constant kUSBLowLatencyReadBuffer The buffer will be used to read data from a device.
@constant kUSBLowLatencyFrameListBuffer The buffer will be used for a low latency isoch frame list.
| kUSBLowLatencyWriteBuffer | 0 | |
| kUSBLowLatencyReadBuffer | 1 | |
| kUSBLowLatencyFrameListBuffer | 2 |
typedefUSBLowLatencyBufferType
typedef enum USBLowLatencyBufferType USBLowLatencyBufferType;
enum(anonymous)
USB User Notification Types
| kUSBNoUserNotificationType | 0 | |
| kUSBNotEnoughPowerNotificationType | 1 | |
| kUSBIndividualOverCurrentNotificationType | 2 | |
| kUSBGangOverCurrentNotificationType | 3 | |
| kUSBiOSDeviceNotEnoughPowerNotificationType | 4 | |
| kUSBNotEnoughPowerNoACNotificationType | 5 | |
| kUSBDeviceCountExceededNotificationType | 6 | |
| kUSBEndpointCountExceededNotificationType | 7 | |
| kUSBUnsupportedNotificationType | 8 | |
| kUSBHubCountExceededNotificationType | 9 | |
| kUSBTDMLowBatteryType | 10 | |
| kUSBCTBNotEnoughPowerNotificationType | 11 | |
| kUSBCTBUnsupportedNotificationType | 12 | |
| kUSBCUnsupportedTBPortNotificationType | 13 | |
| kUSBCUnsupportedTBCableNotificationType | 14 |
macrokUSBDevicePropertyBusPowerAvailable
@defined Property Definitions
@discussion Useful property names in USB land.
#define kUSBDevicePropertyBusPowerAvailable "Bus Power Available"
macrokUSBDevicePropertyLocationID
#define kUSBDevicePropertyLocationID kUSBHostPropertyLocationID
macrokUSBProductIDMask
#define kUSBProductIDMask kUSBHostMatchingPropertyProductIDMask
macrokUSBProductIdsArrayName
#define kUSBProductIdsArrayName kUSBHostMatchingPropertyProductIDArray
macrokUSBSuspendPort
#define kUSBSuspendPort "kSuspendPort"
macrokUSBExpressCardCantWake
#define kUSBExpressCardCantWake "ExpressCardCantWake"
macrokUSBDeviceResumeRecoveryTime
#define kUSBDeviceResumeRecoveryTime kUSBHostDevicePropertyResumeRecoveryTime
macrokUSBOutOfSpecMPSOK
#define kUSBOutOfSpecMPSOK "Out of spec MPS OK"
macrokOverrideIfAtLocationID
#define kOverrideIfAtLocationID "OverrideIfAtLocationID"
macrokUSBDeviceCurrentConfiguration
#define kUSBDeviceCurrentConfiguration kUSBHostDevicePropertyCurrentConfiguration
macrokUSBDeviceRemoteWakeOverride
#define kUSBDeviceRemoteWakeOverride kUSBHostDevicePropertyRemoteWakeOverride
macrokUSBDeviceConfigurationCurrentOverride
#define kUSBDeviceConfigurationCurrentOverride kUSBHostDevicePropertyConfigurationCurrentOverride
macrokUSBDeviceResetDurationOverride
#define kUSBDeviceResetDurationOverride kUSBHostDevicePropertyResetDurationOverride
macrokUSBDeviceFailedRequestedPower
#define kUSBDeviceFailedRequestedPower kUSBHostDevicePropertyFailedRequestedPower
macrokUSBPropertyRemovable
#define kUSBPropertyRemovable kUSBHostPortPropertyRemovable
macrokUSBPropertyTestMode
#define kUSBPropertyTestMode kUSBHostPortPropertyTestMode
macrokUSBPropertyDebugLevel
#define kUSBPropertyDebugLevel kUSBHostPropertyDebugOptions
macrokUSBHubPropertyPowerSupply
#define kUSBHubPropertyPowerSupply kUSBHostHubPropertyPowerSupply
macrokUSBControllerSleepSupported
#define kUSBControllerSleepSupported kUSBHostControllerPropertySleepSupported
macrokUSBPortPropertyBusCurrentAllocation
#define kUSBPortPropertyBusCurrentAllocation kUSBHostPortPropertyBusCurrentAllocation
macrokUSBPreferredInterfacePriority
#define kUSBPreferredInterfacePriority "priority"
macrokOverrideAllowLowPower
#define kOverrideAllowLowPower "kOverrideAllowLowPower"
macrokUSBUserClientEntitlementRequired
#define kUSBUserClientEntitlementRequired "UsbUserClientEntitlementRequired"
macrokUSBDevicePropertySpeed
#define kUSBDevicePropertySpeed "Device Speed"
macrokUSBDevicePropertyAddress
#define kUSBDevicePropertyAddress kUSBHostDevicePropertyAddress
macrokUSBPreferredConfiguration
#define kUSBPreferredConfiguration kUSBHostDevicePropertyPreferredConfiguration
macrokUSBControllerNeedsContiguousMemoryForIsoch
#define kUSBControllerNeedsContiguousMemoryForIsoch kUSBHostControllerPropertyIsochronousRequiresContiguous
macrokUSBHubDontAllowLowPower
#define kUSBHubDontAllowLowPower kUSBHostHubPropertyIdlePolicy
macrokConfigurationDescriptorOverride
#define kConfigurationDescriptorOverride kUSBHostDevicePropertyConfigurationDescriptorOverride
enumUSBReEnumerateOptions
@enum USBReEnumerateOptions
@discussion Options used when calling ReEnumerateDevice.
@constant kUSBAddExtraResetTimeBit Setting this bit will cause the Hub driver to wait 100ms before addressing the device after the reset following the re-enumeration.
@constant kUSBReEnumerateCaptureDeviceBit Setting this bit will terminate any drivers attached to an IOUSBInterface for the device and to the IOUSBDevice itself. It will not terminate
any drivers attached to a Mass Storage Class IOUSBInterface. A client needs to have the appropriate permissions in order to specify this bit. See IOUSBLib.h
@constant kUSBReEnumerateReleaseDeviceBit Setting this bit will return return any device that was captured back to the OS. The driver for the IOUSBDevice will be loaded. A client needs to have the appropriate permissions in order to specify this bit. See IOUSBLib.h
| kUSBAddExtraResetTimeBit | 31 | |
| kUSBReEnumerateCaptureDeviceBit | 30 | |
| kUSBReEnumerateReleaseDeviceBit | 29 | |
| kUSBAddExtraResetTimeMask | -2147483648 | |
| kUSBReEnumerateCaptureDeviceMask | 1073741824 | |
| kUSBReEnumerateReleaseDeviceMask | 536870912 |
typedefUSBReEnumerateOptions
typedef enum USBReEnumerateOptions USBReEnumerateOptions;
enumUSBDeviceInformationBits
@enum USBDeviceInformationBits
@discussion GetUSBDeviceInformation will return a unit32_t value with bits set indicating that a particular state is present in the USB device. These bits are described here
@constant kUSBInformationDeviceIsCaptiveBit The USB device is directly attached to its hub and cannot be removed.
@constant kUSBInformationDeviceIsAttachedToRootHubBit The USB device is directly attached to the root hub
@constant kUSBInformationDeviceIsInternalBit The USB device is internal to the enclosure (all the hubs it attaches to are captive)
@constant kUSBInformationDeviceIsConnectedBit The USB device is connected to its hub
@constant kUSBInformationDeviceIsEnabledBit The hub port to which the USB device is attached is enabled
@constant kUSBInformationDeviceIsSuspendedBit The hub port to which the USB device is attached is suspended
@constant kUSBInformationDeviceIsInResetBit The hub port to which the USB device is attached is being reset
@constant kUSBInformationDeviceOvercurrentBit The USB device generated an overcurrent
@constant kUSBInformationDevicePortIsInTestModeBit The hub port to which the USB device is attached is in test mode
@constant kUSBInformationDeviceIsRootHub The device is the root hub simulation
@constant kUSBInformationRootHubisBuiltIn If this is a root hub simulation and it's built into the enclosure, this bit is set. If it's on an expansion card, it will be cleared
@constant kUSBInformationDeviceIsRemote This device is "attached" to the controller through a remote connection
@constant kUSBInformationDeviceIsAttachedToEnclosure The hub port to which the USB device is connected has a USB connector on the enclosure
@constant kUSBInformationDeviceIsOnThunderboltBit The USB device is downstream of a controller that is attached through Thunderbolt
| kUSBInformationDeviceIsCaptiveBit | 0 | |
| kUSBInformationDeviceIsAttachedToRootHubBit | 1 | |
| kUSBInformationDeviceIsInternalBit | 2 | |
| kUSBInformationDeviceIsConnectedBit | 3 | |
| kUSBInformationDeviceIsEnabledBit | 4 | |
| kUSBInformationDeviceIsSuspendedBit | 5 | |
| kUSBInformationDeviceIsInResetBit | 6 | |
| kUSBInformationDeviceOvercurrentBit | 7 | |
| kUSBInformationDevicePortIsInTestModeBit | 8 | |
| kUSBInformationDeviceIsRootHub | 9 | |
| kUSBInformationRootHubisBuiltIn | 10 | |
| kUSBInformationRootHubIsBuiltInBit | 10 | |
| kUSBInformationDeviceIsRemote | 11 | |
| kUSBInformationDeviceIsAttachedToEnclosure | 12 | |
| kUSBInformationDeviceIsOnThunderboltBit | 13 | |
| kUSBInformationDeviceIsCaptiveMask | 1 | |
| kUSBInformationDeviceIsAttachedToRootHubMask | 2 | |
| kUSBInformationDeviceIsInternalMask | 4 | |
| kUSBInformationDeviceIsConnectedMask | 8 | |
| kUSBInformationDeviceIsEnabledMask | 16 | |
| kUSBInformationDeviceIsSuspendedMask | 32 | |
| kUSBInformationDeviceIsInResetMask | 64 | |
| kUSBInformationDeviceOvercurrentMask | 128 | |
| kUSBInformationDevicePortIsInTestModeMask | 256 | |
| kUSBInformationDeviceIsRootHubMask | 512 | |
| kUSBInformationRootHubisBuiltInMask | 1024 | |
| kUSBInformationRootHubIsBuiltInMask | 1024 | |
| kUSBInformationDeviceIsRemoteMask | 2048 | |
| kUSBInformationDeviceIsAttachedToEnclosureMask | 4096 | |
| kUSBInformationDeviceIsOnThunderboltMask | 8192 |
typedefUSBDeviceInformationBits
typedef enum USBDeviceInformationBits USBDeviceInformationBits;
enumUSBPowerRequestTypes
@enum USBPowerRequestTypes
@discussion Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs.
@constant kUSBPowerDuringSleep The power is to be used during sleep.
@constant kUSBPowerDuringWake The power is to be used while the system is awake (i.e not sleeping)
@constant kUSBPowerRequestWakeRelease When used with ReturnExtraPower(), it will send a message to all devices to return any extra wake power if possible.
@constant kUSBPowerRequestSleepRelease When used with ReturnExtraPower(), it will send a message to all devices to return any sleep power if possible.
@constant kUSBPowerRequestWakeReallocate When used with ReturnExtraPower(), it will send a message to all devices indicating that they can ask for more wake power, as some device has released it.
@constant kUSBPowerRequestSleepReallocate When used with ReturnExtraPower(), it will send a message to all devices indicating that they can ask for more sleep power, as some device has released it.
@constant kUSBPowerDuringWakeRevocable The power is to be used while the system is awake (i.e not sleeping), but can be taken away (via the kUSBPowerRequestWakeRelease message). The system can then allocate that extra power to another device.
@constant kUSBPowerDuringWakeUSB3 This is used by the USB stack to allocate the 400mA extra for USB3, above the 500ma allocated by USB2
| kUSBPowerDuringSleep | 0 | |
| kUSBPowerDuringWake | 1 | |
| kUSBPowerRequestWakeRelease | 2 | |
| kUSBPowerRequestSleepRelease | 3 | |
| kUSBPowerRequestWakeReallocate | 4 | |
| kUSBPowerRequestSleepReallocate | 5 | |
| kUSBPowerDuringWakeRevocable | 6 | |
| kUSBPowerDuringWakeUSB3 | 7 |
typedefUSBPowerRequestTypes
typedef enum USBPowerRequestTypes USBPowerRequestTypes;
enum(anonymous)
these are not for a Public API, but are just the bits used below
| kUSBNotificationPreForcedSuspendBit | 0 | |
| kUSBNotificationPostForcedSuspendBit | 1 | |
| kUSBNotificationPreForcedResumeBit | 2 | |
| kUSBNotificationPostForcedResumeBit | 3 |
enumUSBNotificationTypes
@enum USBNotificationTypes
@discussion Used to register for USB notifications. These types may be OR'd together if more than one notification is desired. These notification are expected to be acknowledged before the process (e.g. system sleep or system wake) can be continued. See RegisterForNotification and AcknowledgeNotification in IOUSBDeviceInterface and IOUSBInterfaceInterface.
@constant kUSBNotificationPreForcedSuspend A notification is sent prior to a forced suspend (e.g. system sleep).
@constant kUSBNotificationPostForcedSuspend A notification is sent after a forced suspend has been completed (e.g. system sleep).
@constant kUSBNotificationPreForcedResume A notification is sent before a resume which happens after a forced suspend (e.g. system wake).
@constant kUSBNotificationPostForcedResume A notification is sent after a resume which happens after a forced suspend (e.g. system wake).
| kUSBNotificationPreForcedSuspend | 1 | |
| kUSBNotificationPostForcedSuspend | 2 | |
| kUSBNotificationPreForcedResume | 4 | |
| kUSBNotificationPostForcedResume | 8 |
typedefUSBNotificationTypes
typedef enum USBNotificationTypes USBNotificationTypes;
macrokAppleRevocableExtraCurrent
Apple specific properties
#define kAppleRevocableExtraCurrent "AAPL,revocable-extra-current"
macrokAppleExternalSuperSpeedPorts
#define kAppleExternalSuperSpeedPorts "AAPL,ExternalSSPorts"
macrokAppleUnconnectedSuperSpeedPorts
#define kAppleUnconnectedSuperSpeedPorts "AAPL,UnconnectedSSPorts"
macrokAppleAcpiRootHubDepth
#define kAppleAcpiRootHubDepth "AAPL,root-hub-depth"
macrokAppleStandardPortCurrentInSleep
#define kAppleStandardPortCurrentInSleep "AAPL,standard-port-current-in-sleep"
macrokAppleInternalUSBDevice
#define kAppleInternalUSBDevice "AAPL,device-internal"
macrokAppleExternalConnectorBitmap
#define kAppleExternalConnectorBitmap "AAPL,ExternalConnectorBitmap"
macrokUSBBusID
#define kUSBBusID "AAPL,bus-id"
macrokApplePowerSupply
#define kApplePowerSupply "AAPL,power-supply"
macrokAppleCurrentAvailable
Deprecated Names and/or values
#define kAppleCurrentAvailable "AAPL,current-available"
macrokAppleCurrentInSleep
#define kAppleCurrentInSleep "AAPL,current-in-sleep"
macrokApplePortCurrentInSleep
#define kApplePortCurrentInSleep "AAPL,port-current-in-sleep"
macrokOverrideAttachedToCPU
#define kOverrideAttachedToCPU "kOverrideAttachedToCPU"
enumkUSBConnectable
UPC definitions from ACPI Rev 4.0
| kUSBPortNotConnectable | 0 | Port is not connectable |
| kUSBPortConnectable | 1 | Port is connectable either user visible or invisible |
typedefkUSBConnectable
typedef enum kUSBConnectable kUSBConnectable;
enumkUSBHostConnectorType
| kUSBTypeAConnector | 0 | Type �A� connector |
| kUSBTypeMiniABConnector | 1 | Mini-AB connector |
| kUSBTypeExpressCard | 2 | ExpressCard |
| kUSB3TypeStdAConnector | 3 | USB 3 Standard-A connector |
| kUSB3TypeStdBConnector | 4 | USB 3 Standard-B connector |
| kUSB3TypeMicroBConnector | 5 | USB 3 Micro-B connector |
| kUSB3TypeMicroABConnector | 6 | USB 3 Micro-AB connector |
| kUSB3TypePowerBConnector | 7 | USB 3 Power-B connector |
| kUSBProprietaryConnector | 255 | Proprietary connector |
typedefkUSBHostConnectorType
typedef enum kUSBHostConnectorType kUSBHostConnectorType;
enum(anonymous)
Root hub definitions
| kUSBSpeed_Mask | 3 | |
| kUSBSpeed_Shift | 0 | |
| kUSBAddress_Mask | 65280 | |
| kUSBAddress_Shift | 8 |
enum(anonymous)
| kXHCISSRootHubAddress | 128 | |
| kXHCIUSB2RootHubAddress | 129 | |
| kSuperSpeedBusBitMask | 16777216 |
macroISROOTHUB
#define ISROOTHUB(a) ((a == kXHCISSRootHubAddress) || (a == kXHCIUSB2RootHubAddress))
macrokEHCIIsochMaxBusStall
values (in nanoseconds) which are sent to requireMaxBusStall as appropriate
#define kEHCIIsochMaxBusStall 25000
macrokXHCIIsochMaxBusStall
#define kXHCIIsochMaxBusStall 25000
macrokOHCIIsochMaxBusStall
#define kOHCIIsochMaxBusStall 25000
macrokUHCIIsochMaxBusStall
#define kUHCIIsochMaxBusStall 10000
macrokMaxBusStall10uS
#define kMaxBusStall10uS 10000
macrokMaxBusStall25uS
#define kMaxBusStall25uS 25000