Apple Manual
Apple Manual
Contents
IOFireWireAsyncStreamCommandInterface 30
Overview 30 Tasks 30 Instance Methods 32 Instance Variables 45
IOFireWireAVCLibConsumerInterface 47
Overview 47
IOFireWireAVCLibProtocolInterface 48
Overview 48 Tasks 48 Instance Methods 50
IOFireWireAVCLibUnitInterface 64
Overview 64 Tasks 64 Instance Methods 66
IOFireWireCommandInterface 76
Overview 76 Tasks 76 Instance Methods 78 Instance Variables 90
Contents
IOFireWireCompareSwapCommandInterface 92
Overview 92 Tasks 92 Instance Methods 93 Instance Variables 103
IOFireWireCompareSwapCommandInterface_v3 104
Overview 104 Tasks 104 Instance Methods 106 Instance Variables 121
IOFireWireConfigDirectoryInterface 122
Overview 122 Tasks 122 Instance Methods 124 Instance Variables 129
IOFireWireDCLCommandPoolInterface 130
Overview 130 Tasks 130 Instance Methods 132 Instance Variables 138
IOFireWireDeviceInterface 139
Overview 139 Tasks 140 Instance Methods 145 Instance Variables 193
IOFireWireIsochChannelInterface 195
Overview 195 Tasks 195 Instance Methods 196 Instance Variables 201
IOFireWireIsochPortInterface 202
Overview 202 Tasks 202 Instance Methods 203
Contents
IOFireWireLibIRMAllocationInterface 207
Overview 207 Tasks 207 Instance Methods 208
IOFireWireLibPHYPacketListenerInterface 212
Overview 212 Tasks 212 Instance Methods 213 Instance Variables 216
IOFireWireLibVectorCommandInterface 217
Overview 217 Tasks 217 Instance Methods 218 Instance Variables 227
IOFireWireLocalIsochPortInterface 228
Overview 228 Tasks 228 Instance Methods 229 Instance Variables 237
IOFireWireLocalUnitDirectoryInterface 238
Overview 238 Tasks 238 Instance Methods 239 Instance Variables 241
IOFireWireNubInterface 242
Overview 242
IOFireWireNuDCLPoolInterface 244
Overview 244 Tasks 244 Instance Methods 247 Instance Variables 266
Contents
IOFireWirePHYCommandInterface 267
Overview 267 Tasks 267 Instance Methods 269 Instance Variables 282
IOFireWirePhysicalAddressSpaceInterface 283
Overview 283 Tasks 283 Instance Methods 284 Instance Variables 286
IOFireWirePseudoAddressSpaceInterface 287
Overview 287 Tasks 287 Instance Methods 288 Instance Variables 292
IOFireWireReadCommandInterface 293
Overview 293 Tasks 293 Instance Methods 295 Instance Variables 308
IOFireWireReadQuadletCommandInterface 309
Overview 309 Tasks 309 Instance Methods 310 Instance Variables 318
IOFireWireRemoteIsochPortInterface 319
Overview 319 Tasks 319 Instance Methods 320 Instance Variables 325
IOFireWireSBP2LibLoginInterface 326
Overview 326 Tasks 326 Instance Methods 328
Contents
IOFireWireSBP2LibLUNInterface 340
Overview 340 Tasks 340 Instance Methods 341
IOFireWireSBP2LibMgmtORBInterface 348
Overview 348 Tasks 348 Instance Methods 349
IOFireWireSBP2LibORBInterface 353
Overview 353 Tasks 353 Instance Methods 354
IOFireWireUnitInterface 362
Overview 362
IOFireWireWriteCommandInterface 364
Overview 364 Tasks 364 Instance Methods 366 Instance Variables 378
IOFireWireWriteQuadletCommandInterface 380
Overview 380 Tasks 380 Instance Methods 381 Instance Variables 388
IOFWAsyncStreamListenerInterface 390
Overview 390 Tasks 390 Instance Methods 391 Instance Variables 395
IOHIDDeviceDeviceInterface 396
Overview 396 Tasks 396 Instance Methods 397
Contents
IOHIDDeviceInterface 407
Overview 407 Tasks 407 Instance Methods 408
IOHIDDeviceInterface121 414
Overview 414 Tasks 414 Instance Methods 414
IOHIDDeviceInterface122 417
Overview 417 Tasks 417 Instance Methods 417
IOHIDDeviceQueueInterface 420
Overview 420 Tasks 420 Instance Methods 421
IOHIDDeviceTransactionInterface 427
Overview 427 Tasks 427 Instance Methods 428
IOHIDOutputTransactionInterface 435
Overview 435 Tasks 435 Instance Methods 436
IOHIDQueueInterface 443
Overview 443 Tasks 443 Instance Methods 444
IOUPSPlugInInterface 451
Overview 451 Tasks 451 Instance Methods 452
Contents
IOUSBDeviceInterface 456
Overview 456 Tasks 456 Instance Methods 458
IOUSBDeviceInterface182 471
Overview 471 Tasks 471 Instance Methods 472
IOUSBDeviceInterface187 477
Overview 477 Tasks 477 Instance Methods 477
IOUSBDeviceInterface197 479
Overview 479 Tasks 479 Instance Methods 479
IOUSBDeviceInterface245 482
Overview 482
IOUSBDeviceInterface300 483
Overview 483 Tasks 483 Instance Methods 483
IOUSBDeviceInterface320 485
Overview 485 Tasks 485 Instance Methods 486
IOUSBDeviceInterface500 489
Overview 489 Tasks 489 Instance Methods 489
IOUSBInterfaceInterface 491
Overview 491
Contents
IOUSBInterfaceInterface182 514
Overview 514 Tasks 514 Instance Methods 515
IOUSBInterfaceInterface183 522
Overview 522 Tasks 522 Instance Methods 522
IOUSBInterfaceInterface190 524
Overview 524 Tasks 524 Instance Methods 525
IOUSBInterfaceInterface192 529
Overview 529 Tasks 529 Instance Methods 530
IOUSBInterfaceInterface197 537
Overview 537 Tasks 537 Instance Methods 537
MMCDeviceInterface 540
Overview 540 Tasks 540 Instance Methods 541 Instance Variables 560
SCSITaskDeviceInterface 561
Overview 561 Tasks 561 Instance Methods 562 Instance Variables 565
Contents
SCSITaskInterface 566
Overview 566 Tasks 566 Instance Methods 567 Instance Variables 578
10
Contents
11
Contents
Constants 635
12
Contents
13
Contents
14
Contents
15
Contents
Constants 1036
16
Contents
17
Contents
18
Contents
19
/System/Library/Frameworks/IOKit.framework /System/Library/Frameworks/IOKit.framework/Headers I/O Kit Fundamentals ATASMARTLib.h Controls.h IOAudioDefines.h IOAudioTypes.h IOBDBlockStorageDevice.h IOBDMedia.h IOBlockStorageDevice.h IOBlockStorageDriver.h IOCDBlockStorageDevice.h IOCDMedia.h IODVDBlockStorageDevice.h IODVDMedia.h IODataQueue.h IODataQueueClient.h IODataQueueShared.h IOEthernetController.h IOEthernetInterface.h IOEthernetStats.h IOFilterScheme.h IOFireWireAVCLib.h IOFireWireFamilyCommon.h IOFireWireLib.h IOFireWireSBP2Lib.h IOFireWireSBP2Login.h IOFireWireStorageCharacteristics.h IOFramebufferShared.h IOGraphicsLib.h
20
IOHIDBase.h IOHIDDevice.h IOHIDDevicePlugIn.h IOHIDElement.h IOHIDKeys.h IOHIDLibObsolete.h IOHIDManager.h IOHIDQueue.h IOHIDTransaction.h IOHIDValue.h IOI2CInterface.h IOKitLib.h IOKitServer.h IOLib.h IOMedia.h IOMessage.h IONetworkController.h IONetworkData.h IONetworkInterface.h IONetworkLib.h IONetworkMedium.h IONetworkStats.h IOPM.h IOPMKeys.h IOPMLib.h IOPSKeys.h IOPartitionScheme.h IOPowerSources.h IOSharedDataQueue.h IOStorage.h IOStorageCardCharacteristics.h IOStorageDeviceCharacteristics.h IOStorageProtocolCharacteristics.h IOStreamLib.h IOStreamShared.h IOTypes.h IOUPSPlugIn.h
21
IOUSBLib.h IOVideoDeviceLib.h IOVideoDeviceShared.h IOVideoDeviceUserClient.h IOVideoTypes.h KextManager.h SCSICmds_INQUIRY_Definitions.h SCSICmds_MODE_Definitions.h SCSICmds_READ_CAPACITY_Definitions.h SCSICmds_REPORT_LUNS_Definitions.h SCSICmds_REQUEST_SENSE_Defs.h SCSICommandDefinitions.h SCSITask.h SCSITaskLib.h USB.h USBSpec.h
The I/O Kit framework implements non-kernel access to I/O Kit objects (drivers and nubs) through the device-interface mechanism.
22
COMInterfaces
23
IOATASMARTInterface
Declared in
Overview
Self-Monitoring, Analysis, and Reporting Technology Interface. See section 6.14 and section 8.54 of T13:1410D ATA/ATAPI-6 for details on Self-Monitoring, Analysis, and Reporting Technology feature set.
Tasks
Miscellaneous
GetATAIdentifyData
(page 25) Reads the 512-byte data provided by the drive in response to the ATA IDENTIFY DEVICE command. (page 26) (page 26) toggle SMART Autosave.
SMARTEnableDisableAutosave
SMARTEnableDisableOperations
(page 26) immediately initiate collection of SMART data. (page 27) Retrieves 512 byte device SMART data structure. (page 27) Retrieves 512 byte device SMART data thresholds structure. (page 27) Reads the 512-byte log at the specified logOffset in the log.
SMARTReadData
SMARTReadDataThresholds
SMARTReadLogAtAddress
24
SMARTReadLogDirectory
(page 28) Reads the 512-byte log directory. (page 28) see if device has detected a threshold exceeded condition. (page 29) Test the integrity of the device SMART data structure. (page 29) Writes to the 512-byte log at the specified logOffset in the log.
SMARTReturnStatus
SMARTValidateReadData
SMARTWriteLogAtAddress
Instance Methods
GetATAIdentifyData
Reads the 512-byte data provided by the drive in response to the ATA IDENTIFY DEVICE command.
IOReturn ( *GetATAIdentifyData ) ( void *interface, void *buffer, UInt32 inSize, UInt32 *outSize );
Parameters
interface
A valid IOATASMARTInterface**.
buffer
A valid buffer.
inSize
The number of bytes placed in the buffer. Can be NULL if the information is not required by the caller. Return Value An IOReturn result code. If inSize is greater than 512 or less than 1, kIOReturnBadArgument is returned. Discussion Reads the 512-byte data provided by the drive in response to the ATA IDENTIFY DEVICE command. See section 8.15 of ATA/ATAPI-6. The data placed in buffer is guaranteed to be in native endian form on return. (i.e. it will be byte swapped on big endian platforms, so the caller need not do anything)
25
SMARTEnableDisableAutosave
toggle SMART Autosave.
IOReturn ( *SMARTEnableDisableAutosave ) ( void *interface, Boolean enable );
Parameters
enable
Passing true will ENABLE SMART Autosave, false will DISABLE SMART Autosave. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnExclusiveAccess if it is already opened by another client. Discussion See section 8.54.2 of ATA/ATAPI-6.
SMARTEnableDisableOperations
toggle SMART Operations.
IOReturn ( *SMARTEnableDisableOperations ) ( void *interface, Boolean enable );
Parameters
enable
Passing true will ENABLE SMART operations, false will DISABLE SMART operations. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnExclusiveAccess if it is already opened by another client. Discussion See section 8.54.1 and 8.54.3 of ATA/ATAPI-6.
SMARTExecuteOffLineImmediate
immediately initiate collection of SMART data.
26
Parameters
extendedTest
passing true will collect "off-line" extended test, false short test. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnExclusiveAccess if it is already opened by another client. Discussion See section 8.54.4 of ATA/ATAPI-6.
SMARTReadData
Retrieves 512 byte device SMART data structure.
IOReturn ( *SMARTReadData ) ( void *interface, ATASMARTData *data );
Discussion See section 8.54.5 of ATA/ATAPI-6. Will return an appropiate error if command can not be completed.
SMARTReadDataThresholds
Retrieves 512 byte device SMART data thresholds structure.
IOReturn ( *SMARTReadDataThresholds ) ( void *interface, ATASMARTDataThresholds *dataThresholds );
Discussion Retrieves 512 byte device SMART data thresholds structure. This command is not defined as part of ATA/ATAPI-6, but is implemented by a large variety of manufacturers. Will return an appropiate error if command can not be completed.
SMARTReadLogAtAddress
Reads the 512-byte log at the specified logOffset in the log.
27
IOReturn ( *SMARTReadLogAtAddress ) ( void *interface, UInt32 logOffset, void *buffer, UInt32 size );
Discussion Reads the 512-byte log at the specified logOffset in the log. See section 8.54.6.4 of ATA/ATAPI-6.
SMARTReadLogDirectory
Reads the 512-byte log directory.
IOReturn ( *SMARTReadLogDirectory ) ( void *interface, ATASMARTLogDirectory *logData );
Discussion The log directory is a directory of all possible SMART logs available from the drive.
SMARTReturnStatus
see if device has detected a threshold exceeded condition.
IOReturn ( *SMARTReturnStatus ) ( void *interface, Boolean *exceededCondition );
Parameters
exceededCondition
if exceededCondition is non-zero the device threshold exceeded condition. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnExclusiveAccess if it is already opened by another client. Discussion The caller will poll this function and if exceededCondition is non-zero and we returned kIOReturnSuccess the device threshold exceeded condition. This would prompt the caller to call ATASMARTReadData to get more information. See section 8.54.7 of ATA/ATAPI-6.
28
SMARTValidateReadData
Test the integrity of the device SMART data structure.
IOReturn ( *SMARTValidateReadData ) ( void *interface, const ATASMARTData *data );
Discussion The data structure checksum is the two's complement of the sum of the first 511 bytes in the data structure. The sum of all 512 bytes will be zero when the checksum is correct. See section 8.54.5.8.7 of ATA/ATAPI-6. Will return an error if checksum fails.
SMARTWriteLogAtAddress
Writes to the 512-byte log at the specified logOffset in the log.
IOReturn ( *SMARTWriteLogAtAddress ) ( void *interface, UInt32 logOffset, const void *buffer, UInt32 size );
Discussion Writes to the 512-byte log at the specified logOffset in the log. See section 8.54.8.4 of ATA/ATAPI-6.
29
IOFireWireAsyncStreamCommandInterface
Declared in
Overview
Description forthcoming
Tasks
Miscellaneous
Cancel
(page 32) Cancel command execution (page 32) Gets the most recently received ack code for this transaction. (page 33) Set the command refCon value and callback handler, and submit the command to FireWire for execution. (page 33) Gets the refcon associated with this command (page 34) Gets the most recently received response code for this transaction. (page 34) Return command completion status. (page 35) Get command target address. (page 35) Return number of bytes transferred by this command object when it last completed execution. (page 36) Is this command object currently executing?
GetAckCode
GetBuffer
GetRefCon
GetResponseCode
GetStatus
GetTargetAddress
GetTransferredBytes
IsExecuting
30
IOFireWireAsyncStreamCommandInterface Tasks
SetBuffer
(page 37) Set the buffer where read data should be stored. (page 37) Set the completion handler to be called once the command completes asynchronous execution . (page 38) Set the new channel to transmit the AsyncStream command. (page 38) Set flags governing this command's execution. (page 40) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function. (page 40) Set the maximum size in bytes of packets transferred by this command. (page 41) Gets the most recently received ack code for this transaction. (page 41) Sets the maximum number of retries for this command. (page 42) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 42) Set the sync bits for the AsynStream packets. (page 43) Set the tag bits for the AsynStream packets. (page 43) Set command target address (page 44) Sets the duration of the timeout for this command. (page 44)
SetCallback
SetChannel
SetFlags
SetGeneration
SetMaxPacket
SetMaxPacketSpeed
SetMaxRetryCount
SetRefCon
SetSyncBits
SetTagBits
SetTarget
SetTimeoutDuration
Submit
SubmitWithRefconAndCallback
(page 45) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
31
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetAckCode
Gets the most recently received ack code for this transaction.
UInt32 ( *GetAckCode)( IOFireWireLibCommandRef self );
Parameters
self
32
GetBuffer
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
void ( *GetBuffer)( IOFireWireLibCommandRef self, UInt32 *outSize, void **outBuf);
Parameters
self
The command object interface of interest Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
GetRefCon
Gets the refcon associated with this command
void * ( *GetRefCon)( IOFireWireLibCommandRef self );
Parameters
self
33
GetResponseCode
Gets the most recently received response code for this transaction.
UInt32 ( *GetResponseCode)( IOFireWireLibCommandRef self );
Parameters
self
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
34
GetTargetAddress
Get command target address.
void ( *GetTargetAddress)( IOFireWireLibCommandRef self, FWAddress *outAddr);
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID NO YES YES YES YES YES YES YES
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value A UInt32 containing the bytes transferred value
35
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
36
SetBuffer
Set the buffer where read data should be stored.
void ( *SetBuffer)( IOFireWireLibCommandRef self, UInt32 size, void *buf);
Parameters
self
A pointer to the receive buffer. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
void ( *SetCallback)( IOFireWireLibCommandRef self, IOFireWireLibCommandCallback inCallback);
Parameters
self
37
inCallback
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetChannel
Set the new channel to transmit the AsyncStream command.
void ( *SetChannel)( IOFireWireLibAsyncStreamCommandRef self, UInt32 channel );
Parameters
self
The channel for AsyncStream command transmit. Discussion Available in v1 and newer.
SetFlags
Set flags governing this command's execution.
38
Parameters
self
A UInt32 with bits set corresponding to the flags that should be set for this command object. The following values may be used:
kFWCommandNoFlags -- all flags off kFWCommandInterfaceForceNoCopy -- data sent by this command should always be received/sent directly from the buffer set with SetBuffer(). Whatever data is in the buffer when the command is submitted will be used. kFWCommandInterfaceForceCopyAlways -- data will always be copied out of the command object data buffer when SetBuffer() is called, up to a maximum allowed size (kFWUserCommandSubmitWithCopyMaxBufferBytes). This can result in faster data transfer. Changes made to the data buffer contents after calling SetBuffer() will be ignored; SetBuffer() should be called whenever the data buffer contents change. kFWCommandInterfaceSyncExecute -- Setting this flag causes the command object to execute synchronously. The calling context will block until the command object has completed execution or an error occurs. Using synchronous execution can avoid kernel transitions associated with asynchronous completion and often remove the need for a state machine. kFWCommandInterfaceForceBlockRequest -- Setting this flag causes read and write transactions to use block request packets even if the payload is 4 bytes. If this flag is not set 4 byte transactions will occur using quadlet transactions.
39
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
void ( *SetGeneration)( IOFireWireLibCommandRef self, UInt32 generation);
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetMaxPacket
Set the maximum size in bytes of packets transferred by this command.
IOReturn ( *SetMaxPacket)( IOFireWireLibCommandRef self, IOByteCount maxPacketSize);
Parameters
self
40
maxPacketSize
Size in bytes of largest packet that should be transferred by this command. Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetMaxPacketSpeed
Gets the most recently received ack code for this transaction.
void ( *SetMaxPacketSpeed)( IOFireWireLibCommandRef self, IOFWSpeed speed );
Parameters
self
SetMaxRetryCount
Sets the maximum number of retries for this command.
41
Parameters
self
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
SetSyncBits
Set the sync bits for the AsynStream packets.
42
Parameters
self
The value for sync bits in the AsyncStream packet Discussion Available in v1 and newer.
SetTagBits
Set the tag bits for the AsynStream packets.
void ( *SetTagBits)( IOFireWireLibAsyncStreamCommandRef self, UInt16 tag );
Parameters
self
The value for tag bits in the AsyncStream packet Discussion Available in v1 and newer.
SetTarget
Set command target address
void ( *SetTarget)( IOFireWireLibCommandRef self, const FWAddress *addr);
Parameters
self
43
addr
SetTimeoutDuration
Sets the duration of the timeout for this command.
void ( *SetTimeoutDuration)( IOFireWireLibCommandRef self, UInt32 duration );
Parameters
self
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
44
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
Instance Variables
revision
UInt32 revision;
Interface revision.
45
version
UInt32 version;
Interface version.
46
IOFireWireAVCLibConsumerInterface
Declared in
Overview
Interface for an asynchronous connection consumer. Used to receive data from an asynchronous connection producer.
47
IOFireWireAVCLibProtocolInterface
Declared in
Overview
Initial interface discovered for all AVC protocol drivers. The IOFireWireAVCLibProtocolInterface is used to set up local plug control registers and to receive AVC requests.
Tasks
Miscellaneous
addCallbackDispatcherToRunLoop
(page 50) Adds a dispatcher for kernel callbacks to the specified run loop. (page 50) Installs a virtual AVC subunit. (page 51) Allocates an input plug. (page 52) Allocates an output plug. (page 52) Establishes an internal AVC plug connection between subunit/unit plugs. (page 53) Breaks an internal AVC plug connection between subunit/unit plugs. (page 54) Deallocates an input plug. (page 55) Deallocates an output plug.
addSubunit
allocateInputPlug
allocateOutputPlug
connectTargetPlugs
disconnectTargetPlugs
freeInputPlug
freeOutputPlug
48
IOFireWireAVCLibProtocolInterface Tasks
getSubunitPlugSignalFormat
(page 55) Gets the signal format of the specifed plug. (page 55) Gets the connection details for a specific plug. (page 56) Installs a command handler for handling specific incoming AVC commands. (page 57) Publishes an AVC unit directory in the config ROM. (page 57) Returns the current value of the input master plug. (page 58) Returns the current value of an input plug. (page 58) Returns the current value of the output master plug. (page 58) Returns the current value of an output plug. (page 59) Removes a dispatcher for kernel callbacks to the specified run loop. (page 59) Sends an AVC response packet. (page 59) This function has been deprecated. Use installAVCCommandHandler instead. (page 60) Sets callback for user space message routine. (page 60) Sets the signal format of the specifed plug. (page 61) Updates the value of the master input plug (simulating a lock transaction). (page 61) Updates the value of an input plug (simulating a lock transaction). (page 62) Updates the value of the master output plug (simulating a lock transaction). (page 62) Updates the value of an output plug (simulating a lock transaction).
getTargetPlugConnection
installAVCCommandHandler
publishAVCUnitDirectory
readInputMasterPlug
readInputPlug
readOutputMasterPlug
readOutputPlug
removeCallbackDispatcherFromRunLoop
sendAVCResponse
setAVCRequestCallback
setMessageCallback
setSubunitPlugSignalFormat
updateInputMasterPlug
updateInputPlug
updateOutputMasterPlug
updateOutputPlug
49
Instance Methods
addCallbackDispatcherToRunLoop
Adds a dispatcher for kernel callbacks to the specified run loop.
IOReturn ( *addCallbackDispatcherToRunLoop)( void *self, CFRunLoopRef cfRunLoopRef );
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
cfRunLoopRef
Reference to a run loop. Return Value Returns kIOReturnSuccess on success. Discussion The user space portions of the AVC API communicate with the in-kernel services by messaging the kernel. Similarly, the kernel messages the user space services in response. These responses need to be picked up by a piece of code. This call adds that code to the specified run loop. Most drivers will call this method on the run loop that was created when your task was created. To avoid deadlock you must avoid sleeping (or spin waiting) the run loop to wait for AVC response. If you do this the dispatcher will never get to run and you will wait forever.
addSubunit
Installs a virtual AVC subunit.
50
IOReturn ( *addSubunit)( void *self, UInt32 subunitType, UInt32 numSourcePlugs, UInt32 numDestPlugs, void *refCon, IOFWAVCSubunitPlugHandlerCallback callback, UInt32 *pSubunitTypeAndID);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
subunitType
A pointer to a byte to hold the returned subunit address for the new subunit.
allocateInputPlug
Allocates an input plug.
IOReturn ( *allocateInputPlug)( void *self, void *refcon, IOFWAVCPCRCallback func, UInt32 *plug);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
refcon
51
func
Callback function when a successful lock transaction to the plug has been performed.
plug
allocateOutputPlug
Allocates an output plug.
IOReturn ( *allocateOutputPlug)( void *self, void *refcon, IOFWAVCPCRCallback func, UInt32 *plug);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
refcon
Callback function when a successful lock transaction to the plug has been performed.
plug
connectTargetPlugs
Establishes an internal AVC plug connection between subunit/unit plugs.
52
IOReturn ( *connectTargetPlugs)( void *self, UInt32 sourceSubunitTypeAndID, IOFWAVCPlugTypes sourcePlugType, UInt32 *pSourcePlugNum, UInt32 destSubunitTypeAndID, IOFWAVCPlugTypes destPlugType, UInt32 *pDestPlugNum, bool lockConnection, bool permConnection);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
sourceSubunitTypeAndID
A pointer to the source plug num. Will return the actual source plug num here.
destSubunitTypeAndID
A pointer to the dest plug num. Will return the actual dest plug num here.
lockConnection
disconnectTargetPlugs
Breaks an internal AVC plug connection between subunit/unit plugs.
53
IOReturn ( *disconnectTargetPlugs)( void *self, UInt32 sourceSubunitTypeAndID, IOFWAVCPlugTypes sourcePlugType, UInt32 sourcePlugNum, UInt32 destSubunitTypeAndID, IOFWAVCPlugTypes destPlugType, UInt32 destPlugNum);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
sourceSubunitTypeAndID
freeInputPlug
Deallocates an input plug.
void ( *freeInputPlug)( void *self, UInt32 plug);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
plug
54
freeOutputPlug
Deallocates an output plug.
void ( *freeOutputPlug)( void *self, UInt32 plug);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
plug
getSubunitPlugSignalFormat
Gets the signal format of the specifed plug.
IOReturn ( *getSubunitPlugSignalFormat)( void *self, UInt32 subunitTypeAndID, IOFWAVCPlugTypes plugType, UInt32 plugNum, UInt32 *pSignalFormat);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
subunitTypeAndID
getTargetPlugConnection
Gets the connection details for a specific plug.
55
IOReturn ( *getTargetPlugConnection)( void *self, UInt32 subunitTypeAndID, IOFWAVCPlugTypes plugType, UInt32 plugNum, UInt32 *pConnectedSubunitTypeAndID, IOFWAVCPlugTypes *pConnectedPlugType, UInt32 *pConnectedPlugNum, bool *pLockConnection, bool *pPermConnection);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
subunitTypeAndID
installAVCCommandHandler
Installs a command handler for handling specific incoming AVC commands.
56
IOReturn ( *installAVCCommandHandler)( void *self, UInt32 subUnitTypeAndID, UInt32 opCode, void *refCon, IOFWAVCCommandHandlerCallback callback);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
subUnitTypeAndID
publishAVCUnitDirectory
Publishes an AVC unit directory in the config ROM.
IOReturn ( *publishAVCUnitDirectory)( void *self);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
readInputMasterPlug
Returns the current value of the input master plug.
UInt32 ( *readInputMasterPlug)( void *self);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
57
readInputPlug
Returns the current value of an input plug.
UInt32 ( *readInputPlug)( void *self, UInt32 plug);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
plug
readOutputMasterPlug
Returns the current value of the output master plug.
UInt32 ( *readOutputMasterPlug)( void *self);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
readOutputPlug
Returns the current value of an output plug.
UInt32 ( *readOutputPlug)( void *self, UInt32 plug);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
plug
58
removeCallbackDispatcherFromRunLoop
Removes a dispatcher for kernel callbacks to the specified run loop.
void ( *removeCallbackDispatcherFromRunLoop)( void *self );
Parameters
self
sendAVCResponse
Sends an AVC response packet.
IOReturn ( *sendAVCResponse)( void *self, UInt32 generation, UInt16 nodeID, const char *response, UInt32 responseLen);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
generation
The Firewire bus generation that this response should be sent in.
nodeID
setAVCRequestCallback
This function has been deprecated. Use installAVCCommandHandler instead.
59
IOReturn ( *setAVCRequestCallback)( void *self, UInt32 subUnitType, UInt32 subUnitID, void *refCon, IOFWAVCRequestCallback callback);
setMessageCallback
Sets callback for user space message routine.
void ( *setMessageCallback)( void *self, void *refCon, IOFWAVCMessageCallback callback);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
refCon
Address of completion routine. Discussion In FireWire and AVC, bus status messages are delivered via IOKit's message routine. This routine is emulated in user space for AVC and FireWire messages via this callback. You should register here for bus reset and reconnect messages.
setSubunitPlugSignalFormat
Sets the signal format of the specifed plug.
60
IOReturn ( *setSubunitPlugSignalFormat)( void *self, UInt32 subunitTypeAndID, IOFWAVCPlugTypes plugType, UInt32 plugNum, UInt32 signalFormat);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
subunitTypeAndID
updateInputMasterPlug
Updates the value of the master input plug (simulating a lock transaction).
IOReturn ( *updateInputMasterPlug)( void *self, UInt32 oldVal, UInt32 newVal);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
oldVal
updateInputPlug
Updates the value of an input plug (simulating a lock transaction).
61
IOReturn ( *updateInputPlug)( void *self, UInt32 plug, UInt32 oldVal, UInt32 newVal);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
plug
updateOutputMasterPlug
Updates the value of the master output plug (simulating a lock transaction).
IOReturn ( *updateOutputMasterPlug)( void *self, UInt32 oldVal, UInt32 newVal);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
oldVal
updateOutputPlug
Updates the value of an output plug (simulating a lock transaction).
62
IOReturn ( *updateOutputPlug)( void *self, UInt32 plug, UInt32 oldVal, UInt32 newVal);
Parameters
self
Pointer to IOFireWireAVCLibProtocolInterface.
plug
63
IOFireWireAVCLibUnitInterface
Declared in
Overview
Initial interface discovered for all AVC Unit drivers. The IOFireWireAVCLibUnitInterface is the initial interface discovered by most drivers. It supplies the methods that control the operation of the AVC unit as a whole. Finally, the Unit can supply a reference to the IOFireWireUnit. This can be useful if a driver wishes to access the standard FireWire APIs.
Tasks
Miscellaneous
addCallbackDispatcherToRunLoop
(page 66) Adds a dispatcher for kernel callbacks to the specified runloop. (page 67) (page 67) (page 67)
AVCAsynchronousCommandCancel
AVCAsynchronousCommandReinit
AVCAsynchronousCommandReinitWithCommandBytes
AVCAsynchronousCommandRelease
(page 67)
AVCAsynchronousCommandSubmit
(page 67)
AVCCommand
(page 67) Sends an AVC command to the device and returns the response.
64
IOFireWireAVCLibUnitInterface Tasks
AVCCommandInGeneration
(page 68) Sends an AVC command to the device and returns the response. (page 69) Decrements the point-to-point connection count of a unit input plug. (page 69) Decrements the point-to-point connection count of a unit output plug. (page 69) Closes an exclusive access to the device. (page 70)
breakP2PInputConnection
breakP2POutputConnection
close
createAVCAsynchronousCommand
getAncestorInterface
(page 70) Creates a plug-in object for an ancestor (in the I/O Registry) of the AVC unit and returns an interface to it. (page 71) Creates a plug-in object for a protocol driver for the FireWire bus the AVC unit is connected to and returns an interface to it. (page 71) Get the session reference. (page 72) Increments the point-to-point connection count of a unit input plug. (page 72) Increments the point-to-point connection count of a unit output plug.
getProtocolInterface
getSessionRef
makeP2PInputConnection
makeP2POutputConnection
open
(page 72) Exclusively opens a connection to the in-kernel device. (page 73) Opens a connection to a device that is not already open. (page 74) Removes a dispatcher for kernel callbacks to the specified run loop. (page 74) Sets callback for user space message routine. (page 75) Updates an AVCCommand's timeout back to 10 seconds.
openWithSessionRef
removeCallbackDispatcherFromRunLoop
setMessageCallback
updateAVCCommandTimeout
65
Instance Methods
addCallbackDispatcherToRunLoop
Adds a dispatcher for kernel callbacks to the specified runloop.
IOReturn ( *addCallbackDispatcherToRunLoop)( void *self, CFRunLoopRef cfRunLoopRef );
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface.
cfRunLoopRef
Reference to a run loop. Return Value Returns kIOReturnSuccess on success. Discussion The user space portions of the AVC API communicate with the in-kernel services by messaging the kernel. Similarly, the kernel messages the user space services in response. These responses need to be picked up by a piece of code. This call adds that code to the specified run loop. Most drivers will call this method on the run loop that was created when your task was created. To avoid deadlock you must avoid sleeping (or spin waiting) the run loop to wait for AVC response. If you do this the dispatcher will never get to run and you will wait forever.
66
AVCAsynchronousCommandCancel
IOReturn ( *AVCAsynchronousCommandCancel)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
AVCAsynchronousCommandReinit
IOReturn ( *AVCAsynchronousCommandReinit)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
AVCAsynchronousCommandReinitWithCommandBytes
IOReturn ( *AVCAsynchronousCommandReinitWithCommandBytes)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject, const UInt8 *command, UInt32 cmdLen);
AVCAsynchronousCommandRelease
IOReturn ( *AVCAsynchronousCommandRelease)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
AVCAsynchronousCommandSubmit
IOReturn ( *AVCAsynchronousCommandSubmit)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
AVCCommand
Sends an AVC command to the device and returns the response.
67
IOReturn ( *AVCCommand)( void *self, const UInt8 *command, UInt32 cmdLen, UInt8 *response, UInt32 *responseLen);
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface.
command
Pointer to place to store the length of the response. Discussion This function will block until the device returns a response or the kernel driver times out.
AVCCommandInGeneration
Sends an AVC command to the device and returns the response.
IOReturn ( *AVCCommandInGeneration)( void *self, UInt32 busGeneration, const UInt8 *command, UInt32 cmdLen, UInt8 *response, UInt32 *responseLen);
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface.
busGeneration
68
cmdLen
Pointer to place to store the length of the response. Discussion Sends an AVC command to the device and returns the response. The command must complete in the specified bus generation. This function is only available if the interface version is > 1 (MacOSX 10.2.0 or later?). This function will block until the device returns a response or the kernel driver times out.
breakP2PInputConnection
Decrements the point-to-point connection count of a unit input plug.
IOReturn ( *breakP2PInputConnection)( void *self, UInt32 inputPlug);
breakP2POutputConnection
Decrements the point-to-point connection count of a unit output plug.
IOReturn ( *breakP2POutputConnection)( void *self, UInt32 outputPlug);
close
Closes an exclusive access to the device.
69
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface. Discussion Closes an exclusive access to the device. When a device is closed it may be unloaded by the kernel. If it is unloaded and then later reappears it will be represented by a different object. You won't be able to use this user client on the new object. The new object will have to be looked up in the I/O Registry and a new user client will have to be opened on it.
createAVCAsynchronousCommand
IOReturn ( *createAVCAsynchronousCommand)( void *self, const UInt8 *command, UInt32 cmdLen, IOFireWireAVCLibAsynchronousCommandCallback completionCallback, void *pRefCon, IOFireWireAVCLibAsynchronousCommand **ppCommandObject);
getAncestorInterface
Creates a plug-in object for an ancestor (in the I/O Registry) of the AVC unit and returns an interface to it.
void * ( *getAncestorInterface)( void *self, char *object_class, REFIID pluginType, REFIID iid);
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface.
object_class
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of plug-in service to be returned for the ancestor.
70
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created plug-in object. Return Value Returns a COM-style interface pointer. Returns 0 upon failure. Discussion This function is only available if the interface version is > 1 (MacOSX 10.2.0 or later?).
getProtocolInterface
Creates a plug-in object for a protocol driver for the FireWire bus the AVC unit is connected to and returns an interface to it.
void * ( *getProtocolInterface)( void *self, REFIID pluginType, REFIID iid);
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface.
pluginType
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of plug-in service to be returned for the created protocol object.
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created protocol device object. Return Value Returns a COM-style interface pointer. Returns 0 upon failure. Discussion This function is only available if the interface version is > 1 (MacOSX 10.2.0 or later?).
getSessionRef
Get the session reference.
71
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface. Return Value Returns a sessionRef on success. Discussion Gets the sessionRef to be used with openWithSessionRef.
makeP2PInputConnection
Increments the point-to-point connection count of a unit input plug.
IOReturn ( *makeP2PInputConnection)( void *self, UInt32 inputPlug, UInt32 chan);
makeP2POutputConnection
Increments the point-to-point connection count of a unit output plug.
IOReturn ( *makeP2POutputConnection)( void *self, UInt32 outputPlug, UInt32 chan, IOFWSpeed speed);
open
Exclusively opens a connection to the in-kernel device.
72
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface. Return Value Returns kIOReturnSuccess on success. Discussion Exclusively opens a connection to the in-kernel device. As long as the in-kernel device object is open, no other drivers will be able to open a connection to the device. When open, the device on the bus may disappear, but the in-kernel object representing it will stay instantiated and can begin communicating with the device again if it ever reappears.
openWithSessionRef
Opens a connection to a device that is not already open.
IOReturn ( *openWithSessionRef)( void *self, IOFireWireSessionRef sessionRef );
Parameters
sessionRef
Pointer to IOFireWireAVCLibUnitInterface. Return Value Returns kIOReturnSuccess on success. Discussion Sometimes it is desirable to open multiple user clients on a device. In the case of FireWire sometimes we wish to have both the FireWire User Client and the AVC User Client open at the same time. The technique to arbitrate this is as follows: First open normally the device furthest from the root in the I/O Registry. Second, get its sessionRef with the getSessionRef call.
73
Third, open the device further up the chain by calling this method and passing the sessionRef returned from the call in step 2.
removeCallbackDispatcherFromRunLoop
Removes a dispatcher for kernel callbacks to the specified run loop.
void ( *removeCallbackDispatcherFromRunLoop)( void *self );
Parameters
self
setMessageCallback
Sets callback for user space message routine.
void ( *setMessageCallback)( void *self, void *refCon, IOFWAVCMessageCallback callback);
Parameters
self
Pointer to IOFireWireAVCLibUnitInterface.
refCon
Address of completion routine. Discussion In FireWire and AVC, bus status messages are delivered via IOKit's message routine. This routine is emulated in user space for AVC and FireWire messages via this callback. You should register here for bus reset and reconnect messages.
74
updateAVCCommandTimeout
Updates an AVCCommand's timeout back to 10 seconds.
IOReturn ( *updateAVCCommandTimeout)( void *self);
Discussion AVCCommands will time out after 10 seconds unless this function is called (from another thread) to update the command's timeout back to 10 seconds. This function is only available if the interface version is > 2.
75
IOFireWireCommandInterface
Declared in
Overview
IOFireWireLib command object. Represents an object that is configured and submitted to issue synchronous and asynchronous bus commands. This is a superclass containing all command object functionality not specific to any kind of bus transaction. Note that data may not always be transferred to or from the data buffer for command objects at the time the command is submitted. In some cases the transfer may happen as soon as SetBuffer() (below, v2 interfaces and newer) is called. You can use the SetFlags() call (below, v2 interfaces and newer) to control this behavior.
Tasks
Miscellaneous
Cancel
(page 78) Cancel command execution (page 78) Gets the most recently received ack code for this transaction. (page 79) Set the command refCon value and callback handler, and submit the command to FireWire for execution. (page 79) Gets the refcon associated with this command (page 80) Gets the most recently received response code for this transaction. (page 80) Return command completion status.
GetAckCode
GetBuffer
GetRefCon
GetResponseCode
GetStatus
76
IOFireWireCommandInterface Tasks
GetTargetAddress
(page 81) Get command target address. (page 81) Return number of bytes transferred by this command object when it last completed execution. (page 82) Is this command object currently executing? (page 83) Set the buffer where read data should be stored. (page 83) Set the completion handler to be called once the command completes asynchronous execution . (page 84) Set flags governing this command's execution. (page 85) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function. (page 86) Set the maximum size in bytes of packets transferred by this command. (page 87) Gets the most recently received ack code for this transaction. (page 87) Sets the maximum number of retries for this command. (page 88) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 88) Set command target address (page 89) Sets the duration of the timeout for this command. (page 89)
GetTransferredBytes
IsExecuting
SetBuffer
SetCallback
SetFlags
SetGeneration
SetMaxPacket
SetMaxPacketSpeed
SetMaxRetryCount
SetRefCon
SetTarget
SetTimeoutDuration
Submit
SubmitWithRefconAndCallback
(page 90) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
77
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetAckCode
Gets the most recently received ack code for this transaction.
UInt32 ( *GetAckCode)( IOFireWireLibCommandRef self );
Parameters
self
78
GetBuffer
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
void ( *GetBuffer)( IOFireWireLibCommandRef self, UInt32 *outSize, void **outBuf);
Parameters
self
The command object interface of interest Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
GetRefCon
Gets the refcon associated with this command
void * ( *GetRefCon)( IOFireWireLibCommandRef self );
Parameters
self
79
GetResponseCode
Gets the most recently received response code for this transaction.
UInt32 ( *GetResponseCode)( IOFireWireLibCommandRef self );
Parameters
self
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
80
GetTargetAddress
Get command target address.
void ( *GetTargetAddress)( IOFireWireLibCommandRef self, FWAddress *outAddr);
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID NO YES YES YES YES YES YES YES
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value A UInt32 containing the bytes transferred value
81
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
82
SetBuffer
Set the buffer where read data should be stored.
void ( *SetBuffer)( IOFireWireLibCommandRef self, UInt32 size, void *buf);
Parameters
self
A pointer to the receive buffer. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
void ( *SetCallback)( IOFireWireLibCommandRef self, IOFireWireLibCommandCallback inCallback);
Parameters
self
83
inCallback
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetFlags
Set flags governing this command's execution.
void ( *SetFlags)( IOFireWireLibCommandRef self, UInt32 inFlags);
Parameters
self
84
inFlags
A UInt32 with bits set corresponding to the flags that should be set for this command object. The following values may be used:
kFWCommandNoFlags -- all flags off kFWCommandInterfaceForceNoCopy -- data sent by this command should always be received/sent directly from the buffer set with SetBuffer(). Whatever data is in the buffer when the command is submitted will be used. kFWCommandInterfaceForceCopyAlways -- data will always be copied out of the command object data buffer when SetBuffer() is called, up to a maximum allowed size (kFWUserCommandSubmitWithCopyMaxBufferBytes). This can result in faster data transfer. Changes made to the data buffer contents after calling SetBuffer() will be ignored; SetBuffer() should be called whenever the data buffer contents change. kFWCommandInterfaceSyncExecute -- Setting this flag causes the command object to execute synchronously. The calling context will block until the command object has completed execution or an error occurs. Using synchronous execution can avoid kernel transitions associated with asynchronous completion and often remove the need for a state machine. kFWCommandInterfaceForceBlockRequest -- Setting this flag causes read and write transactions to use block request packets even if the payload is 4 bytes. If this flag is not set 4 byte transactions will occur using quadlet transactions.
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
85
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetMaxPacket
Set the maximum size in bytes of packets transferred by this command.
IOReturn ( *SetMaxPacket)( IOFireWireLibCommandRef self, IOByteCount maxPacketSize);
Parameters
self
Size in bytes of largest packet that should be transferred by this command. Return Value An IOReturn result code indicating whether or not the command was successfully submitted
86
SetMaxPacketSpeed
Gets the most recently received ack code for this transaction.
void ( *SetMaxPacketSpeed)( IOFireWireLibCommandRef self, IOFWSpeed speed );
Parameters
self
SetMaxRetryCount
Sets the maximum number of retries for this command.
void ( *SetMaxRetryCount)( IOFireWireLibCommandRef self, UInt32 count );
Parameters
self
87
count
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
SetTarget
Set command target address
void ( *SetTarget)( IOFireWireLibCommandRef self, const FWAddress *addr);
Parameters
self
88
addr
SetTimeoutDuration
Sets the duration of the timeout for this command.
void ( *SetTimeoutDuration)( IOFireWireLibCommandRef self, UInt32 duration );
Parameters
self
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
89
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
Instance Variables
revision
UInt32 revision;
Interface revision
90
version
UInt32 version;
Interface version
91
IOFireWireCompareSwapCommandInterface
Declared in
Overview
Description forthcoming
Tasks
Miscellaneous
Cancel
(page 93) Cancel command execution (page 94) Was the last lock operation successful? (page 94) Return command completion status. (page 95) Get command target address. (page 96) Return number of bytes transferred by this command object when it last completed execution. (page 96) Is this command object currently executing? (page 97) Get the 32-bit value returned on the last compare swap operation. (page 98) Get the 64-bit value returned on the last compare swap operation. (page 98) Set the completion handler to be called once the command completes asynchronous execution .
DidLock
GetStatus
GetTargetAddress
GetTransferredBytes
IsExecuting
Locked
Locked64
SetCallback
92
SetFlags
(page 99) Set flags governing this command's execution. (page 99) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function. (page 100) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 100) Set command target address (page 101) Set values for 32-bit compare swap operation. Calling this function will make the command object perform 32-bit compare swap transactions on the bus. To perform 64-bit compare swap operations, use the SetValues64() call, below. (page 102) Set values for 64-bit compare swap operation. Calling this function will make the command object perform 64-bit compare swap transactions on the bus. To perform 32-bit compare swap operations, use the SetValues() call, above. (page 102)
SetGeneration
SetRefCon
SetTarget
SetValues
SetValues64
Submit
SubmitWithRefconAndCallback
(page 102) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
93
Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
DidLock
Was the last lock operation successful?
Boolean ( *DidLock)( IOFireWireLibCompareSwapCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the last lock operation performed by this command object was successful, false otherwise. Discussion Available in v2 and newer.
GetStatus
Return command completion status.
94
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetTargetAddress
Get command target address.
void ( *GetTargetAddress)( IOFireWireLibCommandRef self, FWAddress *outAddr);
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID NO
95
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value A UInt32 containing the bytes transferred value Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
IsExecuting
Is this command object currently executing?
96
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
Locked
Get the 32-bit value returned on the last compare swap operation.
IOReturn ( *Locked)( IOFireWireLibCompareSwapCommandRef self, UInt32 *oldValue);
Parameters
self
A pointer to contain the value returned by the target of this command on the last compare swap operation Return Value Returns kIOReturnBadArgument if the last compare swap operation performed was 64-bit. Discussion Available in v2 and newer.
97
Locked64
Get the 64-bit value returned on the last compare swap operation.
IOReturn ( *Locked64)( IOFireWireLibCompareSwapCommandRef self, UInt64 *oldValue);
Parameters
self
A pointer to contain the value returned by the target of this command on the last compare swap operation Return Value Returns kIOReturnBadArgument if the last compare swap performed was 32-bit. Discussion Available in v2 and newer.
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
void ( *SetCallback)( IOFireWireLibCommandRef self, IOFireWireLibCommandCallback inCallback);
Parameters
self
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID YES YES YES YES
98
SetFlags
Set flags governing this command's execution.
void ( *SetFlags)( IOFireWireLibCompareSwapCommandRef self, UInt32 inFlags);
Parameters
self
A UInt32 with bits set corresponding to the flags that should be set. Discussion Available in v2 and newer. Same as SetFlags() above.
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
void ( *SetGeneration)( IOFireWireLibCommandRef self, UInt32 generation);
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
99
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
SetTarget
Set command target address
100
Parameters
self
SetValues
Set values for 32-bit compare swap operation. Calling this function will make the command object perform 32-bit compare swap transactions on the bus. To perform 64-bit compare swap operations, use the SetValues64() call, below.
void ( *SetValues)( IOFireWireLibCompareSwapCommandRef self, UInt32 cmpVal, UInt32 newVal);
Parameters
self
101
SetValues64
Set values for 64-bit compare swap operation. Calling this function will make the command object perform 64-bit compare swap transactions on the bus. To perform 32-bit compare swap operations, use the SetValues() call, above.
void ( *SetValues64)( IOFireWireLibCompareSwapCommandRef self, UInt64 cmpVal, UInt64 newVal);
Parameters
self
The value to be written at the address targeted by this command object Discussion Available in v2 and newer.
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
102
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
103
IOFireWireCompareSwapCommandInterface_v3
Declared in
Overview
Description forthcoming
Tasks
Miscellaneous
Cancel
(page 106) Cancel command execution (page 107) Was the last lock operation successful? (page 107) Gets the most recently received ack code for this transaction. (page 107) Set the command refCon value and callback handler, and submit the command to FireWire for execution. (page 108) Gets the refcon associated with this command (page 108) Gets the most recently received response code for this transaction. (page 109) Return command completion status. (page 109) Get command target address. (page 110) Return number of bytes transferred by this command object when it last completed execution.
DidLock
GetAckCode
GetBuffer
GetRefCon
GetResponseCode
GetStatus
GetTargetAddress
GetTransferredBytes
104
IOFireWireCompareSwapCommandInterface_v3 Tasks
IsExecuting
(page 111) Is this command object currently executing? (page 111) Get the 32-bit value returned on the last compare swap operation. (page 112) Get the 64-bit value returned on the last compare swap operation. (page 112) Set the buffer where read data should be stored. (page 113) Set the completion handler to be called once the command completes asynchronous execution . (page 114) Set flags governing this command's execution. (page 115) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function. (page 116) Set the maximum size in bytes of packets transferred by this command. (page 116) Gets the most recently received ack code for this transaction. (page 117) Sets the maximum number of retries for this command. (page 117) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 118) Set command target address (page 118) Sets the duration of the timeout for this command. (page 119) Set values for 32-bit compare swap operation. Calling this function will make the command object perform 32-bit compare swap transactions on the bus. To perform 64-bit compare swap operations, use the SetValues64() call, below.
Locked
Locked64
SetBuffer
SetCallback
SetFlags
SetGeneration
SetMaxPacket
SetMaxPacketSpeed
SetMaxRetryCount
SetRefCon
SetTarget
SetTimeoutDuration
SetValues
105
SetValues64
(page 119) Set values for 64-bit compare swap operation. Calling this function will make the command object perform 64-bit compare swap transactions on the bus. To perform 32-bit compare swap operations, use the SetValues() call, above. (page 120)
Submit
SubmitWithRefconAndCallback
(page 120) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
106
DidLock
Was the last lock operation successful?
Boolean ( *DidLock)( IOFireWireLibCompareSwapCommandV3Ref self);
Parameters
self
The command object interface of interest Return Value Returns true if the last lock operation performed by this command object was successful, false otherwise. Discussion Available in v2 and newer.
GetAckCode
Gets the most recently received ack code for this transaction.
UInt32 ( *GetAckCode)( IOFireWireLibCommandRef self );
Parameters
self
GetBuffer
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
void ( *GetBuffer)( IOFireWireLibCommandRef self, UInt32 *outSize, void **outBuf);
Parameters
self
107
GetRefCon
Gets the refcon associated with this command
void * ( *GetRefCon)( IOFireWireLibCommandRef self );
Parameters
self
GetResponseCode
Gets the most recently received response code for this transaction.
UInt32 ( *GetResponseCode)( IOFireWireLibCommandRef self );
Parameters
self
108
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetTargetAddress
Get command target address.
void ( *GetTargetAddress)( IOFireWireLibCommandRef self, FWAddress *outAddr);
Parameters
self
109
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value A UInt32 containing the bytes transferred value Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
110
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
Locked
Get the 32-bit value returned on the last compare swap operation.
IOReturn ( *Locked)( IOFireWireLibCompareSwapCommandV3Ref self, UInt32 *oldValue);
Parameters
self
A pointer to contain the value returned by the target of this command on the last compare swap operation
111
Return Value Returns kIOReturnBadArgument if the last compare swap operation performed was 64-bit. Discussion Available in v2 and newer.
Locked64
Get the 64-bit value returned on the last compare swap operation.
IOReturn ( *Locked64)( IOFireWireLibCompareSwapCommandV3Ref self, UInt64 *oldValue);
Parameters
self
A pointer to contain the value returned by the target of this command on the last compare swap operation Return Value Returns kIOReturnBadArgument if the last compare swap performed was 32-bit. Discussion Available in v2 and newer.
SetBuffer
Set the buffer where read data should be stored.
void ( *SetBuffer)( IOFireWireLibCommandRef self, UInt32 size, void *buf);
Parameters
self
112
buf
A pointer to the receive buffer. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
void ( *SetCallback)( IOFireWireLibCommandRef self, IOFireWireLibCommandCallback inCallback);
Parameters
self
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID YES YES YES YES YES YES
113
kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID
YES YES
SetFlags
Set flags governing this command's execution.
void ( *SetFlags)( IOFireWireLibCommandRef self, UInt32 inFlags);
Parameters
self
A UInt32 with bits set corresponding to the flags that should be set for this command object. The following values may be used:
kFWCommandNoFlags -- all flags off kFWCommandInterfaceForceNoCopy -- data sent by this command should always be received/sent directly from the buffer set with SetBuffer(). Whatever data is in the buffer when the command is submitted will be used. kFWCommandInterfaceForceCopyAlways -- data will always be copied out of the command object data buffer when SetBuffer() is called, up to a maximum allowed size (kFWUserCommandSubmitWithCopyMaxBufferBytes). This can result in faster data transfer. Changes made to the data buffer contents after calling SetBuffer() will be ignored; SetBuffer() should be called whenever the data buffer contents change. kFWCommandInterfaceSyncExecute -- Setting this flag causes the command object to execute synchronously. The calling context will block until the command object has completed execution or an error occurs. Using synchronous execution can avoid kernel transitions associated with asynchronous completion and often remove the need for a state machine. kFWCommandInterfaceForceBlockRequest -- Setting this flag causes read and write transactions to use block request packets even if the payload is 4 bytes. If this flag is not set 4 byte transactions will occur using quadlet transactions.
114
NO NO NO YES NO YES NO
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
void ( *SetGeneration)( IOFireWireLibCommandRef self, UInt32 generation);
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
115
SetMaxPacket
Set the maximum size in bytes of packets transferred by this command.
IOReturn ( *SetMaxPacket)( IOFireWireLibCommandRef self, IOByteCount maxPacketSize);
Parameters
self
Size in bytes of largest packet that should be transferred by this command. Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetMaxPacketSpeed
Gets the most recently received ack code for this transaction.
void ( *SetMaxPacketSpeed)( IOFireWireLibCommandRef self, IOFWSpeed speed );
Parameters
self
116
speed
SetMaxRetryCount
Sets the maximum number of retries for this command.
void ( *SetMaxRetryCount)( IOFireWireLibCommandRef self, UInt32 count );
Parameters
self
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
117
kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID
YES YES
SetTarget
Set command target address
void ( *SetTarget)( IOFireWireLibCommandRef self, const FWAddress *addr);
Parameters
self
SetTimeoutDuration
Sets the duration of the timeout for this command.
118
Parameters
self
SetValues
Set values for 32-bit compare swap operation. Calling this function will make the command object perform 32-bit compare swap transactions on the bus. To perform 64-bit compare swap operations, use the SetValues64() call, below.
void ( *SetValues)( IOFireWireLibCompareSwapCommandV3Ref self, UInt32 cmpVal, UInt32 newVal);
Parameters
self
The value to be written at the address targeted by this command object Discussion Available in v2 and newer.
SetValues64
Set values for 64-bit compare swap operation. Calling this function will make the command object perform 64-bit compare swap transactions on the bus. To perform 32-bit compare swap operations, use the SetValues() call, above.
119
Parameters
self
The value to be written at the address targeted by this command object Discussion Available in v2 and newer.
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted
120
Instance Variables
revision
UInt32 revision;
Interface version.
version
UInt32 version;
Interface version.
121
IOFireWireConfigDirectoryInterface
Declared in
Overview
IOFireWireLib device config ROM browsing interface Represents an interface to the config ROM of a remote device. You can use the methods of this interface to browser the ROM and obtain key values. You can also create additional IOFireWireConfigDirectoryInterface's to represent subdirectories within the ROM.
Tasks
Miscellaneous
GetIndexEntry
(page 124)
GetIndexKey
GetIndexOffset_FWAddress
GetIndexOffset_UInt32
(page 124)
GetIndexType
GetIndexValue_ConfigDirectory
GetIndexValue_Data
(page 125)
122
IOFireWireConfigDirectoryInterface Tasks
GetIndexValue_String
GetIndexValue_UInt32
GetKeyOffset_FWAddress
GetKeySubdirectories
(page 126)
GetKeyType
GetKeyValue_ConfigDirectory
GetKeyValue_Data
GetKeyValue_UInt32
GetNumEntries
GetSubdirectories
GetType
(page 128)
Update
(page 128) Causes the ROM data to be updated through the specified byte offset. This function should not be called in normal usage.
123
Instance Methods
GetIndexEntry
IOReturn ( *GetIndexEntry) ( IOFireWireLibConfigDirectoryRef self, int inIndex, UInt32 *outValue);
GetIndexKey
IOReturn ( *GetIndexKey) ( IOFireWireLibConfigDirectoryRef self, int inIndex, int *key);
GetIndexOffset_FWAddress
IOReturn ( *GetIndexOffset_FWAddress) ( IOFireWireLibConfigDirectoryRef self, int inIndex, FWAddress *outValue);
GetIndexOffset_UInt32
IOReturn ( *GetIndexOffset_UInt32) ( IOFireWireLibConfigDirectoryRef self, int inIndex, UInt32 *outValue);
124
GetIndexType
IOReturn ( *GetIndexType) ( IOFireWireLibConfigDirectoryRef self, int inIndex, IOConfigKeyType *type);
GetIndexValue_ConfigDirectory
IOReturn ( *GetIndexValue_ConfigDirectory) ( IOFireWireLibConfigDirectoryRef self, int inIndex, IOFireWireLibConfigDirectoryRef *outValue, REFIID iid);
GetIndexValue_Data
IOReturn ( *GetIndexValue_Data) ( IOFireWireLibConfigDirectoryRef self, int inIndex, CFDataRef *value);
GetIndexValue_String
IOReturn ( *GetIndexValue_String) ( IOFireWireLibConfigDirectoryRef self, int inIndex, CFStringRef *outValue);
125
GetIndexValue_UInt32
IOReturn ( *GetIndexValue_UInt32) ( IOFireWireLibConfigDirectoryRef self, int inIndex, UInt32 *value);
GetKeyOffset_FWAddress
IOReturn ( *GetKeyOffset_FWAddress) ( IOFireWireLibConfigDirectoryRef self, int inKey, FWAddress *outValue, CFStringRef *text);
GetKeySubdirectories
IOReturn ( *GetKeySubdirectories) ( IOFireWireLibConfigDirectoryRef self, int inKey, io_iterator_t *outIterator);
GetKeyType
IOReturn ( *GetKeyType) ( IOFireWireLibConfigDirectoryRef self, int inKey, IOConfigKeyType *outType);
126
GetKeyValue_ConfigDirectory
IOReturn ( *GetKeyValue_ConfigDirectory) ( IOFireWireLibConfigDirectoryRef self, int inKey, IOFireWireLibConfigDirectoryRef *outValue, REFIID iid, CFStringRef *outText);
GetKeyValue_Data
IOReturn ( *GetKeyValue_Data) ( IOFireWireLibConfigDirectoryRef self, int inKey, CFDataRef *outValue, CFStringRef *outText);
GetKeyValue_UInt32
IOReturn ( *GetKeyValue_UInt32) ( IOFireWireLibConfigDirectoryRef self, int inKey, UInt32 *outValue, CFStringRef *outText);
GetNumEntries
IOReturn ( *GetNumEntries) ( IOFireWireLibConfigDirectoryRef self, int *outNumEntries);
127
GetSubdirectories
IOReturn ( *GetSubdirectories) ( IOFireWireLibConfigDirectoryRef self, io_iterator_t *outIterator);
GetType
IOReturn ( *GetType) ( IOFireWireLibConfigDirectoryRef self, int *outType);
Update
Causes the ROM data to be updated through the specified byte offset. This function should not be called in normal usage.
IOReturn ( *Update) ( IOFireWireLibConfigDirectoryRef self, UInt32 inOffset);
Parameters
self
Offset in bytes indicating length of ROM to be updated. Return Value An IOReturn result code
128
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
129
IOFireWireDCLCommandPoolInterface
Declared in
IOFireWireLibIsoch.h
Overview
Description forthcoming.
Tasks
Miscellaneous
Allocate
AllocateCallProcDCL
AllocateJumpDCL
(page 132) (page 132) (page 133) (page 133) (page 133) (page 134)
AllocateLabelDCL
AllocatePtrTimeStampDCL
AllocateReceiveBufferDCL
AllocateReceivePacketDCL
AllocateReceivePacketStartDCL
130
IOFireWireDCLCommandPoolInterface Tasks
AllocateSendBufferDCL
AllocateSendPacketDCL
AllocateSendPacketStartDCL
AllocateSendPacketWithHeaderStartDCL
AllocateSetTagSyncBitsDCL
AllocateTransferBufferDCL
AllocateTransferPacketDCL
AllocateUpdateDCLListDCL
(page 136)
AllocateWithOpcode
(page 137)
Free
GetBytesRemaining
GetSize
SetSize
131
Instance Methods
Allocate
DCLCommand* ( *Allocate) ( IOFireWireLibDCLCommandPoolRef self, IOByteCount inSize );
AllocateCallProcDCL
DCLCommand* ( *AllocateCallProcDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, DCLCallCommandProc *inProc, DCLCallProcDataType inProcData);
AllocateJumpDCL
DCLCommand* ( *AllocateJumpDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, DCLLabel *pInJumpDCLLabel);
AllocateLabelDCL
DCLCommand* ( *AllocateLabelDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL);
132
AllocatePtrTimeStampDCL
DCLCommand* ( *AllocatePtrTimeStampDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, UInt32 *inTimeStampPtr);
AllocateReceiveBufferDCL
DCLCommand* ( *AllocateReceiveBufferDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, void *inBuffer, IOByteCount inSize, IOByteCount inPacketSize, UInt32 inBufferOffset);
AllocateReceivePacketDCL
DCLCommand* ( *AllocateReceivePacketDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, void *inBuffer, IOByteCount inSize);
133
AllocateReceivePacketStartDCL
DCLCommand* ( *AllocateReceivePacketStartDCL)( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, void *inBuffer, IOByteCount inSize);
AllocateSendBufferDCL
DCLCommand* ( *AllocateSendBufferDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, void *inBuffer, IOByteCount inSize, IOByteCount inPacketSize, UInt32 inBufferOffset);
AllocateSendPacketDCL
DCLCommand* ( *AllocateSendPacketDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, void *inBuffer, IOByteCount inSize);
134
AllocateSendPacketStartDCL
DCLCommand* ( *AllocateSendPacketStartDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, void *inBuffer, IOByteCount inSize);
AllocateSendPacketWithHeaderStartDCL
DCLCommand* ( *AllocateSendPacketWithHeaderStartDCL)( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, void *inBuffer, IOByteCount inSize);
AllocateSetTagSyncBitsDCL
DCLCommand* ( *AllocateSetTagSyncBitsDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, UInt16 inTagBits, UInt16 inSyncBits);
135
AllocateTransferBufferDCL
DCLCommand* ( *AllocateTransferBufferDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, UInt32 inOpcode, void *inBuffer, IOByteCount inSize, IOByteCount inPacketSize, UInt32 inBufferOffset);
AllocateTransferPacketDCL
DCLCommand* ( *AllocateTransferPacketDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, UInt32 inOpcode, void *inBuffer, IOByteCount inSize);
AllocateUpdateDCLListDCL
DCLCommand* ( *AllocateUpdateDCLListDCL) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, DCLCommand **inDCLCommandList, UInt32 inNumCommands);
136
AllocateWithOpcode
IOReturn ( *AllocateWithOpcode) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL, DCLCommand **outDCL, UInt32 opcode, ... );
Free
void ( *Free) ( IOFireWireLibDCLCommandPoolRef self, DCLCommand *inDCL );
GetBytesRemaining
IOByteCount ( *GetBytesRemaining) ( IOFireWireLibDCLCommandPoolRef self );
GetSize
IOByteCount ( *GetSize) ( IOFireWireLibDCLCommandPoolRef self );
137
SetSize
Boolean ( *SetSize) ( IOFireWireLibDCLCommandPoolRef self, IOByteCount inSize );
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
138
IOFireWireDeviceInterface
Declared in
Overview
IOFireWireDeviceInterface is your primary gateway to the functionality contained in IOFireWireLib. You can use IOFireWireDeviceInterface to:
IOFireWireReadCommandInterface IOFireWireReadQuadletCommandInterface IOFireWireWriteCommandInterface IOFireWireWriteQuadletCommandInterface IOFireWireCompareSwapCommandInterface IOFireWirePseudoAddressSpaceInterface -- pseudo address space services IOFireWirePhysicalAddressSpaceInterface -- physical address space services IOFireWireLocalUnitDirectoryInterface -- manage local unit directories in the mac IOFireWireConfigDirectoryInterface -- access and browse remote device config directories IOFireWireIsochChannelInterface -- create/manage talker and listener isoch channels IOFireWireLocalIsochPortInterface -- create local isoch ports IOFireWireRemoteIsochPortInterface -- create remote isoch ports IOFireWireDCLCommandPoolInterface -- create a DCL command pool allocator. perform synchronous read, write and lock operations perform other miscellanous bus operations, such as reset the FireWire bus. create FireWire command objects and interfaces used to perform synchronous/asynchronous read, write and lock operations. These include: create interfaces which provide a other extended services. These include:
139
IOFireWireDeviceInterface Tasks
create interfaces which provide isochronous services (see IOFireWireLibIsoch.h). These include:
Tasks
Miscellaneous
AddCallbackDispatcherToRunLoop
(page 145) Installs the proper run loop event source to allow callbacks to function. This method must be called before callback notifications for this interface or any interfaces created using this interface can function. (page 145) Add a run loop event source to allow IOFireWireLib callbacks to function. (page 146) This function adds an event source for the isochronous callback dispatcher to the specified CFRunLoop. Isochronous related callbacks will not function before this function is called. This functions is similar to AddCallbackDispatcherToRunLoop. The passed CFRunLoop can be different from that passed to AddCallbackDispatcherToRunLoop.
AddCallbackDispatcherToRunLoopForMode
AddIsochCallbackDispatcherToRunLoop(IOFireWireLibDeviceRef, CFRunLoopRef)
147) Add a run loop event source to allow IOFireWireLib isoch callbacks to function.
AddIsochCallbackDispatcherToRunLoopForMode
(page 147) Add a run loop event source to allow IOFireWireLib isoch callbacks to function. (page 148) Attempt to allocate some isochronous bandwidth from the IRM (page 149) Attempt to allocate an isochronous channel from the IRM (page 149) Cause a bus reset (page 150) This function must be called from callback routines once they have completed processing a callback. This function only applies to callbacks which take an IOFireWireLibDeviceRef (i.e. bus reset), parameter. (page 150)
AllocateIRMBandwidthInGeneration
AllocateIRMChannelInGeneration
BusReset
ClientCommandIsComplete
ClipMaxRec2K
Close
140
IOFireWireDeviceInterface Tasks
CompareSwap
(page 151) Perform synchronous lock operation (page 152) Perform synchronous lock operation (page 153) Create a command object for sending Async Stream packets (page 154) Creates a async stream listener object and returns an interface to it. (page 155) Create a quadlet compare/swap command object. (page 156) Create a quadlet compare/swap command object and initialize it with 64-bit values. (page 157) This function can be used to create a config directory object and a corresponding interface from an opaque IOObject reference. Some configuration directory interface methods may return an io_object_t instead of an IOFireWireLibConfigDirectoryRef. Use this function to obtain an IOFireWireLibConfigDirectoryRef from an io_object_t. (page 157) Creates a command pool object and returns an interface to it. The command pool can be used to build DCL programs. (page 158) Creates a pseudo address space in initial units space. (page 160) Attempt to create an IRM allocation that persists accross bus-resets. (page 160) Creates an isochronous channel object and returns an interface to it. An isochronous channel object is an abstract entity used to represent a FireWire isochronous channel. (page 161) Creates a local isochronous port object and returns an interface to it. A local isochronous port object is an abstract entity used to represent a talking or listening endpoint in the local machine. (page 163) Create a local isoch port
CompareSwap64
CreateAsyncStreamCommand
CreateAsyncStreamListener
CreateCompareSwapCommand
CreateCompareSwapCommand64
CreateConfigDirectoryWithIOObject
CreateDCLCommandPool
CreateInitialUnitsPseudoAddressSpace
CreateIRMAllocation
CreateIsochChannel
CreateLocalIsochPort
CreateLocalIsochPortWithOptions
CreateLocalUnitDirectory
(page 164) Creates a local unit directory object and returns an interface to it. An instance of a unit directory object corresponds to an instance of a unit directory in the local machine's configuration ROM.
141
IOFireWireDeviceInterface Tasks
CreateNuDCLPool
(page 164)
CreatePHYCommand
(page 164) Create a command object for sending a PHY packet (page 165) Create a listener object for receiving PHY packets (page 166) Creates a physical address space object and returns an interface to it. This will create a physical address space on the local machine. (page 167) Creates a pseudo address space object and returns an interface to it. This will create a pseudo address space (software-backed) on the local machine. (page 168) Create a block read command object. (page 169) Create a quadlet read command object. (page 171) Creates a remote isochronous port object and returns an interface to it. A remote isochronous port object is an abstract entity used to represent a remote talker or listener device on an isochronous channel. (page 171) Create a vector command object. (page 172) Create a block write command object. (page 173) Create a quadlet write command object. (page 174)
CreatePHYPacketListener
CreatePhysicalAddressSpace
CreatePseudoAddressSpace
CreateReadCommand
CreateReadQuadletCommand
CreateRemoteIsochPort
CreateVectorCommand
CreateWriteCommand
CreateWriteQuadletCommand
FireBugMsg
FireLog
(page 174) Logs string to in-kernel debug buffer (page 174) Get bus and cycle time. (page 175) Get bus generation number.
GetBusCycleTime
GetBusGeneration
142
IOFireWireDeviceInterface Tasks
GetConfigDirectory
(page 176) Creates a config directory object and returns an interface to it. The created config directory object represents the config directory in the remote device or unit to which the creating device interface is attached. (page 176) Get bus cycle time. (page 176) Get bus cycle time and cpu uptime. (page 177)
GetCycleTime
GetCycleTimeAndUpTime
GetDebugProperty
GetDevice
(page 177) Get the IOKit service to which this interface is connected. (page 178) (Obsolete) Get bus generation and remote device node ID. (page 178)
GetGenerationAndNodeID
GetIRMNodeID
GetIsochAsyncPort
(page 178) Returns the notification port used for async and isoch callbacks (page 179) (Obsolete) Get local node ID. (page 179) Get node ID of local machine. (page 180) Get user reference value set on this interface (page 180) Get node ID of device to which this interface is attached. (page 181) Get time since last bus reset. (page 182)
GetLocalNodeID
GetLocalNodeIDWithGeneration
GetRefCon
GetRemoteNodeID
GetResetTime
GetSessionRef
GetSpeedBetweenNodes
(page 182) Get the maximum transfer speed between nodes 'srcNodeID' and 'destNodeID'. (page 183) Get maximum transfer speed to device to which this interface is attached.
GetSpeedToNode
143
IOFireWireDeviceInterface Tasks
InterfaceIsInited
(page 183) Determine whether interface has been properly inited. (page 183) Determine whether callback notifications for this interface are currently active
NotificationIsOn
Open
(page 184) Open the connected device for exclusive access. When you have the device open using this method, all accesses by other clients of this device will be denied until Close() is called. (page 184) An open function which allows this interface to have access to the device when already opened. The service which has already opened the device must be able to provide an IOFireWireSessionRef. (page 185) Walk a DCL program linked list and print its contents
OpenWithSessionRef
PrintDCLProgram
Read
(page 185) Perform synchronous block read (page 186) Perform synchronous quadlet read (page 187) Attempt to release some isochronous bandwidth from the IRM (page 187) Attempt to release an isochronous channel from the IRM (page 188) Reverses the effects of AddCallbackDispatcherToRunLoop(). This method removes the run loop event source that was added to the specified run loop preventing any future callbacks from being called (page 188) Removes an IOFireWireLib-added run loop event source. (page 189) Seize control of device/unit (page 189) Sets the callback that should be called after a bus reset has occurred and reconfiguration of the bus has been completed. This function will only be called once per bus reset. (page 190) Sets the callback that should be called when a bus reset occurs. Note that this callback can be called multiple times before the bus reset done handler is called. (f.ex., multiple bus resets might occur before bus reconfiguration has completed.)
ReadQuadlet
ReleaseIRMBandwidthInGeneration
ReleaseIRMChannelInGeneration
RemoveCallbackDispatcherFromRunLoop
RemoveIsochCallbackDispatcherFromRunLoop
Seize
SetBusResetDoneHandler
SetBusResetHandler
144
SetRefCon
(page 190) Set user reference value on this interface (page 191) Deactivates and callbacks specified for this device interface. Reverses the effects of TurnOnNotification() (page 191) Activates any callbacks specified for this device interface. Only works after AddCallbackDispatcherToRunLoop has been called. See also AddIsochCallbackDispatcherToRunLoop(). (page 191) Perform synchronous block write (page 192) Perform synchronous quadlet write
TurnOffNotification
TurnOnNotification
Write
WriteQuadlet
Instance Methods
AddCallbackDispatcherToRunLoop
Installs the proper run loop event source to allow callbacks to function. This method must be called before callback notifications for this interface or any interfaces created using this interface can function.
const IOReturn ( *AddCallbackDispatcherToRunLoop)( IOFireWireLibDeviceRef self, CFRunLoopRef inRunLoop);
Parameters
self
AddCallbackDispatcherToRunLoopForMode
Add a run loop event source to allow IOFireWireLib callbacks to function.
145
Parameters
self
The run loop mode(s) for which to install the event source Return Value An IOReturn error code. Discussion Installs the proper run loop event source to allow callbacks to function. This method must be called before callback notifications for this interface or any interfaces created using this interface can function. With this function, you can additionally specify for which run loop modes this source should be added. Availability: IOFireWireDeviceInterface_v3, and newer
AddIsochCallbackDispatcherToRunLoop(IOFireWireLibDeviceRef, CFRunLoopRef )
This function adds an event source for the isochronous callback dispatcher to the specified CFRunLoop. Isochronous related callbacks will not function before this function is called. This functions is similar to AddCallbackDispatcherToRunLoop. The passed CFRunLoop can be different from that passed to AddCallbackDispatcherToRunLoop.
IOReturn ( *AddIsochCallbackDispatcherToRunLoop)( IOFireWireLibDeviceRef self, CFRunLoopRef inRunLoop);
Parameters
self
A CFRunLoopRef for the run loop to which the event loop source should be added
146
Parameters
self
A CFRunLoopRef for the run loop to which the event loop source should be added
inRunLoopMode
The run loop mode(s) for which to install the event source Return Value An IOReturn error code. Discussion This function adds an event source for the isochronous callback dispatcher to the specified CFRunLoop. Isochronous related callbacks will not be called unless this function has been called. This function is similar to AddCallbackDispatcherToRunLoop. The passed CFRunLoop can be different from that passed to AddCallbackDispatcherToRunLoop. Availability: IOFireWireDeviceInterface_v3, and newer
AddIsochCallbackDispatcherToRunLoopForMode
Add a run loop event source to allow IOFireWireLib isoch callbacks to function.
147
Parameters
self
A CFRunLoopRef for the run loop to which the event loop source should be added
inRunLoopMode
The run loop mode(s) for which to install the event source Return Value An IOReturn error code. Discussion This function adds an event source for the isochronous callback dispatcher to the specified CFRunLoop. Isochronous related callbacks will not be called unless this function has been called. This function is similar to AddCallbackDispatcherToRunLoop. The passed CFRunLoop can be different from that passed to AddCallbackDispatcherToRunLoop. Availability: IOFireWireDeviceInterface_v3, and newer
AllocateIRMBandwidthInGeneration
Attempt to allocate some isochronous bandwidth from the IRM
IOReturn ( *AllocateIRMBandwidthInGeneration)( IOFireWireLibDeviceRef self, UInt32 bandwidthUnits, UInt32 generation);
Parameters
bandwidthUnits
The bus generation that this allocation attempt is to take place in.
148
Return Value Returns kIOReturnSuccess if bandwidth allocation was successful. Returns kIOFireWireBusReset if 'generation' does not match the current bus generation number. Returns kIOReturnError for any other error (such as the allocation failed) Discussion Attempts to allocates some isochronous bandwidth from the IRM, if the generation matches the current generation. Availability: IOFireWireDeviceInterface_v9 and newer
AllocateIRMChannelInGeneration
Attempt to allocate an isochronous channel from the IRM
IOReturn ( *AllocateIRMChannelInGeneration)( IOFireWireLibDeviceRef self, UInt8 isochChannel, UInt32 generation);
Parameters
isochChannel
The bus generation that this allocation attempt is to take place in. Return Value Returns kIOReturnSuccess if channel allocation was successful. Returns kIOFireWireBusReset if 'generation' does not match the current bus generation number. Returns kIOReturnError for any other error (such as the allocation failed) Discussion Attempts to allocates an isochronous channel from the IRM, if the generation matches the current generation. Availability: IOFireWireDeviceInterface_v9 and newer
BusReset
Cause a bus reset
149
Parameters
self
ClientCommandIsComplete
This function must be called from callback routines once they have completed processing a callback. This function only applies to callbacks which take an IOFireWireLibDeviceRef (i.e. bus reset), parameter.
void ( *ClientCommandIsComplete)( IOFireWireLibDeviceRef self, FWClientCommandID commandID, IOReturn status);
Parameters
commandID
ClipMaxRec2K
IOReturn ( *ClipMaxRec2K)( IOFireWireLibDeviceRef self, Boolean clipMaxRec );
Close
Release exclusive access to the device
150
Parameters
self
CompareSwap
Perform synchronous lock operation
IOReturn ( *CompareSwap)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, UInt32 cmpVal, UInt32 newVal, Boolean failOnReset, UInt32 generation);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported.
addr
Value to set
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing.
151
CompareSwap64
Perform synchronous lock operation
IOReturn ( *CompareSwap64)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, UInt32 *expectedVal, UInt32 *newVal, UInt32 *oldVal, IOByteCount size, Boolean failOnReset, UInt32 generation);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported. If the quadlets stored at 'oldVal' match those passed to 'expectedVal', the lock operation was successful.
addr
Pointer to quadlets to hold value found at target address after transaction if completed.
size
Size in bytes of compare swap transaction to perform. Value values are 4 and 8.
152
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration()
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Return Value An IOReturn error code
CreateAsyncStreamCommand
Create a command object for sending Async Stream packets
IOFireWireLibCommandRef ( *CreateAsyncStreamCommand)( IOFireWireLibDeviceRef self, UInt32 channel, UInt32 sync, UInt32 tag, void *buf, UInt32 size, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid);
Parameters
self
153
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
inRefCon
A user specified reference value. This will be passed to all callback functions.
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created phy packet listener object. Return Value An IOReturn error code
CreateAsyncStreamListener
Creates a async stream listener object and returns an interface to it.
IOFWAsyncStreamListenerInterfaceRef ( *CreateAsyncStreamListener)( IOFireWireLibDeviceRef self, UInt32 channel, IOFWAsyncStreamListenerHandler callback, void *inRefCon, UInt32 inQueueBufferSize, REFIID iid);
Parameters
self
A user specified reference value. This will be passed to all callback functions.
inQueueBufferSize
The size of the queue which receives packets from the bus before they are handed to the client. A larger queue can help eliminate dropped packets when receiving large bursts of data. When a packet is received which can not fit into the queue, the packet dropped callback will be called.
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created ayns stream listener object.
154
CreateCompareSwapCommand
Create a quadlet compare/swap command object.
IOFireWireLibCommandRef ( *CreateCompareSwapCommand)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, UInt32 cmpVal, UInt32 newVal, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported. Setting the callback value to nil defaults to synchronous execution.
addr
Command completion callback. Setting the callback value to nil defaults to synchronous execution.
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
155
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOFireWireLibCommandRef interface. See IOFireWireLibCommandRef.
CreateCompareSwapCommand64
Create a quadlet compare/swap command object and initialize it with 64-bit values.
IOFireWireLibCommandRef ( *CreateCompareSwapCommand64)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, UInt64 cmpVal, UInt64 newVal, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported. Setting the callback value to nil defaults to synchronous execution.
addr
156
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration()
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Return Value An IOFireWireLibCommandRef interface. See IOFireWireLibCommandRef.
CreateConfigDirectoryWithIOObject
This function can be used to create a config directory object and a corresponding interface from an opaque IOObject reference. Some configuration directory interface methods may return an io_object_t instead of an IOFireWireLibConfigDirectoryRef. Use this function to obtain an IOFireWireLibConfigDirectoryRef from an io_object_t.
IOFireWireLibConfigDirectoryRef ( *CreateConfigDirectoryWithIOObject)( IOFireWireLibDeviceRef self, io_object_t inObject, REFIID iid);
Parameters
self
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created config directory object. Return Value An IOFireWireLibConfigDirectoryRef. Returns 0 upon failure
CreateDCLCommandPool
Creates a command pool object and returns an interface to it. The command pool can be used to build DCL programs.
157
Parameters
self
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created object. Return Value An IOFireWireLibDCLCommandPoolRef. Returns 0 upon failure
CreateInitialUnitsPseudoAddressSpace
Creates a pseudo address space in initial units space.
IOFireWireLibPseudoAddressSpaceRef ( *CreateInitialUnitsPseudoAddressSpace)( IOFireWireLibDeviceRef self, UInt32 inAddressLo, UInt32 inSize, void *inRefCon, UInt32 inQueueBufferSize, void *inBackingStore, UInt32 inFlags, REFIID iid);
Parameters
self
The lower 32 bits of the base address of the address space to be created. The address is always in initial units space.
inSize
A user specified reference value. This will be passed to all callback functions.
158
inQueueBufferSize
The size of the queue which receives packets from the bus before they are handed to the client and/or put in the backing store. A larger queue can help eliminate dropped packets when receiving large bursts of data. When a packet is received which can not fit into the queue, the packet dropped callback will be called.
inBackingStore
An optional block of allocated memory representing the contents of the address space. This memory block must be of size inSize.
inFlags
A UInt32 with bits set corresponding to the flags that should be set for this address space.
kFWAddressSpaceNoFlags -- All flags off kFWAddressSpaceNoWriteAccess -- Write access to this address space will be disallowed. Setting this flag also disables compare/swap transactions on this address space. kFWAddressSpaceNoReadAccess -- Read access access to this address space will be disallowed. Setting this flag also disables compare/swap transactions on this address space. kFWAddressSpaceAutoWriteReply -- Writes will be made automatically, directly modifying the contents of the backing store. The user process will not be notified of writes. kFWAddressSpaceAutoReadReply -- Reads to this address space will be answered automagically using the contents of the backing store. The user process will not be notified of reads. kFWAddressSpaceAutoCopyOnWrite -- Writes to this address space will be made directly to the backing store at the same time the user process is notified of a write. Clients will only be notified of a write if kFWAddressSpaceAutoWriteReply is not set. kFWAddressSpaceShareIfExists -- Allows creation of this address space even if another client already has an address space at the requested address. All clients will be notified of writes to covered addresses. kFWAddressSpaceExclusive -- Ensures that the allocation of this address space will fail if any portion of this address range is already allocated. If the allocation is successful this flag ensures that any future allocations overlapping this range will fail even if allocted with kFWAddressSpaceShareIfExists.
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created pseudo address space object. Return Value An IOFireWireLibPseudoAddressSpaceRef. Returns 0 upon failure
159
Discussion Creates a pseudo address space object in initial units space and returns an interface to it. This will create a pseudo address space (software-backed) on the local machine. Availablilty: IOFireWireDeviceInterface_v3, and newer
CreateIRMAllocation
Attempt to create an IRM allocation that persists accross bus-resets.
IOFireWireLibIRMAllocationRef ( *CreateIRMAllocation)( IOFireWireLibDeviceRef self, Boolean releaseIRMResourcesOnFree, IOFireWireLibIRMAllocationLostNotificationProc callback, void *pLostNotificationProcRefCon, REFIID iid);
Parameters
releaseIRMResourcesOnFree
Specify whether or not the IRM resources shall be released when the IOFireWireLibIRMAllocation is destroyed. Can be overrided later.
callback
The handler to notify clients of failure to reclaim IRM resources after bus-reset.
pLostNotificationProcRefCon
The refCon passed with the callback. Return Value Returns a pointer to the newly created IRM allocation object, if successful, NULL otherwise. Discussion Create an IOFireWireIRMAllocation object, which can be used to allocate IRM resources, and will reallocate automatically after bus-resets (if possible). Availability: IOFireWireDeviceInterface_v9 and newer
CreateIsochChannel
Creates an isochronous channel object and returns an interface to it. An isochronous channel object is an abstract entity used to represent a FireWire isochronous channel.
160
IOFireWireLibIsochChannelRef ( *CreateIsochChannel)( IOFireWireLibDeviceRef self, Boolean doIrm, UInt32 packetSize, IOFWSpeed prefSpeed, REFIID iid );
Parameters
self
Controls whether the channel automatically performs IRM operations. Pass true if the channel should allocate its channel and bandwidth with the IRM. Pass false to ignore the IRM.
packetSize
Size of payload in bytes of packets being sent or received with this channel, excluding headers. This is automatically translated into a bandwidth allocation appropriate for the speed passed in prefSpeed.
prefSpeed
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created object. Return Value An IOFireWireLibIsochChannelRef. Returns 0 upon failure
CreateLocalIsochPort
Creates a local isochronous port object and returns an interface to it. A local isochronous port object is an abstract entity used to represent a talking or listening endpoint in the local machine.
161
IOFireWireLibLocalIsochPortRef ( *CreateLocalIsochPort)( IOFireWireLibDeviceRef self, Boolean inTalking, DCLCommand *inDCLProgram, UInt32 inStartEvent, UInt32 inStartState, UInt32 inStartMask, IOVirtualRange inDCLProgramRanges[], // optional optimization parameters UInt32 inDCLProgramRangeCount, IOVirtualRange inBufferRanges[], UInt32 inBufferRangeCount, REFIID iid);
Parameters
self
Pass true if this port represents an isochronous talker. Pass false if this port represents an isochronous listener.
inDCLProgram
A pointer to the first DCL command struct of the DCL program to be compiled and used to send or receive data on this port.
inStartEvent
Start state bits. For kFWDCLCycleEvent specifies the cycle to start the DMA on. For kFWDCLSyBitsEvent specifies the packet sync field value for the first packet to receive.
inStartMask
Start mask bits. For kFWDCLCycleEvent specifies a mask for the start cycle: the DMA will start when currentCycle & inStartMask == inStartEvent & inStartMask. For kFWDCLSyBitsEvent specifies a mask for the sync field: the DMA will start when packet sync == inStartEvent & inStartMask.
inDCLProgramRanges
This is an optional optimization parameter which can be used to decrease the time the local port object spends determining which set of virtual ranges the passed DCL program occupies. Pass a pointer to an array of IOVirtualRange structs or nil to ignore this parameter.
inDCLProgramRangeCount
162
inBufferRanges
This is an optional optimization parameter which can be used to decrease the time the local port object spends determining which set of virtual ranges the data buffers referenced by the passed DCL program occupy. Pass a pointer to an array of IOVirtualRange structs or nil to ignore this parameter.
inBufferRangeCount
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created object. Return Value An IOFireWireLibLocalIsochPortRef. Returns 0 upon failure
CreateLocalIsochPortWithOptions
Create a local isoch port
IOFireWireLibLocalIsochPortRef ( *CreateLocalIsochPortWithOptions)( IOFireWireLibDeviceRef self, Boolean inTalking, DCLCommand *dclProgram, UInt32 startEvent, UInt32 startState, UInt32 startMask, IOVirtualRange dclProgramRanges[], // optional optimization parameters UInt32 dclProgramRangeCount, IOVirtualRange bufferRanges[], UInt32 bufferRangeCount, IOFWIsochPortOptions options, REFIID iid);
Parameters
options
Currently supported options are 'kFWIsochPortUseSeparateKernelThread'. If this option is used, a separate kernel thread will be created to handle interrupt processing for this port only. Pass 'kFWIsochPortDefaultOptions' for no options. Return Value Returns kIOReturnSuccess if a valid speed has been returned in 'outSpeed'. Returns kIOFireWireBusReset if 'checkGeneration' does not match the current bus generation number.
163
Discussion Same as CreateLocalIsochPort(), above, but allows additional options to be passed. Availability: IOFireWireDeviceInterface_v8 and newer
CreateLocalUnitDirectory
Creates a local unit directory object and returns an interface to it. An instance of a unit directory object corresponds to an instance of a unit directory in the local machine's configuration ROM.
IOFireWireLibLocalUnitDirectoryRef ( *CreateLocalUnitDirectory)( IOFireWireLibDeviceRef self, REFIID iid);
Parameters
self
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created unit directory object. Return Value An IOFireWireLibLocalUnitDirectoryRef. Returns 0 upon failure
CreateNuDCLPool
IOFireWireLibNuDCLPoolRef ( *CreateNuDCLPool)( IOFireWireLibDeviceRef self, UInt32 capacity, REFIID iid );
CreatePHYCommand
Create a command object for sending a PHY packet
164
IOFireWireLibCommandRef ( *CreatePHYCommand)( IOFireWireLibDeviceRef self, UInt32 data1, UInt32 data2, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid );
Parameters
self
completion callback
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration()
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false.
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created phy command object. Return Value An IOReturn error code
CreatePHYPacketListener
Create a listener object for receiving PHY packets
165
Parameters
self
The maximum queue size to use to buffer phy packets between kernel and user space
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created phy packet listener object. Return Value An IOReturn error code
CreatePhysicalAddressSpace
Creates a physical address space object and returns an interface to it. This will create a physical address space on the local machine.
IOFireWireLibPhysicalAddressSpaceRef ( *CreatePhysicalAddressSpace)( IOFireWireLibDeviceRef self, UInt32 inSize, void *inBackingStore, UInt32 inFlags, REFIID iid);
Parameters
self
A UInt32 with bits set corresponding to the flags that should be set for this address space. For future use -- always pass 0.
166
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created physical address space object. Return Value An IOFireWireLibPhysicalAddressSpaceRef. Returns 0 upon failure
CreatePseudoAddressSpace
Creates a pseudo address space object and returns an interface to it. This will create a pseudo address space (software-backed) on the local machine.
IOFireWireLibPseudoAddressSpaceRef ( *CreatePseudoAddressSpace)( IOFireWireLibDeviceRef self, UInt32 inSize, void *inRefCon, UInt32 inQueueBufferSize, void *inBackingStore, UInt32 inFlags, REFIID iid);
Parameters
self
A user specified reference value. This will be passed to all callback functions.
inQueueBufferSize
The size of the queue which receives packets from the bus before they are handed to the client and/or put in the backing store. A larger queue can help eliminate dropped packets when receiving large bursts of data. When a packet is received which can not fit into the queue, the packet dropped callback will be called.
inBackingStore
An optional block of allocated memory representing the contents of the address space. This memory block must be of size inSize.
167
inFlags
A UInt32 with bits set corresponding to the flags that should be set for this address space.
kFWAddressSpaceNoFlags -- All flags off kFWAddressSpaceNoWriteAccess -- Write access to this address space will be disallowed. Setting this flag also disables compare/swap transactions on this address space. kFWAddressSpaceNoReadAccess -- Read access access to this address space will be disallowed. Setting this flag also disables compare/swap transactions on this address space. kFWAddressSpaceAutoWriteReply -- Writes will be made automatically, directly modifying the contents of the backing store. The user process will not be notified of writes. kFWAddressSpaceAutoReadReply -- Reads to this address space will be answered automagically using the contents of the backing store. The user process will not be notified of reads. kFWAddressSpaceAutoCopyOnWrite -- Writes to this address space will be made directly to the backing store at the same time the user process is notified of a write.
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created pseudo address space object. Return Value An IOFireWireLibPseudoAddressSpaceRef. Returns 0 upon failure
CreateReadCommand
Create a block read command object.
IOFireWireLibCommandRef ( *CreateReadCommand)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, void *buf, UInt32 size, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid);
Parameters
self
168
device
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported. Setting the callback value to nil defaults to synchronous execution.
addr
Command completion callback. Setting the callback value to nil defaults to synchronous execution.
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOFireWireLibCommandRef interface. See IOFireWireLibCommandRef.
CreateReadQuadletCommand
Create a quadlet read command object.
169
IOFireWireLibCommandRef ( *CreateReadQuadletCommand)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, UInt32 quads[], UInt32 numQuads, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported. Setting the callback value to nil defaults to synchronous execution.
addr
Command completion callback. Setting the callback value to nil defaults to synchronous execution.
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOFireWireLibCommandRef interface. See IOFireWireLibCommandRef.
170
CreateRemoteIsochPort
Creates a remote isochronous port object and returns an interface to it. A remote isochronous port object is an abstract entity used to represent a remote talker or listener device on an isochronous channel.
IOFireWireLibRemoteIsochPortRef ( *CreateRemoteIsochPort)( IOFireWireLibDeviceRef self, Boolean inTalking, REFIID iid);
Parameters
self
Pass true if this port represents an isochronous talker. Pass false if this port represents an isochronous listener.
iid
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created remote isochronous port object. Return Value An IOFireWireLibRemoteIsochPortRef. Returns 0 upon failure
CreateVectorCommand
Create a vector command object.
IOFireWireLibVectorCommandRef ( *CreateVectorCommand)( IOFireWireLibDeviceRef self, IOFireWireLibCommandCallback callback, void *inRefCon, REFIID iid);
Parameters
self
Command completion callback. Setting the callback value to nil defaults to synchronous execution.
inRefCon
171
CreateWriteCommand
Create a block write command object.
IOFireWireLibCommandRef ( *CreateWriteCommand)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, void *buf, UInt32 size, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported. Setting the callback value to nil defaults to synchronous execution.
addr
Command completion callback. Setting the callback value to nil defaults to synchronous execution.
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
172
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOFireWireLibCommandRef interface. See IOFireWireLibCommandRef.
CreateWriteQuadletCommand
Create a quadlet write command object.
IOFireWireLibCommandRef ( *CreateWriteQuadletCommand)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, UInt32 quads[], UInt32 numQuads, IOFireWireLibCommandCallback callback, Boolean failOnReset, UInt32 generation, void *inRefCon, REFIID iid);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported. Setting the callback value to nil defaults to synchronous execution.
addr
Command completion callback. Setting the callback value to nil defaults to synchronous execution.
173
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOFireWireLibCommandRef interface. See IOFireWireLibCommandRef.
FireBugMsg
IOReturn ( *FireBugMsg)( IOFireWireLibDeviceRef self, const char *msg);
FireLog
Logs string to in-kernel debug buffer
IOReturn ( *FireLog)( IOFireWireLibDeviceRef self, const char *format, ... );
Parameters
self
GetBusCycleTime
Get bus and cycle time.
174
Parameters
self
A pointer to a UInt32 to hold the cycle time Return Value An IOReturn error code.
GetBusGeneration
Get bus generation number.
IOReturn ( *GetBusGeneration)( IOFireWireLibDeviceRef self, UInt32 *outGeneration );
Parameters
self
A pointer to a UInt32 to hold the bus generation number Return Value Returns kIOReturnSuccess if a valid bus generation has been returned in 'outGeneration'. Discussion The bus generation number stays constant between bus resets and can be used in combination with a FireWire node ID to uniquely identify nodes on the bus. Pass the generation number to functions that take or return FireWire node IDs. Availability: IOFireWireDeviceInterface_v4 and newer
175
GetConfigDirectory
Creates a config directory object and returns an interface to it. The created config directory object represents the config directory in the remote device or unit to which the creating device interface is attached.
IOFireWireLibConfigDirectoryRef ( *GetConfigDirectory)( IOFireWireLibDeviceRef self, REFIID iid);
Parameters
self
An ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created config directory object. Return Value An IOFireWireLibConfigDirectoryRef which should be released using Release(). Returns 0 upon failure.
GetCycleTime
Get bus cycle time.
IOReturn ( *GetCycleTime)( IOFireWireLibDeviceRef self, UInt32 *outCycleTime);
Parameters
self
A pointer to a UInt32 to hold the result Return Value An IOReturn error code.
GetCycleTimeAndUpTime
Get bus cycle time and cpu uptime.
176
Parameters
self
A pointer to a UInt64 to hold the result Return Value An IOReturn error code.
GetDebugProperty
CFTypeRef ( *GetDebugProperty)( IOFireWireLibDeviceRef self, void *interface, CFStringRef inPropertyName, CFTypeID *outPropertyType);
GetDevice
Get the IOKit service to which this interface is connected.
io_object_t ( *GetDevice)( IOFireWireLibDeviceRef self);
Parameters
self
The device interface to use. Return Value Returns an io_object_t corresponding to the device the interface is using
177
GetGenerationAndNodeID
(Obsolete) Get bus generation and remote device node ID.
IOReturn ( *GetGenerationAndNodeID)( IOFireWireLibDeviceRef self, UInt32 *outGeneration, UInt16 *outNodeID);
Parameters
self
A pointer to a UInt16 to hold the remote device node ID Return Value An IOReturn error code. Discussion Obsolete -- Please use GetBusGeneration() and/or GetRemoteNodeID() in interface v4.
GetIRMNodeID
IOReturn ( *GetIRMNodeID)( IOFireWireLibDeviceRef self, UInt32 checkGeneration, UInt16 *outIRMNodeID );
GetIsochAsyncPort
Returns the notification port used for async and isoch callbacks
178
Parameters
self
The device interface to use. Return Value Returns the mach_port used for notifications Discussion If necessary GetIsochAsyncPort will allocate the port. Availability: IOFireWireDeviceInterface_v9 and newer
GetLocalNodeID
(Obsolete) Get local node ID.
IOReturn ( *GetLocalNodeID)( IOFireWireLibDeviceRef self, UInt16 *outLocalNodeID);
Parameters
self
A pointer to a UInt16 to hold the local device node ID Return Value An IOReturn error code. Discussion Obsolete -- Please use GetBusGeneration() and GetLocalNodeIDWithGeneration() in interface v4.
GetLocalNodeIDWithGeneration
Get node ID of local machine.
179
Parameters
self
A pointer to a UInt16 to hold the node ID of the local machine. Return Value Returns kIOReturnSuccess if a valid nodeID has been returned in 'outLocalNodeID'. Returns kIOFireWireBusReset if 'checkGeneration' does not match the current bus generation number. Discussion Use this function instead of GetLocalNodeID(). Availability: IOFireWireDeviceInterface_v4 and newer
GetRefCon
Get user reference value set on this interface
void* ( *GetRefCon)( IOFireWireLibDeviceRef self);
Parameters
self
The device interface to use. Return Value Returns the user's reference value set on this interface.
GetRemoteNodeID
Get node ID of device to which this interface is attached.
180
Parameters
self
A pointer to a UInt16 to hold the node ID of the remote device. Return Value Returns kIOReturnSuccess if a valid nodeID has been returned in 'outRemoteNodeID'. Returns kIOFireWireBusReset if 'checkGeneration' does not match the current bus generation number. Discussion Availability: IOFireWireDeviceInterface_v4 and newer
GetResetTime
Get time since last bus reset.
IOReturn ( *GetResetTime)( IOFireWireLibDeviceRef self, AbsoluteTime *outResetTime);
Parameters
self
A pointer to an AbsolutTime to hold the result. Return Value An IOReturn error code.
181
GetSessionRef
IOFireWireSessionRef ( *GetSessionRef)( IOFireWireLibDeviceRef self );
GetSpeedBetweenNodes
Get the maximum transfer speed between nodes 'srcNodeID' and 'destNodeID'.
IOReturn ( *GetSpeedBetweenNodes)( IOFireWireLibDeviceRef self, UInt32 checkGeneration, UInt16 srcNodeID, UInt16 destNodeID, IOFWSpeed *outSpeed);
Parameters
self
A pointer to an IOFWSpeed to hold the maximum transfer speed between node 'srcNodeID' and 'destNodeID'. Return Value Returns kIOReturnSuccess if a valid speed has been returned in 'outSpeed'. Returns kIOFireWireBusReset if 'checkGeneration' does not match the current bus generation number. Discussion Availability: IOFireWireDeviceInterface_v4 and newer
182
GetSpeedToNode
Get maximum transfer speed to device to which this interface is attached.
IOReturn ( *GetSpeedToNode)( IOFireWireLibDeviceRef self, UInt32 checkGeneration, IOFWSpeed *outSpeed);
Parameters
self
A pointer to an IOFWSpeed to hold the maximum speed to the remote device. Return Value Returns kIOReturnSuccess if a valid speed has been returned in 'outSpeed'. Returns kIOFireWireBusReset if 'checkGeneration' does not match the current bus generation number. Discussion Availability: IOFireWireDeviceInterface_v4 and newer
InterfaceIsInited
Determine whether interface has been properly inited.
Boolean ( *InterfaceIsInited)( IOFireWireLibDeviceRef self);
Parameters
self
The device interface to use. Return Value Returns true if interface is inited and false if is it not.
NotificationIsOn
Determine whether callback notifications for this interface are currently active
183
Parameters
self
The device interface to use Return Value A Boolean value where true indicates notifications are active
Open
Open the connected device for exclusive access. When you have the device open using this method, all accesses by other clients of this device will be denied until Close() is called.
IOReturn ( *Open)( IOFireWireLibDeviceRef self);
Parameters
self
OpenWithSessionRef
An open function which allows this interface to have access to the device when already opened. The service which has already opened the device must be able to provide an IOFireWireSessionRef.
IOReturn ( *OpenWithSessionRef)( IOFireWireLibDeviceRef self, IOFireWireSessionRef sessionRef);
Parameters
self
The sessionRef returned from the client who has the device open Return Value An IOReturn error code
184
PrintDCLProgram
Walk a DCL program linked list and print its contents
void ( *PrintDCLProgram)( IOFireWireLibDeviceRef self, const DCLCommand *inProgram, UInt32 inLength);
Parameters
self
Number of DCLs expected in the program. PrintDCLProgram() will report an error if this number does not match the number of DCLs found in the program.
Read
Perform synchronous block read
IOReturn ( *Read)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, void *buf, UInt32 *size, Boolean failOnReset, UInt32 generation);
Parameters
self
The service (representing an attached FireWire device) to read. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported.
addr
185
size
Pass true if the command should only be executed during the FireWire bus generation specified in generation. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOReturn error code
ReadQuadlet
Perform synchronous quadlet read
IOReturn ( *ReadQuadlet)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, UInt32 *val, Boolean failOnReset, UInt32 generation);
Parameters
self
The service (representing an attached FireWire device) to read. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported.
addr
186
failOnReset
Pass true if the command should only be executed during the FireWire bus generation specified in generation. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration()
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOReturn error code
ReleaseIRMBandwidthInGeneration
Attempt to release some isochronous bandwidth from the IRM
IOReturn ( *ReleaseIRMBandwidthInGeneration)( IOFireWireLibDeviceRef self, UInt32 bandwidthUnits, UInt32 generation);
Parameters
bandwidthUnits
The bus generation that this release attempt is to take place in. Return Value Returns kIOReturnSuccess if bandwidth release was successful. Returns kIOFireWireBusReset if 'generation' does not match the current bus generation number. Returns kIOReturnError for any other error (such as the allocation failed) Discussion Attempts to release some isochronous bandwidth from the IRM, if the generation matches the current generation. Availability: IOFireWireDeviceInterface_v9 and newer
ReleaseIRMChannelInGeneration
Attempt to release an isochronous channel from the IRM
187
Parameters
isochChannel
The bus generation that this release attempt is to take place in. Return Value Returns kIOReturnSuccess if channel relase was successful. Returns kIOFireWireBusReset if 'generation' does not match the current bus generation number. Returns kIOReturnError for any other error (such as the allocation failed) Discussion Attempts to release an isochronous channel from the IRM, if the generation matches the current generation. Availability: IOFireWireDeviceInterface_v9 and newer
RemoveCallbackDispatcherFromRunLoop
Reverses the effects of AddCallbackDispatcherToRunLoop(). This method removes the run loop event source that was added to the specified run loop preventing any future callbacks from being called
const void ( *RemoveCallbackDispatcherFromRunLoop)( IOFireWireLibDeviceRef self);
Parameters
self
RemoveIsochCallbackDispatcherFromRunLoop
Removes an IOFireWireLib-added run loop event source.
void ( *RemoveIsochCallbackDispatcherFromRunLoop)( IOFireWireLibDeviceRef self);
Parameters
self
188
Discussion Reverses the effects of AddIsochCallbackDispatcherToRunLoop(). This method removes the run loop event source that was added to the specified run loop preventing any future callbacks from being called. Availability: IOFireWireDeviceInterface_v3, and newer
Seize
Seize control of device/unit
IOReturn ( *Seize)( IOFireWireLibDeviceRef self, IOOptionBits inFlags, ... );
Parameters
self
Reserved for future use. Set to NULL. Description forthcoming? Discussion Allows a user space client to seize control of an in-kernel service even if that service has been Opened() by another client or in-kernel driver. This function should be used with care. Admin rights are required to use this function. Calling this method makes it appear to all other drivers that the device has been unplugged. Open() should be called after this method has been invoked. When access is complete, Close() and then IOServiceRequestProbe() should be called to restore normal operation. Calling IOServiceRequestProbe() makes it appear that the device has been "re-plugged."
SetBusResetDoneHandler
Sets the callback that should be called after a bus reset has occurred and reconfiguration of the bus has been completed. This function will only be called once per bus reset.
189
Parameters
self
Function pointer to the handler to install Return Value Returns on IOFireWireBusResetDoneHandler function pointer to the previously installed bus reset handler. Returns 0 if none was set.
SetBusResetHandler
Sets the callback that should be called when a bus reset occurs. Note that this callback can be called multiple times before the bus reset done handler is called. (f.ex., multiple bus resets might occur before bus reconfiguration has completed.)
const IOFireWireBusResetHandler ( *SetBusResetHandler)( IOFireWireLibDeviceRef self, IOFireWireBusResetHandler handler);
Parameters
self
Function pointer to the handler to install Return Value Returns an IOFireWireBusResetHandler function pointer to the previously installed bus reset handler. Returns 0 if none was set.
SetRefCon
Set user reference value on this interface
190
Parameters
self
TurnOffNotification
Deactivates and callbacks specified for this device interface. Reverses the effects of TurnOnNotification()
void ( *TurnOffNotification)( IOFireWireLibDeviceRef self);
Parameters
self
TurnOnNotification
Activates any callbacks specified for this device interface. Only works after AddCallbackDispatcherToRunLoop has been called. See also AddIsochCallbackDispatcherToRunLoop().
const Boolean ( *TurnOnNotification)( IOFireWireLibDeviceRef self);
Parameters
self
The device interface to use. Return Value A Boolean value. Returns true on success.
Write
Perform synchronous block write
191
IOReturn ( *Write)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, const void *buf, UInt32 *size, Boolean failOnReset, UInt32 generation);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported.
addr
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOReturn error code
WriteQuadlet
Perform synchronous quadlet write
192
IOReturn ( *WriteQuadlet)( IOFireWireLibDeviceRef self, io_object_t device, const FWAddress *addr, const UInt32 val, Boolean failOnReset, UInt32 generation);
Parameters
self
The service (representing an attached FireWire device) to which to write. For 48-bit, device relative addressing, pass the service used to create the device interface. This can be obtained by calling GetDevice(). For 64-bit absolute addressing, pass 0. Other values are unsupported.
addr
Pass true if the command should only be executed during the FireWire bus generation specified in 'generation'. Pass false to ignore the generation parameter. The generation can be obtained by calling GetBusGeneration(). Must be 'true' when using 64-bit addressing.
generation
The FireWire bus generation during which the command should be executed. Ignored if failOnReset is false. Must be a valid generation number when using 64-bit absolute addressing. Return Value An IOReturn error code
Instance Variables
revision
UInt32 revision; // version/revision
Interface revision
193
version
UInt32 version;
Interface version
194
IOFireWireIsochChannelInterface
Declared in
IOFireWireLibIsoch.h
Overview
FireWire user client isochronous channel object. IOFireWireIsochChannelInterface is an abstract representataion of a FireWire bus isochronous channel. This interface coordinates starting and stopping traffic on a FireWire bus isochronous channel and can optionally communicate with the IRM to automatically allocate bandwidth and channel numbers. When using automatic IRM allocation, the channel interface reallocates its bandwidth and channel reservation after each bus reset. Isochronous port interfaces representing FireWire isochronous talkers and listeners must be added to the channel using SetTalker() and AddListener()
Tasks
Miscellaneous
AddListener
(page 196) Modify the transfer size of a transfer packet DCL (send or receive) (page 197) Prepare all hardware to begin sending or receiving isochronous data. (page 197)
AllocateChannel
ClientCommandIsComplete
GetRefCon
(page 197) Set reference value associated with this channel. (page 198)
NotificationIsOn
195
ReleaseChannel
(page 198) Release all hardware after stopping the isochronous channel. (page 198) Set the channel force stop handler. (page 199) Set reference value associated with this channel. (page 199) Set the talker port for this channel. (page 200) Start the channel.
SetChannelForceStopHandler
SetRefCon
SetTalker
Start
Stop
TurnOffNotification
TurnOnNotification
(page 201)
Instance Methods
AddListener
Modify the transfer size of a transfer packet DCL (send or receive)
IOReturn ( *AddListener) ( IOFireWireLibIsochChannelRef self, IOFireWireLibIsochPortRef listener );
Parameters
self
196
Discussion Allows you to modify transfer packet DCLs after they have been compiled and while the DCL program is still running. The transfer size can be set to any size less than or equal to the size set when the DCL program was compiled (including 0). Availability: IOFireWireLocalIsochPortInterface_v3 and newer.
AllocateChannel
Prepare all hardware to begin sending or receiving isochronous data.
IOReturn ( *AllocateChannel) ( IOFireWireLibIsochChannelRef self );
Parameters
self
The isoch channel interface to use. Return Value Returns an IOReturn error code. Discussion Calling this function will result in all listener and talker ports on this isochronous channel having their AllocatePort method called.
ClientCommandIsComplete
void ( *ClientCommandIsComplete) ( IOFireWireLibIsochChannelRef self, FWClientCommandID commandID, IOReturn status);
GetRefCon
Set reference value associated with this channel.
197
Parameters
self
The isoch channel interface to use. Discussion Retrieve the reference value with SetRefCon()
NotificationIsOn
Boolean ( *NotificationIsOn) ( IOFireWireLibIsochChannelRef self);
ReleaseChannel
Release all hardware after stopping the isochronous channel.
IOReturn ( *ReleaseChannel) ( IOFireWireLibIsochChannelRef self );
Parameters
self
The isoch channel interface to use. Return Value Returns an IOReturn error code. Discussion Calling this function will result in all listener and talker ports on this isochronous channel having their ReleasePort method called.
SetChannelForceStopHandler
Set the channel force stop handler.
198
Parameters
self
The handler to set. Return Value Returns the previously set handler or NULL is no handler was set. Discussion The specified callback is called when the channel is stopped and cannot be restarted automatically.
SetRefCon
Set reference value associated with this channel.
void ( *SetRefCon) ( IOFireWireLibIsochChannelRef self, void *stopProcRefCon);
Parameters
self
The new reference value. Discussion Retrieve the reference value with GetRefCon()
SetTalker
Set the talker port for this channel.
199
Parameters
self
Start
Start the channel.
IOReturn ( *Start) ( IOFireWireLibIsochChannelRef self );
Parameters
self
The isoch channel interface to use. Return Value Returns an IOReturn error code. Discussion Calling this function will result in all listener and talker ports on this isochronous channel having their Start method called.
Stop
Stop the channel.
IOReturn ( *Stop) ( IOFireWireLibIsochChannelRef self );
Parameters
self
200
Return Value Returns an IOReturn error code. Discussion Calling this function will result in all listener and talker ports on this isochronous channel having their Stop method called.
TurnOffNotification
void ( *TurnOffNotification) ( IOFireWireLibIsochChannelRef self);
TurnOnNotification
Boolean ( *TurnOnNotification) ( IOFireWireLibIsochChannelRef self);
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
201
IOFireWireIsochPortInterface
Declared in
IOFireWireLibIsoch.h
Overview
FireWire user client isochronous port interface Isochronous ports represent talkers or listeners on a FireWire isochronous channel. This is a base class containing all isochronous port functionality not specific to any type of port. Ports are added to channel interfaces (IOFireWireIsochChannelInterface) which coordinate the start and stop of isochronous traffic on a FireWire bus isochronous channel.
Tasks
Miscellaneous
AllocatePort
(page 203) The method is called when the port should configure its associated hardware to prepare to send or receive isochronous data on the channel number and at the speed specified. (page 203) Get reference value associated with this port. (page 204) The method is called to determine which FireWire isochronous channels and speed this port supports. (page 204) The method is called to release the hardware after the channel has been stopped. (page 205) Set reference value associated with this port. (page 205) The method is called when the port is to begin talking or listening.
GetRefCon
GetSupported
ReleasePort
SetRefCon
Start
202
Stop
(page 206) The method is called when the port is to stop talking or listening.
Instance Methods
AllocatePort
The method is called when the port should configure its associated hardware to prepare to send or receive isochronous data on the channel number and at the speed specified.
IOReturn ( *AllocatePort) ( IOFireWireLibIsochPortRef self, IOFWSpeed speed, UInt32 chan );
Parameters
self
Channel speed
chan
Channel number (-63) Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
GetRefCon
Get reference value associated with this port.
void* ( *GetRefCon) ( IOFireWireLibIsochPortRef self);
Parameters
self
203
Return Value The port refcon value. Discussion Set the reference value with SetRefCon()
GetSupported
The method is called to determine which FireWire isochronous channels and speed this port supports.
IOReturn ( *GetSupported) ( IOFireWireLibIsochPortRef self, IOFWSpeed *maxSpeed, UInt64 *chanSupported );
Parameters
self
A pointer to an IOFWSpeed which should be filled with the maximum speed this port can talk or listen.
chanSupported
A pointer to a UInt64 which should be filled with a bitmask representing the FireWire bus isochonous channels on which the port can talk or listen. Set '1' for supported, '' for unsupported. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
ReleasePort
The method is called to release the hardware after the channel has been stopped.
IOReturn ( *ReleasePort) ( IOFireWireLibIsochPortRef self );
Parameters
self
204
Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
SetRefCon
Set reference value associated with this port.
void ( *SetRefCon) ( IOFireWireLibIsochPortRef self, void *inRefCon);
Parameters
self
The new reference value. Discussion Retrieve the reference value with GetRefCon()
Start
The method is called when the port is to begin talking or listening.
IOReturn ( *Start) ( IOFireWireLibIsochPortRef self );
Parameters
self
The isoch port interface to use. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
205
Stop
The method is called when the port is to stop talking or listening.
IOReturn ( *Stop) ( IOFireWireLibIsochPortRef self );
Parameters
self
The isoch port interface to use. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
206
IOFireWireLibIRMAllocationInterface
Declared in
Overview
Description forthcoming
Tasks
Miscellaneous
allocateIsochResources
(page 208) Use this interface to allocate isochronous resources (page 208) Poll to see if IRM resources are still allocated (page 209) Deallocate previously allocated resources (page 209) Get the current refcon (page 209) Is notification on? (page 210) Set a new refcon (page 210) Set a new value for releaseIRMResourcesOnFree (page 210) Force notification off. (page 211) Try to turn on notifications
areIsochResourcesAllocated
deallocateIsochResources
GetRefCon
NotificationIsOn
SetRefCon
setReleaseIRMResourcesOnFree
TurnOffNotification
TurnOnNotification
207
Instance Methods
allocateIsochResources
Use this interface to allocate isochronous resources
IOReturn ( *allocateIsochResources)( IOFireWireLibIRMAllocationRef self, UInt8 isochChannel, UInt32 bandwidthUnits);
Parameters
self
The bandwidth units to allocate. Return Value Returns true if allocation success
areIsochResourcesAllocated
Poll to see if IRM resources are still allocated
Boolean ( *areIsochResourcesAllocated)( IOFireWireLibIRMAllocationRef self, UInt8 *pAllocatedIsochChannel, UInt32 *pAllocatedBandwidthUnits);
Parameters
self
If allocated, the amount of bandwidth Return Value Returns true if currently allocated, false otherwise
208
deallocateIsochResources
Deallocate previously allocated resources
IOReturn ( *deallocateIsochResources)( IOFireWireLibIRMAllocationRef self);
Parameters
self
The IRMAllocation interface to use. Return Value Returns true if deallocation success
GetRefCon
Get the current refcon
void* ( *GetRefCon)( IOFireWireLibIRMAllocationRef self);
Parameters
self
The IRMAllocation interface to use. Return Value Returns the current refcon value
NotificationIsOn
Is notification on?
Boolean ( *NotificationIsOn)( IOFireWireLibIRMAllocationRef self);
Parameters
self
The IRMAllocation interface to use. Return Value Returns true if notifications for this IRMAllocation are enabled
209
SetRefCon
Set a new refcon
void ( *SetRefCon)( IOFireWireLibIRMAllocationRef self, void *refCon);
Parameters
self
setReleaseIRMResourcesOnFree
Set a new value for releaseIRMResourcesOnFree
const void ( *setReleaseIRMResourcesOnFree)( IOFireWireLibIRMAllocationRef self, Boolean doRelease);
Parameters
self
TurnOffNotification
Force notification off.
void ( *TurnOffNotification)( IOFireWireLibIRMAllocationRef self);
Parameters
self
210
TurnOnNotification
Try to turn on notifications
Boolean ( *TurnOnNotification)( IOFireWireLibIRMAllocationRef self);
Parameters
self
The IRMAllocation interface to use. Return Value Returns true upon success
211
IOFireWireLibPHYPacketListenerInterface
Declared in
Overview
Represents and provides management functions for a phy packet listener object.
Tasks
Miscellaneous
ClientCommandIsComplete
(page 213) Notify the PHY packet listener object that a packet notification handler has completed. (page 213) get the flags of listener. (page 214) Returns the user refCon value for thisinterface. (page 214) Is notification on? (page 214) set flags for the listener. (page 215) Set the callback that should be called to handle incoming phy packets (page 215) Sets the user refCon value for this interface. (page 215) Set the callback that should be called when incoming phy packets are dropped by the listener space. (page 216) Turn packet notification off.
GetFlags
GetRefCon
NotificationIsOn
SetFlags
SetListenerCallback
SetRefCon
SetSkippedPacketCallback
TurnOffNotification
212
TurnOnNotification
Instance Methods
ClientCommandIsComplete
Notify the PHY packet listener object that a packet notification handler has completed.
void ( *ClientCommandIsComplete)( IOFireWireLibPHYPacketListenerRef self, FWClientCommandID commandID );
Parameters
self
The ID of the packet notification being completed. This is the same ID that was passed when a packet notification handler is called. Discussion Packet notifications are received one at a time, in order. This function must be called after a packet handler has completed its work.
GetFlags
get the flags of listener.
UInt32 ( *GetFlags)( IOFireWireLibPHYPacketListenerRef self );
Parameters
self
The PHY packet listener object. Return Value flags No current flags are defined.
213
GetRefCon
Returns the user refCon value for thisinterface.
void* ( *GetRefCon)( IOFireWireLibPHYPacketListenerRef self );
Parameters
self
The PHY packet listener object. Return Value returns the refcon
NotificationIsOn
Is notification on?
Boolean ( *NotificationIsOn)( IOFireWireLibPHYPacketListenerRef self );
Parameters
self
The PHY packet listener object. Return Value Returns true if packet notifications for this listener are active
SetFlags
set flags for the listener.
void ( *SetFlags)( IOFireWireLibPHYPacketListenerRef self, UInt32 flags );
Parameters
self
214
SetListenerCallback
Set the callback that should be called to handle incoming phy packets
void ( *SetListenerCallback)( IOFireWireLibPHYPacketListenerRef self, IOFireWireLibPHYPacketCallback inCallback );
Parameters
self
SetRefCon
Sets the user refCon value for this interface.
void ( *SetRefCon)( IOFireWireLibPHYPacketListenerRef self, void *refcon );
Parameters
self
the refcon
SetSkippedPacketCallback
Set the callback that should be called when incoming phy packets are dropped by the listener space.
void ( *SetSkippedPacketCallback)( IOFireWireLibPHYPacketListenerRef self, IOFireWireLibPHYPacketSkippedCallback inCallback );
Parameters
self
215
TurnOffNotification
Turn packet notification off.
void ( *TurnOffNotification)( IOFireWireLibPHYPacketListenerRef self );
Parameters
self
TurnOnNotification
Try to turn on packet notifications for this listener.
IOReturn ( *TurnOnNotification)( IOFireWireLibPHYPacketListenerRef self );
Parameters
self
The PHY packet listener object. Return Value Returns kIOReturnSuccess if successful
Instance Variables
revision
UInt16 revision;
Interface revision.
version
UInt16 version;
Interface version.
216
IOFireWireLibVectorCommandInterface
Declared in
Overview
IOFireWireLib command object for grouping commands execution. Read and Write commands can be attached in order to the vector command. When the vector command is submitted all the commands are sent to the kernel for execution. When all the commands in a vector command are complete the vector command's completion is called. The advantage over submitting and completeing each command simultaneously is that only one kernel transition will be used for submission and one for completion, regardless of the number of commands in the vector.
Tasks
Miscellaneous
AddCommand
(page 218) Adds a command to the vector command. (page 219) Sets the number of commands this vector can hold. (page 219) Returns the command at a given index. (page 220) Returns the number of commands currently in this vector. (page 220) Get the flags currently set for this command. (page 221) Returns the index of the specified command.
EnsureCapacity
GetCommandAtIndex
GetCommandCount
GetFlags
GetIndexOfCommand
217
GetRefCon
(page 221) Get the reference constant for this command. (page 221) Inserts a command at a given index. Commands at and after this index will be moved to their next sequential index. (page 222) Checks if the vector command is currently executing. (page 222) Removes all commands from the vector. (page 223) Removes a command to the vector command. (page 223) Removes the command at a give index. Commands at and afte this index will be moved to their previous sequential index. (page 223) Set the callback routine for this command. (page 224) Set flags governing this command's execution. (page 225) Set the reference constant for this command. (page 225) Submit this command object to FireWire for execution. (page 225) Submit this command object to FireWire for execution.
InsertCommandAtIndex
IsExecuting
RemoveAllCommands
RemoveCommand
RemoveCommandAtIndex
SetCallback
SetFlags
SetRefCon
Submit(IOFireWireLibVectorCommandRef)
SubmitWithRefconAndCallback
Instance Methods
AddCommand
Adds a command to the vector command.
218
Parameters
self
EnsureCapacity
Sets the number of commands this vector can hold.
IOReturn ( *EnsureCapacity)( IOFireWireLibVectorCommandRef self, UInt32 capacity);
Parameters
self
The number of commands this vector command should expect to hold Return Value An IOReturn result code Discussion The vector can grow dynamically, but for performance reasons developers may want the storage preallocated for a certain number of commmands
GetCommandAtIndex
Returns the command at a given index.
219
Parameters
self
The index to return a command from Return Value The IOFireWireLibCommandRef at the specified index on return Discussion Returns kIOReturnBadArgument if the index is out of bounds.
GetCommandCount
Returns the number of commands currently in this vector.
UInt32 ( *GetCommandCount)( IOFireWireLibVectorCommandRef self);
Parameters
self
A reference to the vector command object Return Value UInt32 The number of commands in this vector
GetFlags
Get the flags currently set for this command.
UInt32 ( *GetFlags)( IOFireWireLibVectorCommandRef self);
Parameters
self
220
GetIndexOfCommand
Returns the index of the specified command.
UInt32 ( *GetIndexOfCommand)( IOFireWireLibVectorCommandRef self, IOFireWireLibCommandRef command);
Parameters
self
The command in question Return Value The index of the specified command Discussion Returns kIOReturnNotFound if the command does not exist in this vector.
GetRefCon
Get the reference constant for this command.
void * ( *GetRefCon)( IOFireWireLibVectorCommandRef self);
Parameters
self
A reference to the vector command object Return Value The reference contant set in SetRefCon
InsertCommandAtIndex
Inserts a command at a given index. Commands at and after this index will be moved to their next sequential index.
221
Parameters
self
IsExecuting
Checks if the vector command is currently executing.
Boolean ( *IsExecuting)( IOFireWireLibVectorCommandRef self);
Parameters
self
A reference to the vector command object Return Value True if the command is executing, false otherwise
RemoveAllCommands
Removes all commands from the vector.
void ( *RemoveAllCommands)( IOFireWireLibVectorCommandRef self);
Parameters
self
222
RemoveCommand
Removes a command to the vector command.
void ( *RemoveCommand)( IOFireWireLibVectorCommandRef self, IOFireWireLibCommandRef command);
Parameters
self
RemoveCommandAtIndex
Removes the command at a give index. Commands at and afte this index will be moved to their previous sequential index.
void ( *RemoveCommandAtIndex)( IOFireWireLibVectorCommandRef self, UInt32 index);
Parameters
self
Will be set to the index of the specified command. Discussion Returns kIOReturnBadArgument if the index is out of bounds.
SetCallback
Set the callback routine for this command.
223
Parameters
self
SetFlags
Set flags governing this command's execution.
void ( *SetFlags)( IOFireWireLibVectorCommandRef self, UInt32 inFlags);
Parameters
self
A UInt32 with bits set corresponding to the flags that should be set for this command object. The following values may be used:
kFWCommandNoFlags -- all flags off kFWCommandInterfaceSyncExecute -- Setting this flag causes the command object to execute synchronously. The calling context will block until the command object has completed execution or an error occurs. Using synchronous execution can avoid kernel transitions associated with asynchronous completion and often remove the need for a state machine. kFWVectorCommandInterfaceOrdered - Normally all commands in a vector are executed simultaneously. Setting this flag will dispatch a command only after the prior command has completed.
224
SetRefCon
Set the reference constant for this command.
void ( *SetRefCon)( IOFireWireLibVectorCommandRef self, void *refCon);
Parameters
self
Submit(IOFireWireLibVectorCommandRef )
Submit this command object to FireWire for execution.
IOReturn ( *Submit)( IOFireWireLibVectorCommandRef self);
Parameters
self
A reference to the vector command object Return Value An IOReturn result code
Parameters
self
225
refCon
A reference constant for 3rd party use. This is the same refcon set with SetRefCon and retreived with GetRefCon.
inCallback
A callback function to be called upon command completion. Return Value An IOReturn result code Discussion A convienence method to set the callback and refcon and then submit.
SubmitWithRefconAndCallback
Submit this command object to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibVectorCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
A reference constant for 3rd party use. This is the same refcon set with SetRefCon and retreived with GetRefCon.
inCallback
A callback function to be called upon command completion. Return Value An IOReturn result code Discussion A convienence method to set the callback and refcon and then submit.
226
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
227
IOFireWireLocalIsochPortInterface
Declared in
IOFireWireLibIsoch.h
Overview
FireWire user client local isochronous port object. Represents a FireWire isochronous talker or listener within the local machine. Isochronous transfer is controlled by an associated DCL (Data Stream Control Language) program, which is similar to a hardware DMA program but is hardware agnostic. DCL programs can be written using the IOFireWireDCLCommandPoolInterface object. This interface contains all methods of IOFireWireIsochPortInterface and IOFireWireLocalIsochPortInterface. This interface will contain all v2 methods of IOFireWireLocalIsochPortInterface when instantiated as v2 or newer. Transfer buffers for the local isoch port must all come from a single allocation made with vm_allocate() or mmap(..., MAP_ANON ). Calling vm_deallocate() on the buffers before deallocating a local isoch port object may result in a deadlock. Note: Calling Release() on the local isoch port may not immediately release the isoch port; so it may not be safe to call vm_deallocate() on your transfer buffers. To guarantee the port has been release, run the isochronous runloop until the port is finalized (it has processed any pending callbacks). The finalize callback will be called when the port is finalized. Set the finalize callback using SetFinalizeCallback().
Tasks
Miscellaneous
AllocatePort
(page 229) The method is called when the port should configure its associated hardware to prepare to send or receive isochronous data on the channel number and at the speed specified. (page 230) Get reference value associated with this port.
GetRefCon
228
GetSupported
(page 230) The method is called to determine which FireWire isochronous channels and speed this port supports. (page 231) Change the jump target label of a jump DCL. (page 232) Modify the transfer size of a transfer packet DCL (send or receive) (page 232) NOT IMPLEMENTED. Modify the transfer size of a transfer packet DCL (send or receive) (page 233) Modify the transfer size of a transfer packet DCL (send or receive) (page 234) Display the contents of a DCL program. (page 234) The method is called to release the hardware after the channel has been stopped. (page 235) Set the finalize callback for a local isoch port (page 235) Set reference value associated with this port. (page 236) The method is called when the port is to begin talking or listening.
ModifyJumpDCL
ModifyTransferPacketDCL
ModifyTransferPacketDCLBuffer
ModifyTransferPacketDCLSize
PrintDCLProgram
ReleasePort
SetFinalizeCallback
SetRefCon
Start
Stop
(page 236) The method is called when the port is to stop talking or listening.
Instance Methods
AllocatePort
The method is called when the port should configure its associated hardware to prepare to send or receive isochronous data on the channel number and at the speed specified.
229
Parameters
self
Channel speed
chan
Channel number (-63) Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
GetRefCon
Get reference value associated with this port.
void* ( *GetRefCon) ( IOFireWireLibIsochPortRef self);
Parameters
self
The isoch port interface to use. Return Value The port refcon value. Discussion Set the reference value with SetRefCon()
GetSupported
The method is called to determine which FireWire isochronous channels and speed this port supports.
230
Parameters
self
A pointer to an IOFWSpeed which should be filled with the maximum speed this port can talk or listen.
chanSupported
A pointer to a UInt64 which should be filled with a bitmask representing the FireWire bus isochonous channels on which the port can talk or listen. Set '1' for supported, '' for unsupported. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
ModifyJumpDCL
Change the jump target label of a jump DCL.
IOReturn ( *ModifyJumpDCL)( IOFireWireLibLocalIsochPortRef self, DCLJump *inJump, DCLLabel *inLabel);
Parameters
self
The label to jump to. Return Value kIOReturnSuccess on success. Will return an error if 'inJump' does not point to a valid jump DCL or 'inLabel' does not point to a valid label DCL.
231
Discussion Use this function to change the flow of a DCL program. Works whether the DCL program is currently running or not.
ModifyTransferPacketDCL
Modify the transfer size of a transfer packet DCL (send or receive)
IOReturn ( *ModifyTransferPacketDCL)( IOFireWireLibLocalIsochPortRef self, DCLTransferPacket *inDCL, void *buffer, IOByteCount size );
Parameters
self
The new size of data to be transferred. Return Value Returns kIOReturnSuccess on success. Will return an error if 'size' is too large or 'inDCL' does not point to a valid transfer packet DCL, or the range specified by [buffer, buffer+size] is not in the range of memory locked down for this program. Discussion Allows you to modify transfer packet DCLs after they have been compiled and while the DCL program is still running. The transfer size can be set to any size less than or equal to the size set when the DCL program was compiled (including 0). Availability: IOFireWireLocalIsochPortInterface_v3 and newer.
ModifyTransferPacketDCLBuffer
NOT IMPLEMENTED. Modify the transfer size of a transfer packet DCL (send or receive)
232
Parameters
self
The new buffer to or from data will be transferred. Return Value Returns kIOReturnSuccess on success. Will return an error if the range specified by [buffer, buffer+size] is not in the range of memory locked down for this program. Discussion NOT IMPLEMENTED. Allows you to modify transfer packet DCLs after they have been compiled and while the DCL program is still running. The buffer can be set to be any location within the range of buffers specified when the DCL program was compiled (including 0). Availability: IOFireWireLocalIsochPortInterface_v3 and newer.
ModifyTransferPacketDCLSize
Modify the transfer size of a transfer packet DCL (send or receive)
IOReturn ( *ModifyTransferPacketDCLSize)( IOFireWireLibLocalIsochPortRef self, DCLTransferPacket *inDCL, IOByteCount size );
Parameters
self
233
Return Value Returns kIOReturnSuccess on success. Will return an error if 'size' is too large for this program. Discussion Allows you to modify transfer packet DCLs after they have been compiled and while the DCL program is still running. The transfer size can be set to any size less than or equal to the size set when the DCL program was compiled (including 0). Availability: IOFireWireLocalIsochPortInterface_v2 and newer.
PrintDCLProgram
Display the contents of a DCL program.
void ( *PrintDCLProgram)( IOFireWireLibLocalIsochPortRef self, const DCLCommand *inProgram, UInt32 inLength);
Parameters
self
ReleasePort
The method is called to release the hardware after the channel has been stopped.
IOReturn ( *ReleasePort) ( IOFireWireLibIsochPortRef self );
Parameters
self
The isoch port interface to use. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code.
234
Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
SetFinalizeCallback
Set the finalize callback for a local isoch port
IOReturn ( *SetFinalizeCallback)( IOFireWireLibLocalIsochPortRef self, IOFireWireLibIsochPortFinalizeCallback finalizeCallback );
Parameters
self
The finalize callback. Return Value Returns true if this isoch port has no more pending callbacks and does not need any more runloop time. Discussion When Stop() is called on a LocalIsochPortInterface, there may or may not be isoch callbacks still pending for this isoch port. The port must be allowed to handle any pending callbacks, so the isoch runloop should not be stopped until a port has handled all pending callbacks. The finalize callback is called after the final callback has been made on the isoch runloop. After this callback is sent, it is safe to stop the isoch runloop. You should not access the isoch port after the finalize callback has been made; it may be released immediately after this callback is sent. Availability: IOFireWireLocalIsochPortInterface_v4 and newer.
SetRefCon
Set reference value associated with this port.
235
Parameters
self
The new reference value. Discussion Retrieve the reference value with GetRefCon()
Start
The method is called when the port is to begin talking or listening.
IOReturn ( *Start) ( IOFireWireLibIsochPortRef self );
Parameters
self
The isoch port interface to use. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
Stop
The method is called when the port is to stop talking or listening.
IOReturn ( *Stop) ( IOFireWireLibIsochPortRef self );
Parameters
self
236
Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
Instance Variables
revision
UInt32 revision;
Interface revision
version
UInt32 version;
Interface revision
237
IOFireWireLocalUnitDirectoryInterface
Declared in
Overview
Allows creation and management of unit directories in the config ROM of the local machine. After the unit directory has been built, Publish() should be called to cause it to appear in the config ROM. Unpublish() has the reverse effect as Publish(). This interface can be created using IOFireWireDeviceInterface::CreateLocalUnitDirectory.
Tasks
Miscellaneous
AddEntry_FWAddress
(page 239) Append an offset leaf (page 239) Append a data leaf (page 240) Append an immediate leaf (page 240) Causes a constructed or updated unit directory to appear in the local machine's config ROM. Note that this call will cause a bus reset, after which the unit directory will be visible to devices on the bus. (page 241) Has the opposite effect from Publish(). This call removes a unit directory from the local machine's config ROM. Note that this call will cause a bus reset, after which the unit directory will no longer appear to devices on the bus.
AddEntry_Ptr
AddEntry_UInt32
Publish
Unpublish
238
Instance Methods
AddEntry_FWAddress
Append an offset leaf
IOReturn ( *AddEntry_FWAddress)( IOFireWireLibLocalUnitDirectoryRef self, int key, const FWAddress *value, CFStringRef inDesc);
Parameters
self
Reserved; set to NULL. Discussion Appends an offset leaf to a unit directory. The address passed in value should be an address in initial unit space of the local config ROM.
AddEntry_Ptr
Append a data leaf
IOReturn ( *AddEntry_Ptr)( IOFireWireLibLocalUnitDirectoryRef self, int key, void *inBuffer, size_t inLen, CFStringRef inDesc);
Parameters
self
239
inBuffer
Reserved; set to NULL. Discussion Appends a leaf data node to a unit directory
AddEntry_UInt32
Append an immediate leaf
IOReturn ( *AddEntry_UInt32)( IOFireWireLibLocalUnitDirectoryRef self, int key, UInt32 value, CFStringRef inDesc);
Parameters
self
Reserved; set to NULL. Discussion Appends an immediate leaf to a unit directory. Note that only the lower 3 bytes of the passed in value can appear in the unit directory.
Publish
Causes a constructed or updated unit directory to appear in the local machine's config ROM. Note that this call will cause a bus reset, after which the unit directory will be visible to devices on the bus.
240
Parameters
self
Unpublish
Has the opposite effect from Publish(). This call removes a unit directory from the local machine's config ROM. Note that this call will cause a bus reset, after which the unit directory will no longer appear to devices on the bus.
IOReturn ( *Unpublish)( IOFireWireLibLocalUnitDirectoryRef self);
Parameters
self
Instance Variables
revision
UInt32 revision;
Interface revision
version
UInt32 version;
Interface version
241
IOFireWireNubInterface
Declared in
Overview
IOFireWireDeviceInterface is your primary gateway to the functionality contained in IOFireWireLib. You can use IOFireWireDeviceInterface to:
IOFireWireReadCommandInterface IOFireWireReadQuadletCommandInterface IOFireWireWriteCommandInterface IOFireWireWriteQuadletCommandInterface IOFireWireCompareSwapCommandInterface IOFireWirePseudoAddressSpaceInterface -- pseudo address space services IOFireWirePhysicalAddressSpaceInterface -- physical address space services IOFireWireLocalUnitDirectoryInterface -- manage local unit directories in the mac IOFireWireConfigDirectoryInterface -- access and browse remote device config directories IOFireWireIsochChannelInterface -- create/manage talker and listener isoch channels IOFireWireLocalIsochPortInterface -- create local isoch ports IOFireWireRemoteIsochPortInterface -- create remote isoch ports IOFireWireDCLCommandPoolInterface -- create a DCL command pool allocator. perform synchronous read, write and lock operations perform other miscellanous bus operations, such as reset the FireWire bus. create FireWire command objects and interfaces used to perform synchronous/asynchronous read, write and lock operations. These include: create interfaces which provide a other extended services. These include:
242
IOFireWireNubInterface Overview
create interfaces which provide isochronous services (see IOFireWireLibIsoch.h). These include:
243
IOFireWireNuDCLPoolInterface
Declared in
IOFireWireLibIsoch.h
Overview
Use this interface to build NuDCL-based DCL programs.
Tasks
Miscellaneous
AllocateReceivePacket
(page 247) Allocate a ReceivePacket NuDCL and append it to the program (page 248) Allocate a ReceivePacket NuDCL and append it to the program (page 248) Allocate a SendPacket NuDCL and append it to the program. (page 249) Allocate a SendPacket NuDCL and append it to the program. (page 250) Allocate a SkipCycle NuDCL and append it to the program. (page 250) Add a memory range to the scatter gather list of a NuDCL (page 251)
AllocateReceivePacket_v
AllocateSendPacket
AllocateSendPacket_v
AllocateSkipCycle
AppendDCLRanges
AppendDCLUpdateList
CopyDCLUpdateList
(page 251)
244
IOFireWireNuDCLPoolInterface Tasks
CountDCLRanges
(page 251) Returns number of buffers for a NuDCL (page 252) Get the next pointer for a NuDCL (page 252) Get the branch pointer for a NuDCL (page 252) Get callback for a NuDCL (page 253)
FindDCLNextDCL
GetDCLBranch
GetDCLCallback
GetDCLFlags
GetDCLRanges
(page 253) Get the scatter-gather list for a NuDCL (page 254)
GetDCLRefcon
GetDCLs
(page 254) Returns the pool's DCL program as a CFArray of NuDCLRef's. (page 254) Returns number of bytes to be transferred by a NuDCL (page 255) (page 255)
GetDCLSize
GetDCLSkipBranch
GetDCLSkipCallback
GetDCLSkipRefcon
(page 255)
GetDCLSpan
(page 255) Returns a virtual range spanning lowest referenced buffer address to highest (page 256) Get the status pointer for a NuDCL. (page 256)
GetDCLStatusPtr
GetDCLSyncBits
GetDCLTagBits
(page 256)
GetDCLTimeStampPtr
245
IOFireWireNuDCLPoolInterface Tasks
GetDCLUserHeaderPtr
(page 257)
GetProgram
(page 257) Finds the first DCL in the pool not preceeded by any other DCL. (page 258)
GetUserHeaderMaskPtr
PrintDCL
PrintProgram
RemoveDCLUpdateList
SetCurrentTagAndSync
(page 258) Set current tag and sync bits (page 259) Set the branch pointer for a NuDCL (page 259) Set the callback for a NuDCL (page 260)
SetDCLBranch
SetDCLCallback
SetDCLFlags
SetDCLRanges
(page 260) Set the scatter gather list for a NuDCL (page 261) (page 262) (page 262)
SetDCLRefcon
SetDCLSkipBranch
SetDCLSkipCallback
SetDCLSkipRefcon
(page 262)
SetDCLStatusPtr
(page 262) Set the status pointer for a NuDCL (page 264)
SetDCLSyncBits
246
SetDCLTagBits
(page 264)
SetDCLTimeStampPtr
(page 264) Set the time stamp pointer for a NuDCL (page 265)
SetDCLUpdateList
SetDCLUserHeaderPtr
(page 265) Set a user specified header for a send NuDCL (page 266)
SetDCLWaitControl
Instance Methods
AllocateReceivePacket
Allocate a ReceivePacket NuDCL and append it to the program
NuDCLReceivePacketRef ( *AllocateReceivePacket)( IOFireWireLibNuDCLPoolRef self, CFMutableSetRef saveBag, UInt8 headerBytes, UInt32 numBuffers, IOVirtualRange *buffers );
Parameters
self
Number of bytes of isochronous header to receive with the data. Valid values are 0, 4, and 8.
saveBag
The allocated DCL can be added to a CFBag for easily setting DCL update lists. Pass a CFMutableSetRef to add the allocated DCL to a CFBag; pass NULL to ignore. SaveBag is unmodified on failure.
numBuffers
An array of virtual memory ranges containing the packet contents. The array is copied into the DCL.
247
Return Value Returns an NuDCLReceivePacketRef on success or 0 on failure. Discussion The ReceivePacket DCL receives an isochronous packet from the bus. One DCL runs per bus cycle. If receiving isochronous headers, an update must be run before the isochronous header is valid. Receive DCLs can be modified using other functions of IOFireWireLibNuDCLPool.
AllocateReceivePacket_v
Allocate a ReceivePacket NuDCL and append it to the program
NuDCLReceivePacketRef ( *AllocateReceivePacket_v)( IOFireWireLibNuDCLPoolRef self, CFMutableSetRef saveBag, UInt8 headerBytes, IOVirtualRange *firstRange, ... );
Parameters
self
The allocated DCL can be added to a CFBag for easily setting DCL update lists. Pass a CFMutableSetRef to add the allocated DCL to a CFBag; pass NULL to ignore. SaveBag is unmodified on failure.
headerBytes
Number of bytes of isochronous header to receive with the data. Valid values are 0, 4, and 8.
firstRange
The first buffer to be transmitted. Follow with additional ranges; terminate with NULL. Return Value Returns an NuDCLReceivePacketRef on success or 0 on failure. Discussion Same as AllocateReceivePacket but ranges are passed as a NULL-terminated vector of IOVirtualRange's
AllocateSendPacket
Allocate a SendPacket NuDCL and append it to the program.
248
NuDCLSendPacketRef ( *AllocateSendPacket)( IOFireWireLibNuDCLPoolRef self, CFMutableSetRef saveBag, UInt32 numBuffers, IOVirtualRange *buffers );
Parameters
self
The allocated DCL can be added to a CFBag for easily setting DCL update lists. Pass a CFMutableSetRef to add the allocated DCL to a CFBag; pass NULL to ignore. SaveBag is unmodified on failure.
numBuffers
An array of virtual memory ranges containing the packet contents. The array is copied into the DCL. Return Value Returns an NuDCLSendPacketRef on success or 0 on failure. Discussion The SendPacket DCL sends an isochronous packet on the bus. One DCL runs per bus cycle. The isochronous header is automatically generated, but can be overriden. An update must be run to regenerate the isochronous header. The sync and tag fields of allocated DCLs default to 0, unless If SetCurrentTagAndSync has been called. Send DCLs can be modified using other functions of IOFireWireLibNuDCLPool.
AllocateSendPacket_v
Allocate a SendPacket NuDCL and append it to the program.
NuDCLSendPacketRef ( *AllocateSendPacket_v)( IOFireWireLibNuDCLPoolRef self, CFMutableSetRef saveBag, IOVirtualRange *firstRange, ... );
Parameters
self
249
saveBag
The allocated DCL can be added to a CFBag for easily setting DCL update lists. Pass a CFMutableSetRef to add the allocated DCL to a CFBag; pass NULL to ignore. SaveBag is unmodified on failure.
firstRange
The first buffer to be transmitted. Follow with additional ranges; terminate with NULL. Return Value Returns an NuDCLSendPacketRef on success or 0 on failure. Discussion Same as AllocateSendPacket but ranges are passed as a NULL-terminated vector of IOVirtualRange's
AllocateSkipCycle
Allocate a SkipCycle NuDCL and append it to the program.
NuDCLSkipCycleRef ( *AllocateSkipCycle)( IOFireWireLibNuDCLPoolRef self );
Parameters
self
The NuDCL pool to use. Return Value Returns an NuDCLSkipCycleRef on success or 0 on failure. Discussion The SkipCycle DCL causes the DCL program to "sends" an empty cycle.
AppendDCLRanges
Add a memory range to the scatter gather list of a NuDCL
IOReturn ( *AppendDCLRanges) ( NuDCLRef dcl, UInt32 numRanges, IOVirtualRange *range );
Parameters
dcl
250
range
A IOVirtualRange to add to this DCL buffer list. Do not pass NULL. Return Value Returns an IOReturn error code. Discussion This change will apply immediately to a non-running DCL program. To apply the change to a running program use IOFireWireLocalIsochPortInterface::Notify() Applies: NuDCLSendPacketRef, NuDCLReceivePacketRef
AppendDCLUpdateList
IOReturn ( *AppendDCLUpdateList)( NuDCLRef dcl, NuDCLRef updateDCL );
CopyDCLUpdateList
CFSetRef ( *CopyDCLUpdateList)( NuDCLRef dcl );
CountDCLRanges
Returns number of buffers for a NuDCL
UInt32 ( *CountDCLRanges) ( NuDCLRef dcl );
Parameters
dcl
The DCL to query Return Value Returns number of ranges in DCLs scatter-gather list
251
FindDCLNextDCL
Get the next pointer for a NuDCL
NuDCLRef ( *FindDCLNextDCL)( IOFireWireLibNuDCLPoolRef self, NuDCLRef dcl );
Parameters
dcl
The dcl whose next pointer will be returned Return Value Returns the DCL immediately following this DCL in program order (ignoring branches) or 0 for none. Discussion Applies: Any NuDCLRef
GetDCLBranch
Get the branch pointer for a NuDCL
NuDCLRef ( *GetDCLBranch)( NuDCLRef dcl );
Parameters
dcl
The dcl whose branch pointer will be returned. Return Value Returns the branch pointer of 'dcl' or 0 for none is set. Discussion Applies: Any NuDCLRef.
GetDCLCallback
Get callback for a NuDCL
252
Parameters
dcl
The DCL to query Return Value Returns the DCLs callback function or NULL if none is set. Discussion Returns the callback function for a DCL Applies: Any NuDCLRef
GetDCLFlags
UInt32 ( *GetDCLFlags)( NuDCLRef dcl );
GetDCLRanges
Get the scatter-gather list for a NuDCL
UInt32 ( *GetDCLRanges) ( NuDCLRef dcl, UInt32 maxRanges, IOVirtualRange *outRanges );
Parameters
dcl
Description forthcoming.
outRanges
Description forthcoming. Return Value Returns the previously set handler or NULL is no handler was set.
253
GetDCLRefcon
void* ( *GetDCLRefcon)( NuDCLRef dcl );
GetDCLs
Returns the pool's DCL program as a CFArray of NuDCLRef's.
CFArrayRef ( *GetDCLs)( IOFireWireLibNuDCLPoolRef self );
Parameters
self
GetDCLSize
Returns number of bytes to be transferred by a NuDCL
IOByteCount ( *GetDCLSize) ( NuDCLRef dcl );
Parameters
dcl
The DCL to query Return Value Returns an IOByteCount. Discussion Applies: NuDCLSendPacketRef, NuDCLReceivePacket
254
GetDCLSkipBranch
NuDCLRef ( *GetDCLSkipBranch)( NuDCLRef dcl );
GetDCLSkipCallback
NuDCLCallback ( *GetDCLSkipCallback)( NuDCLRef dcl );
GetDCLSkipRefcon
void * ( *GetDCLSkipRefcon)( NuDCLRef dcl );
GetDCLSpan
Returns a virtual range spanning lowest referenced buffer address to highest
IOReturn ( *GetDCLSpan) ( NuDCLRef dcl, IOVirtualRange *spanRange );
Parameters
dcl
The DCL to query Return Value Returns an IOVirtualRange. Discussion Applies: NuDCLSendPacketRef, NuDCLReceivePacket
255
GetDCLStatusPtr
Get the status pointer for a NuDCL.
UInt32* ( *GetDCLStatusPtr)( NuDCLRef dcl );
Parameters
dcl
The DCL whose status pointer will be returned. Return Value Returns a UInt32 status pointer. Discussion Applies: Any NuDCLRef.
GetDCLSyncBits
UInt8 ( *GetDCLSyncBits)( NuDCLRef dcl );
GetDCLTagBits
UInt8 ( *GetDCLTagBits)( NuDCLRef dcl );
GetDCLTimeStampPtr
Get the time stamp pointer for a NuDCL.
256
Parameters
dcl
The DCL whose timestamp pointer will be returned. Return Value Returns a UInt32 time stamp pointer. Discussion Applies: Any NuDCLRef.
GetDCLUserHeaderPtr
UInt32 * ( *GetDCLUserHeaderPtr)( NuDCLRef dcl );
GetProgram
Finds the first DCL in the pool not preceeded by any other DCL.
DCLCommand* ( *GetProgram)( IOFireWireLibNuDCLPoolRef self );
Parameters
self
The NuDCL pool to use. Return Value A DCLCommand pointer. Discussion Returns a backwards-compatible DCL program pointer. This can be passed to IOFireWireLibDeviceRef::CreateLocalIsochPort.
257
GetUserHeaderMaskPtr
UInt32 * ( *GetUserHeaderMaskPtr)( NuDCLRef dcl );
PrintDCL
void ( *PrintDCL)( NuDCLRef dcl );
PrintProgram
void ( *PrintProgram)( IOFireWireLibNuDCLPoolRef self );
RemoveDCLUpdateList
IOReturn ( *RemoveDCLUpdateList)( NuDCLRef dcl );
SetCurrentTagAndSync
Set current tag and sync bits
258
Parameters
self
Sync field value for subsequently allocated send DCLs Discussion Sets the DCL pool's current tag and sync bits. All send DCLs allocated after calling this function will transmit the specified tag and sync values. These fields can also be set on each DCL using SetDCLTagBits() and SetDCLSyncBits().
SetDCLBranch
Set the branch pointer for a NuDCL
IOReturn ( *SetDCLBranch)( NuDCLRef dcl, NuDCLRef branchDCL );
Return Value Returns an IOReturn error code. Discussion Program execution will jump to the DCL pointed to by 'branchDCL', after the DCL is executed. If set to 0, execution will stop after this DCL. This change will apply immediately to a non-running DCL program. To apply the change to a running program use IOFireWireLocalIsochPortInterface::Notify() Applies: Any NuDCLRef.
SetDCLCallback
Set the callback for a NuDCL
259
Parameters
dcl
The callback function. Return Value Returns an IOReturn error code. Discussion A callback can be called each time a NuDCL is run. Use SetDCLCallback() to set the callback for a NuDCL. If the update option is also set, the callback will be called after the update has run. This change will apply immediately to a non-running DCL program. To apply the change to a running program use IOFireWireLocalIsochPortInterface::Notify() Applies: Any NuDCLRef
SetDCLFlags
void ( *SetDCLFlags)( NuDCLRef dcl, UInt32 flags );
SetDCLRanges
Set the scatter gather list for a NuDCL
260
Parameters
dcl
An array of virtual ranges Return Value Returns an IOReturn error code. Discussion Set the list of data buffers for a DCL. Setting too many ranges may result in a memory region with too many discontinous physical segments for the hardware to send or receive in a single packet. This will result in an error when the program is compiled. This change will apply immediately to a non-running DCL program. To apply the change to a running program use IOFireWireLocalIsochPortInterface::Notify() Applies: NuDCLSendPacketRef, NuDCLReceivePacketRef
SetDCLRefcon
void ( *SetDCLRefcon)( NuDCLRef dcl, void *refcon );
261
SetDCLSkipBranch
IOReturn ( *SetDCLSkipBranch)( NuDCLRef dcl, NuDCLRef skipCycleDCL );
SetDCLSkipCallback
IOReturn ( *SetDCLSkipCallback)( NuDCLRef dcl, NuDCLCallback callback );
SetDCLSkipRefcon
IOReturn ( *SetDCLSkipRefcon)( NuDCLRef dcl, void *refcon );
SetDCLStatusPtr
Set the status pointer for a NuDCL
IOReturn ( *SetDCLStatusPtr)( NuDCLRef dcl, UInt32 *statusPtr );
Parameters
dcl
A pointer to a quadlet which will hold the status after 'dcl' is updated.
262
Return Value Returns an IOReturn error code. Discussion Setting a the status pointer for a NuDCL causes the packet transmit/receive hardware status to be recorded when the DCL executes. This DCL must be updated after it has executed for the status to be valid. This change will apply immediately to a non-running DCL program. To apply the change to a running program use IOFireWireLocalIsochPortInterface::Notify() Status values are as follows: (from the OHCI spec, section 3.1.1)
5'h1D 5'h11 5'h0E 5'h0B 5'h0A ack_data_error (receive) ack_complete (receive/transmit) evt_unknown (receive/transmit) evt_tcode_err (transmit) evt_timeout (transmit) A data field CRC or data_length error. No event occurred. (Success) An error condition has occurred that cannot be represented by any other event codes defined herein. A bad tCode is associated with this packet. The packet was flushed. Indicates that the asynchronous transmit response packet expired and was not transmitted, or that an IT DMA context experienced a skip processing overflow (See section9.3.4). An error occurred while the Host Controller was attempting to write to host memory either in the data stage of descriptor processing (AR, IR), or when processing a single 16-bit host memory write (IT). An error occurred while the Host Controller was attempting to read from host memory in the data stage of descriptor processing. An unrecoverable error occurred while the Host Controller was reading a descriptor block. A receive FIFO overflowed during the reception of an isochronous packet. The received data length was greater than the buffer's data_length.
5'h08
evt_data_write (receive/transmit)
5'h07
evt_data_read (transmit)
263
SetDCLSyncBits
IOReturn ( *SetDCLSyncBits)( NuDCLRef dcl, UInt8 syncBits );
SetDCLTagBits
IOReturn ( *SetDCLTagBits)( NuDCLRef dcl, UInt8 tagBits );
SetDCLTimeStampPtr
Set the time stamp pointer for a NuDCL
IOReturn ( *SetDCLTimeStampPtr)( NuDCLRef dcl, UInt32 *timeStampPtr );
Parameters
dcl
A pointer to a quadlet which will hold the timestamp after 'dcl' is updated. Return Value Returns an IOReturn error code. Discussion Setting a the time stamp pointer for a NuDCL causes a time stamp to be recorded when a DCL executes. This DCL must be updated after it has executed for the timestamp to be valid. This change will apply immediately to a non-running DCL program. To apply the change to a running program use IOFireWireLocalIsochPortInterface::Notify()
264
SetDCLUpdateList
IOReturn ( *SetDCLUpdateList)( NuDCLRef dcl, CFSetRef dclList );
SetDCLUserHeaderPtr
Set a user specified header for a send NuDCL
IOReturn ( *SetDCLUserHeaderPtr)( NuDCLRef dcl, UInt32 *headerPtr, UInt32 *mask );
Parameters
dcl
A pointer to a two-quadlet header. See section 9.6 of the the OHCI specification.
mask
A pointer to a two-quadlet mask. The quadlets in headerPtr are masked with 'mask' and the masked-out bits are replaced by the FireWire system software. Return Value Returns an IOReturn error code. Discussion Allows the client to create a custom header for a transmitted isochronous packet. The header is masked with 'mask', and the FireWire system software fills in the masked out bits. This change will apply immediately to a non-running DCL program. An update must be run on the DCL for changes to take effect in a running program. Applies: NuDCLSendPacketRef
265
SetDCLWaitControl
IOReturn ( *SetDCLWaitControl)( NuDCLRef dcl, Boolean wait );
Instance Variables
revision
UInt32 revision;
Interface version
version
UInt32 version;
Interface version
266
IOFireWirePHYCommandInterface
Declared in
Overview
Description forthcoming
Tasks
Miscellaneous
Cancel
(page 269) Cancel command execution (page 269) Gets the most recently received ack code for this transaction. (page 270) Set the command refCon value and callback handler, and submit the command to FireWire for execution. (page 270) Gets the refcon associated with this command (page 271) Gets the most recently received response code for this transaction. (page 271) Return command completion status. (page 272) Get command target address. (page 272) Return number of bytes transferred by this command object when it last completed execution. (page 273) Is this command object currently executing?
GetAckCode
GetBuffer
GetRefCon
GetResponseCode
GetStatus
GetTargetAddress
GetTransferredBytes
IsExecuting
267
IOFireWirePHYCommandInterface Tasks
SetBuffer
(page 274) Set the buffer where read data should be stored. (page 274) Set the completion handler to be called once the command completes asynchronous execution . (page 275) Set the 2 quadlets of data to be sent in a PHY packet. (page 276) Set flags governing this command's execution. (page 277) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function. (page 278) Set the maximum size in bytes of packets transferred by this command. (page 278) Gets the most recently received ack code for this transaction. (page 279) Sets the maximum number of retries for this command. (page 279) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 280) Set command target address (page 280) Sets the duration of the timeout for this command. (page 281)
SetCallback
SetDataQuads
SetFlags
SetGeneration
SetMaxPacket
SetMaxPacketSpeed
SetMaxRetryCount
SetRefCon
SetTarget
SetTimeoutDuration
Submit
SubmitWithRefconAndCallback
(page 281) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
268
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetAckCode
Gets the most recently received ack code for this transaction.
UInt32 ( *GetAckCode)( IOFireWireLibCommandRef self );
Parameters
self
269
GetBuffer
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
void ( *GetBuffer)( IOFireWireLibCommandRef self, UInt32 *outSize, void **outBuf);
Parameters
self
The command object interface of interest Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
GetRefCon
Gets the refcon associated with this command
void * ( *GetRefCon)( IOFireWireLibCommandRef self );
Parameters
self
270
GetResponseCode
Gets the most recently received response code for this transaction.
UInt32 ( *GetResponseCode)( IOFireWireLibCommandRef self );
Parameters
self
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID YES YES YES YES YES YES
271
kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID
YES YES
GetTargetAddress
Get command target address.
void ( *GetTargetAddress)( IOFireWireLibCommandRef self, FWAddress *outAddr);
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID NO YES YES YES YES YES YES YES
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
272
Return Value A UInt32 containing the bytes transferred value Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 YES YES YES YES YES YES YES
273
kIOFireWireReadCommandInterfaceID
YES
SetBuffer
Set the buffer where read data should be stored.
void ( *SetBuffer)( IOFireWireLibCommandRef self, UInt32 size, void *buf);
Parameters
self
A pointer to the receive buffer. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
274
Parameters
self
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetDataQuads
Set the 2 quadlets of data to be sent in a PHY packet.
void ( *SetDataQuads)( IOFireWireLibPHYCommandRef self, UInt32 data1, UInt32 data2 );
Parameters
self
275
SetFlags
Set flags governing this command's execution.
void ( *SetFlags)( IOFireWireLibCommandRef self, UInt32 inFlags);
Parameters
self
A UInt32 with bits set corresponding to the flags that should be set for this command object. The following values may be used:
kFWCommandNoFlags -- all flags off kFWCommandInterfaceForceNoCopy -- data sent by this command should always be received/sent directly from the buffer set with SetBuffer(). Whatever data is in the buffer when the command is submitted will be used. kFWCommandInterfaceForceCopyAlways -- data will always be copied out of the command object data buffer when SetBuffer() is called, up to a maximum allowed size (kFWUserCommandSubmitWithCopyMaxBufferBytes). This can result in faster data transfer. Changes made to the data buffer contents after calling SetBuffer() will be ignored; SetBuffer() should be called whenever the data buffer contents change. kFWCommandInterfaceSyncExecute -- Setting this flag causes the command object to execute synchronously. The calling context will block until the command object has completed execution or an error occurs. Using synchronous execution can avoid kernel transitions associated with asynchronous completion and often remove the need for a state machine. kFWCommandInterfaceForceBlockRequest -- Setting this flag causes read and write transactions to use block request packets even if the payload is 4 bytes. If this flag is not set 4 byte transactions will occur using quadlet transactions.
276
NO NO NO YES NO YES NO
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
void ( *SetGeneration)( IOFireWireLibCommandRef self, UInt32 generation);
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
277
SetMaxPacket
Set the maximum size in bytes of packets transferred by this command.
IOReturn ( *SetMaxPacket)( IOFireWireLibCommandRef self, IOByteCount maxPacketSize);
Parameters
self
Size in bytes of largest packet that should be transferred by this command. Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetMaxPacketSpeed
Gets the most recently received ack code for this transaction.
void ( *SetMaxPacketSpeed)( IOFireWireLibCommandRef self, IOFWSpeed speed );
Parameters
self
278
speed
SetMaxRetryCount
Sets the maximum number of retries for this command.
void ( *SetMaxRetryCount)( IOFireWireLibCommandRef self, UInt32 count );
Parameters
self
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
279
kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID
YES YES
SetTarget
Set command target address
void ( *SetTarget)( IOFireWireLibCommandRef self, const FWAddress *addr);
Parameters
self
SetTimeoutDuration
Sets the duration of the timeout for this command.
280
Parameters
self
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID YES YES
281
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
282
IOFireWirePhysicalAddressSpaceInterface
Declared in
Overview
IOFireWireLib physical address space object. ( interface name: IOFireWirePhysicalAddressSpaceInterface ) Represents and provides management functions for a physical address space (hardware-backed) in the local machine. Physical address space objects can be created using IOFireWireDeviceInterface.
Tasks
Miscellaneous
GetBuffer
(page 284) Get a pointer to the backing store for this address space (page 284) Get the size in bytes of this address space. (page 284) Get the FireWire address of this address space (page 285) Returns the physical address of the beginning of this address space (page 285) Returns the physical segment containing the address at a specified offset from the beginning of this address space (page 285) Returns the list of physical memory ranges this address space occupies on the local machine.
GetBufferSize
GetFWAddress
GetPhysicalAddress
GetPhysicalSegment
GetPhysicalSegments
283
Instance Methods
GetBuffer
Get a pointer to the backing store for this address space
void* ( *GetBuffer)( IOFireWireLibPhysicalAddressSpaceRef self);
Parameters
self
The address space interface to use. Return Value A pointer to the backing store of this address space.
GetBufferSize
Get the size in bytes of this address space.
const UInt32 ( *GetBufferSize)( IOFireWireLibPhysicalAddressSpaceRef self);
Parameters
self
The address space interface to use. Return Value Size of the pseudo address space in bytes.
GetFWAddress
Get the FireWire address of this address space
void ( *GetFWAddress)( IOFireWireLibPhysicalAddressSpaceRef self, FWAddress *outAddr);
Parameters
self
284
GetPhysicalAddress
Returns the physical address of the beginning of this address space
IOPhysicalAddress ( *GetPhysicalAddress)( IOFireWireLibPhysicalAddressSpaceRef self);
Parameters
self
The address space interface to use. Return Value The physical address of the start of this address space
GetPhysicalSegment
Returns the physical segment containing the address at a specified offset from the beginning of this address space
IOPhysicalAddress ( *GetPhysicalSegment)( IOFireWireLibPhysicalAddressSpaceRef self, IOByteCount offset, IOByteCount *length);
Parameters
self
Pointer to a value which upon completion will contain the length of the segment returned by the function. Return Value The address of the physical segment containing the address at the specified offset of the address space
GetPhysicalSegments
Returns the list of physical memory ranges this address space occupies on the local machine.
285
void ( *GetPhysicalSegments)( IOFireWireLibPhysicalAddressSpaceRef self, UInt32 *ioSegmentCount, IOByteCount outSegments[], IOPhysicalAddress outAddresses[]);
Parameters
self
Pass in a pointer to the number of list entries in outSegments and outAddress. Upon completion, this will contain the actual number of segments returned in outSegments and outAddress
outSegments
A pointer to an array to hold the function results. Upon completion, this will contain the lengths of the physical segments this address space occupies on the local machine
outAddresses
A pointer to an array to hold the function results. Upon completion, this will contain the addresses of the physical segments this address space occupies on the local machine. If NULL, ioSegmentCount will contain the number of physical segments in the address space.
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
286
IOFireWirePseudoAddressSpaceInterface
Declared in
Overview
Represents and provides management functions for a pseudo address space (software-backed) in the local machine. Pseudo address space objects can be created using IOFireWireDeviceInterface.
Tasks
Miscellaneous
ClientCommandIsComplete
(page 288) Notify the address space that a packet notification handler has completed. (page 288) Get a pointer to the backing store for this address space (page 289) Get the size in bytes of this address space. (page 289) Get the FireWire address of this address space (page 289) Returns the user refCon value for this address space. (page 290) Is notification on? (page 290) Set the callback that should be called to handle read accesses to the corresponding address space
GetBuffer
GetBufferSize
GetFWAddress
GetRefCon
NotificationIsOn
SetReadHandler
287
SetSkippedPacketHandler
(page 291) Set the callback that should be called when incoming packets are dropped by the address space. (page 291) Set the callback that should be called to handle write accesses to the corresponding address space (page 291) Force packet notification off. (page 292) Try to turn on packet notifications for this address space.
SetWriteHandler
TurnOffNotification
TurnOnNotification
Instance Methods
ClientCommandIsComplete
Notify the address space that a packet notification handler has completed.
void ( *ClientCommandIsComplete)( IOFireWireLibPseudoAddressSpaceRef self, FWClientCommandID commandID, IOReturn status);
Parameters
self
The ID of the packet notification being completed. This is the same ID that was passed when a packet notification handler is called.
status
The completion status of the packet handler Discussion Packet notifications are received one at a time, in order. This function must be called after a packet handler has completed its work.
GetBuffer
Get a pointer to the backing store for this address space
288
Parameters
self
The address space interface to use. Return Value A pointer to the backing store of this pseudo address space. Returns nil if none.
GetBufferSize
Get the size in bytes of this address space.
const UInt32 ( *GetBufferSize)( IOFireWireLibPseudoAddressSpaceRef self);
Parameters
self
The address space interface to use. Return Value Size of the pseudo address space in bytes. Returns 0 for none.
GetFWAddress
Get the FireWire address of this address space
void ( *GetFWAddress)( IOFireWireLibPseudoAddressSpaceRef self, FWAddress *outAddr);
Parameters
self
GetRefCon
Returns the user refCon value for this address space.
289
Parameters
self
The address space interface to use. Return Value Size of the pseudo address space in bytes. Returns 0 for none.
NotificationIsOn
Is notification on?
Boolean ( *NotificationIsOn)( IOFireWireLibPseudoAddressSpaceRef self);
Parameters
self
The address space interface to use. Return Value Returns true if packet notifications for this address space are active
SetReadHandler
Set the callback that should be called to handle read accesses to the corresponding address space
const IOFireWirePseudoAddressSpaceReadHandler ( *SetReadHandler)( IOFireWireLibPseudoAddressSpaceRef self, IOFireWirePseudoAddressSpaceReadHandler inReader);
Parameters
self
The callback to set. Return Value Returns the callback that was previously set or nil for none.
290
SetSkippedPacketHandler
Set the callback that should be called when incoming packets are dropped by the address space.
const IOFireWirePseudoAddressSpaceSkippedPacketHandler ( *SetSkippedPacketHandler)( IOFireWireLibPseudoAddressSpaceRef self, IOFireWirePseudoAddressSpaceSkippedPacketHandler inHandler);
Parameters
self
The callback to set. Return Value Returns the callback that was previously set or nil for none.
SetWriteHandler
Set the callback that should be called to handle write accesses to the corresponding address space
const IOFireWirePseudoAddressSpaceWriteHandler ( *SetWriteHandler)( IOFireWireLibPseudoAddressSpaceRef self, IOFireWirePseudoAddressSpaceWriteHandler inWriter);
Parameters
self
The callback to set. Return Value Returns the callback that was previously set or nil for none.
TurnOffNotification
Force packet notification off.
291
Parameters
self
TurnOnNotification
Try to turn on packet notifications for this address space.
Boolean ( *TurnOnNotification)( IOFireWireLibPseudoAddressSpaceRef self);
Parameters
self
The address space interface to use. Return Value Returns true upon success
Instance Variables
revision
UInt32 revision;
Interface revision
version
UInt32 version;
Interface version
292
IOFireWireReadCommandInterface
Declared in
Overview
IOFireWireLib block read command object. Represents an object that is configured and submitted to issue synchronous and asynchronous block read commands. This interface contains all methods of IOFireWireCommandInterface. This interface will contain all v2 methods of IOFireWireCommandInterface when instantiated as v2 or newer.
Tasks
Miscellaneous
Cancel
(page 295) Cancel command execution (page 295) Gets the most recently received ack code for this transaction. (page 296) Set the command refCon value and callback handler, and submit the command to FireWire for execution. (page 296) Gets the refcon associated with this command (page 297) Gets the most recently received response code for this transaction. (page 297) Return command completion status.
GetAckCode
GetBuffer
GetRefCon
GetResponseCode
GetStatus
293
IOFireWireReadCommandInterface Tasks
GetTargetAddress
(page 298) Get command target address. (page 298) Return number of bytes transferred by this command object when it last completed execution. (page 299) Is this command object currently executing? (page 300) Set the buffer where read data should be stored. (page 300) Set the completion handler to be called once the command completes asynchronous execution . (page 301) Set flags governing this command's execution. (page 302) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function. (page 303) Set the maximum size in bytes of packets transferred by this command. (page 304) Gets the most recently received ack code for this transaction. (page 304) Sets the maximum number of retries for this command. (page 305) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 305) Set command target address (page 306) Sets the duration of the timeout for this command. (page 307)
GetTransferredBytes
IsExecuting
SetBuffer
SetCallback
SetFlags
SetGeneration
SetMaxPacket
SetMaxPacketSpeed
SetMaxRetryCount
SetRefCon
SetTarget
SetTimeoutDuration
Submit
SubmitWithRefconAndCallback
(page 307) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
294
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetAckCode
Gets the most recently received ack code for this transaction.
UInt32 ( *GetAckCode)( IOFireWireLibCommandRef self );
Parameters
self
295
GetBuffer
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
void ( *GetBuffer)( IOFireWireLibCommandRef self, UInt32 *outSize, void **outBuf);
Parameters
self
The command object interface of interest Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
GetRefCon
Gets the refcon associated with this command
void * ( *GetRefCon)( IOFireWireLibCommandRef self );
Parameters
self
296
GetResponseCode
Gets the most recently received response code for this transaction.
UInt32 ( *GetResponseCode)( IOFireWireLibCommandRef self );
Parameters
self
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID YES YES YES YES YES YES
297
kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID
YES YES
GetTargetAddress
Get command target address.
void ( *GetTargetAddress)( IOFireWireLibCommandRef self, FWAddress *outAddr);
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID NO YES YES YES YES YES YES YES
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
298
Return Value A UInt32 containing the bytes transferred value Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 YES YES YES YES YES YES YES
299
kIOFireWireReadCommandInterfaceID
YES
SetBuffer
Set the buffer where read data should be stored.
void ( *SetBuffer)( IOFireWireLibCommandRef self, UInt32 size, void *buf);
Parameters
self
A pointer to the receive buffer. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
300
Parameters
self
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetFlags
Set flags governing this command's execution.
void ( *SetFlags)( IOFireWireLibCommandRef self, UInt32 inFlags);
Parameters
self
301
inFlags
A UInt32 with bits set corresponding to the flags that should be set for this command object. The following values may be used:
kFWCommandNoFlags -- all flags off kFWCommandInterfaceForceNoCopy -- data sent by this command should always be received/sent directly from the buffer set with SetBuffer(). Whatever data is in the buffer when the command is submitted will be used. kFWCommandInterfaceForceCopyAlways -- data will always be copied out of the command object data buffer when SetBuffer() is called, up to a maximum allowed size (kFWUserCommandSubmitWithCopyMaxBufferBytes). This can result in faster data transfer. Changes made to the data buffer contents after calling SetBuffer() will be ignored; SetBuffer() should be called whenever the data buffer contents change. kFWCommandInterfaceSyncExecute -- Setting this flag causes the command object to execute synchronously. The calling context will block until the command object has completed execution or an error occurs. Using synchronous execution can avoid kernel transitions associated with asynchronous completion and often remove the need for a state machine. kFWCommandInterfaceForceBlockRequest -- Setting this flag causes read and write transactions to use block request packets even if the payload is 4 bytes. If this flag is not set 4 byte transactions will occur using quadlet transactions.
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
302
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetMaxPacket
Set the maximum size in bytes of packets transferred by this command.
IOReturn ( *SetMaxPacket)( IOFireWireLibCommandRef self, IOByteCount maxPacketSize);
Parameters
self
Size in bytes of largest packet that should be transferred by this command. Return Value An IOReturn result code indicating whether or not the command was successfully submitted
303
SetMaxPacketSpeed
Gets the most recently received ack code for this transaction.
void ( *SetMaxPacketSpeed)( IOFireWireLibCommandRef self, IOFWSpeed speed );
Parameters
self
SetMaxRetryCount
Sets the maximum number of retries for this command.
304
Parameters
self
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
SetTarget
Set command target address
305
Parameters
self
SetTimeoutDuration
Sets the duration of the timeout for this command.
void ( *SetTimeoutDuration)( IOFireWireLibCommandRef self, UInt32 duration );
Parameters
self
306
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
307
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
308
IOFireWireReadQuadletCommandInterface
Declared in
Overview
IOFireWireReadQuadletCommandInterface -- IOFireWireLib quadlet read command object. Obsolete; do not use. Use IOFireWireReadCommandInterface v2 or newer and its function SetMaxPacket()
Tasks
Miscellaneous
Cancel
(page 310) Cancel command execution (page 311) Return command completion status. (page 311) Get command target address. (page 312) Return number of bytes transferred by this command object when it last completed execution. (page 313) Is this command object currently executing? (page 313) Set the completion handler to be called once the command completes asynchronous execution . (page 314) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
GetStatus
GetTargetAddress
GetTransferredBytes
IsExecuting
SetCallback
SetGeneration
309
SetQuads
(page 315) Set destination for read data (page 315) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 316) Set command target address (page 317)
SetRefCon
SetTarget
Submit
SubmitWithRefconAndCallback
(page 317) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 YES YES YES YES YES
310
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetTargetAddress
Get command target address.
311
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID NO YES YES YES YES YES YES YES
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value A UInt32 containing the bytes transferred value Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID YES
312
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
313
Parameters
self
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
void ( *SetGeneration)( IOFireWireLibCommandRef self, UInt32 generation);
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration().
314
SetQuads
Set destination for read data
void ( *SetQuads)( IOFireWireLibReadQuadletCommandRef self, UInt32 inQuads[], UInt32 inNumQuads);
Parameters
self
An array of quadlets
inNumQuads
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
315
SetTarget
Set command target address
void ( *SetTarget)( IOFireWireLibCommandRef self, const FWAddress *addr);
Parameters
self
316
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
317
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
318
IOFireWireRemoteIsochPortInterface
Declared in
IOFireWireLibIsoch.h
Overview
Description forthcoming
Tasks
Miscellaneous
AllocatePort
(page 320) The method is called when the port should configure its associated hardware to prepare to send or receive isochronous data on the channel number and at the speed specified. (page 321) Get reference value associated with this port. (page 321) The method is called to determine which FireWire isochronous channels and speed this port supports. (page 322) The method is called to release the hardware after the channel has been stopped. (page 322) (page 322)
GetRefCon
GetSupported
ReleasePort
SetAllocatePortHandler
SetGetSupportedHandler
SetRefCon
(page 322) Set reference value associated with this port. (page 323)
SetReleasePortHandler
319
SetStartHandler
(page 323)
SetStopHandler
(page 323)
Start
(page 324) The method is called when the port is to begin talking or listening.
Stop
(page 324) The method is called when the port is to stop talking or listening.
Instance Methods
AllocatePort
The method is called when the port should configure its associated hardware to prepare to send or receive isochronous data on the channel number and at the speed specified.
IOReturn ( *AllocatePort) ( IOFireWireLibIsochPortRef self, IOFWSpeed speed, UInt32 chan );
Parameters
self
Channel speed
chan
Channel number (-63) Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
320
GetRefCon
Get reference value associated with this port.
void* ( *GetRefCon) ( IOFireWireLibIsochPortRef self);
Parameters
self
The isoch port interface to use. Return Value The port refcon value. Discussion Set the reference value with SetRefCon()
GetSupported
The method is called to determine which FireWire isochronous channels and speed this port supports.
IOReturn ( *GetSupported) ( IOFireWireLibIsochPortRef self, IOFWSpeed *maxSpeed, UInt64 *chanSupported );
Parameters
self
A pointer to an IOFWSpeed which should be filled with the maximum speed this port can talk or listen.
chanSupported
A pointer to a UInt64 which should be filled with a bitmask representing the FireWire bus isochonous channels on which the port can talk or listen. Set '1' for supported, '' for unsupported. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
321
ReleasePort
The method is called to release the hardware after the channel has been stopped.
IOReturn ( *ReleasePort) ( IOFireWireLibIsochPortRef self );
Parameters
self
The isoch port interface to use. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
SetAllocatePortHandler
IOFireWireLibIsochPortAllocateCallback ( *SetAllocatePortHandler) ( IOFireWireLibRemoteIsochPortRef self, IOFireWireLibIsochPortAllocateCallback inHandler);
SetGetSupportedHandler
IOFireWireLibIsochPortGetSupportedCallback ( *SetGetSupportedHandler) ( IOFireWireLibRemoteIsochPortRef self, IOFireWireLibIsochPortGetSupportedCallback inHandler);
SetRefCon
Set reference value associated with this port.
322
Parameters
self
The new reference value. Discussion Retrieve the reference value with GetRefCon()
SetReleasePortHandler
IOFireWireLibIsochPortCallback ( *SetReleasePortHandler)( IOFireWireLibRemoteIsochPortRef self, IOFireWireLibIsochPortCallback inHandler);
SetStartHandler
IOFireWireLibIsochPortCallback ( *SetStartHandler)( IOFireWireLibRemoteIsochPortRef self, IOFireWireLibIsochPortCallback inHandler);
SetStopHandler
IOFireWireLibIsochPortCallback ( *SetStopHandler)( IOFireWireLibRemoteIsochPortRef self, IOFireWireLibIsochPortCallback inHandler);
323
Start
The method is called when the port is to begin talking or listening.
IOReturn ( *Start) ( IOFireWireLibIsochPortRef self );
Parameters
self
The isoch port interface to use. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
Stop
The method is called when the port is to stop talking or listening.
IOReturn ( *Stop) ( IOFireWireLibIsochPortRef self );
Parameters
self
The isoch port interface to use. Return Value Return kIOReturnSuccess on success, other return any other IOReturn error code. Discussion This method is called by the channel object to which a port has been added. Subclasses of IOFireWireIsochPortInterface override this method to support specific hardware. Do not call this method directly.
324
Instance Variables
revision
UInt32 revision;
Interface revision.
version
UInt32 version;
Interface version.
325
IOFireWireSBP2LibLoginInterface
Declared in
Overview
Supplies the login maintenance and Normal Command ORB execution portions of the API. Supplies APIs for login maintenance and command execution. Drivers can use this object to create IOFireWireSBP2LibORBInterface objects and execute them. Solicited and unsolicited status callback routines can be registered and the SBP2 services will notify the driver when the appropriate status arrives. This class also handles login maintenance. Supplies APIs for logging in and logging out and attempts to reconnect to the LUN after bus resets. The base FireWire services deliver bus reset notification via the IOKit message routine. The SBP2 services build on this behavior and deliver reconnectFailed and reconnectComplete through the message routine as well.
Tasks
Miscellaneous
createORB
(page 328) Creates a new IOFireWireSBP2ORB for this login. (page 328) Enables unsolicited status. (page 329) Returns the current login ID. (page 329) Returns the maximum command block size. (page 329) Returns the refCon set with setRefCon.
enableUnsolicitedStatus
getLoginID
getMaxCommandBlockSize
getRefCon
326
IOFireWireSBP2LibLoginInterface Tasks
ringDoorbell
(page 330) Rings the doorbell on the LUN. (page 330) Sets the value to be written to the BUSY_TIMEOUT register. (page 331) Sets the callback to be called when a fetch agent reset completes. (page 332) Sets the callback to be called when the fetch agent write completes. (page 332) Sets the callback to be called when a login attempt is complete. (page 333) Sets login configuration flags. (page 333) Sets the callback to be called when a logout attempt is complete. (page 334) Sets the maximum data transfer length for a normal command ORB. (page 334) Sets the login password. (page 335) Sets the desired reconnect duration. (page 336) Sets the login refCon. (page 336) Sets the callback to be called on normal command status. (page 337) Sets the callback to be called on normal command status. (page 337) Resets the LUN's fetch agent. (page 338) Attempts to login to the LUN. (page 338) Attempts to logout of the LUN. (page 338) Submits the given orb
setBusyTimeoutRegisterValue
setFetchAgentResetCallback
setFetchAgentWriteCallback
setLoginCallback
setLoginFlags
setLogoutCallback
setMaxPayloadSize
setPassword
setReconnectTime
setRefCon
setStatusNotify
setUnsolicitedStatusNotify
submitFetchAgentReset
submitLogin
submitLogout
submitORB
327
Instance Methods
createORB
Creates a new IOFireWireSBP2ORB for this login.
IUnknownVTbl** ( *createORB)( void *self, REFIID iid );
Parameters
self
UUID for the desired type of IOFireWireSBP2LibLoginInterface. Return Value Returns a pointer to the new ORB object. Discussion Create a new IOFireWireSBP2ORB for this login. It can be configured with it's accessors and executed with submitORB below.
enableUnsolicitedStatus
Enables unsolicited status.
IOReturn ( *enableUnsolicitedStatus)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns kIOReturnSuccess if the status enable write started successfully. Discussion After unsolicited is sent the device will not send any additional unsolicited status until a specific register is written. This serves as a sort of flow-control for unsolicited status. After unsolicited status is recieved and processed drivers will want to reenable the delivery of unsolicted status by a call to this method.
328
getLoginID
Returns the current login ID.
UInt32 ( *getLoginID)( void *self);
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns a UInt32 containing the current login ID. Discussion When we successfully login to a device. The device gives us a unique login id. This is used internally for reconnecting to the device after bus resets and for certain other management ORBs. Most drivers are probably not interested in this value.
getMaxCommandBlockSize
Returns the maximum command block size.
UInt32 ( *getMaxCommandBlockSize)( void *self);
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns a UInt32 containing the maximum command block size. Discussion The device publishes an upper limit on the size of command block that it can accept. That value can be accessed via this method.
getRefCon
Returns the refCon set with setRefCon.
329
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns the previously stored user defined value. Discussion Returns the user defined value previously stored in the login with setRefCon.
ringDoorbell
Rings the doorbell on the LUN.
IOReturn ( *ringDoorbell)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns kIOReturnSuccess if the ring started successfully. Discussion Non-immediate appends to the ORB chain may require the fetch agent state machine to be notified of the new ORB's presence. This is accomplished by writing to the so called doorbell register. This method begins one of those writes.
setBusyTimeoutRegisterValue
Sets the value to be written to the BUSY_TIMEOUT register.
330
Parameters
self
desired value of the BUSY_TIMEOUT register. Discussion 1394-1995 defines a register known as the BUSY_TIMEOUT register. This register controls the busy retry behavior of your device. The initial value for this register is 0x00000000. Which means busied transactions will not be retried. Since most devices want their transactions retired on busy acks, the SBP2 service automatically updates the BUSY_TIMEOUT register with the value specified here whenever necessary. Most drivers should set this value to 0x0000000f.
setFetchAgentResetCallback
Sets the callback to be called when a fetch agent reset completes.
void ( *setFetchAgentResetCallback)( void *self, void *refCon, IOFWSBP2StatusCallback callback );
Parameters
self
address of callback method of type FWSBP2FetchAgentWriteCallback. Discussion The fetch agent state machine on the device can be reset by a write to a specific register. The SBP2 services offer a utility method to reset the fetch agent. You can register a callback routine here to be notified when this rest write completes.
331
setFetchAgentWriteCallback
Sets the callback to be called when the fetch agent write completes.
void ( *setFetchAgentWriteCallback)( void *self, void *refCon, IOFWSBP2FetchAgentWriteCallback callback );
Parameters
self
address of callback method of type FWSBP2FetchAgentWriteCallback. Discussion When an immediate orb is executed with submitORB, it's address is written to a specific address on the device. This address is called the fetch agent. The device the reads that orb from the Mac's memory and executes it. With this call you can register to be called back when this write to the fetch agent completes. The SBP2 services guarantee that the fetch agent write will be complete before status is reported for an ORB, so for most drivers this notification is not required.
setLoginCallback
Sets the callback to be called when a login attempt is complete.
void ( *setLoginCallback)( void *self, void *refCon, IOFWSBP2LoginCallback callback );
Parameters
self
332
Discussion The supplied callback is called when a login attempt has completed. "status" in the callback's params should be checked to determine the success or failure of the login attempt. The "refCon" field in the params will return the refcon set with setRefCon. If "statusBlock" is non-null then login status was written and it has been supplied here. If the login attempt was successful then the login response will be supplied in the "loginResponse" buffer. Note: all buffers supplied to callbacks are only valid for the duration of the callback. Also, you are not to modify the contents of any supplied buffer.
setLoginFlags
Sets login configuration flags.
void ( *setLoginFlags)( void *self, UInt32 flags );
Parameters
self
the login configuration flags. Discussion Configures the login behavior according to the provided flags. Currently two flags are defined for this API. kFWSBP2ExclusiveLogin sets the exclusive login bit in the login ORB. kFWSBP2DontSynchronizeMgmtAgent allows simultaneous logins or reconnects to LUNs with a common management agent (ie LUNs in the same unit directory).
setLogoutCallback
Sets the callback to be called when a logout attempt is complete.
void ( *setLogoutCallback)( void *self, void *refCon, IOFWSBP2LogoutCallback callback );
Parameters
self
333
refCon
address of callback method of type FWSBP2LogoutCallback. Discussion The supplied callback is called when a logout attempt has completed. "status" in the callback's params should be checked to determine the success or failure of the logout attempt. The "refCon" field in the params will return the refcon set with setRefCon. If "statusBlock" is non-null then logout status was written and it has been supplied here. Note: all buffers supplied to callbacks are only valid for the duration of the callback. Also, you are not to modify the contents of any supplied buffer.
setMaxPayloadSize
Sets the maximum data transfer length for a normal command ORB.
void ( *setMaxPayloadSize)( void *self, UInt32 size );
Parameters
self
The desired maximum payload size in bytes. Discussion Sets the maximum data transfer length for a normal command ORB. This value is the maximum for all ORBs sent to this LUN. This can be trimmed further on an ORB by ORB basis, by a similar call in the IOFireWireSBP2ORB itself.
setPassword
Sets the login password.
334
Parameters
self
the length in bytes of the password buffer. Return Value Returns kIOReturnSuccess on success. Discussion Sets the login password using a buffer and a length. An alternate version exists that accepts an IOMemoryDescriptor. If the password length is 8 or less the password is copied directly into the login orb. If the length is greater than 8 the buffer is referenced by address in the login ORB. In this case the buffer is not copied and should remain allocated for the duration of the login attempt.
setReconnectTime
Sets the desired reconnect duration.
void ( *setReconnectTime)( void *self, UInt32 time );
Parameters
self
The desired reconnect timeout encoded as 2^reconnectTime seconds. Discussion The target and initiator arbitrate the duration of the reconnect timeout. Here the initiator specifies its desired timeout time in 2^reconnectTime seconds. After a successful login the device returns the actual timeout value it wishes to use. This value may be less than the reconnect timeout that the intiator specified if this is all that the device can support.
335
setRefCon
Sets the login refCon.
void ( *setRefCon)( void *self, void *refCon );
Parameters
self
a user defined value. Discussion Sets a user defined value on the login that can be retrieved later with the method getRefCon.
setStatusNotify
Sets the callback to be called on normal command status.
void ( *setStatusNotify)( void *self, void *refCon, IOFWSBP2NotifyCallback callback );
Parameters
self
Address of callback method of type FWSBP2NotifyCallback. Discussion The supplied callback is called when normal command status is recieved, when a normal command times out, or when a normal command is aborted. "notificationEvent" in the callback's params will indicate what happened. It will be set to one of the following values: kFWSBP2NormalCommandReset, kFWSBP2NormalCommandStatus, or kFWSBP2NormalCommandTimeout. If the event type is kFWSBP2NormalCommandTimeout and "len" is non-zero then "message" contains the data written to the status block.
336
setUnsolicitedStatusNotify
Sets the callback to be called on normal command status.
void ( *setUnsolicitedStatusNotify)( void *self, void *refCon, IOFWSBP2NotifyCallback callback );
Parameters
self
address of callback method of type FWSBP2NotifyCallback. Discussion The supplied callback is called when unsolicited status is recieved. "notificationEvent" in the callback's params will indicate what happened. In this case it will be set to kFWSBP2UnsolicitedStatus. If "len" is non-zero then "message" contains the data written to the status block. Note: any buffers returned by callbacks are only valid for the duration of the login and should not have their contents modified. The "refCon" field in the callback's params will return the refcon set with setRefCon.
submitFetchAgentReset
Resets the LUN's fetch agent.
IOReturn ( *submitFetchAgentReset)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns kIOReturnSuccess if the reset started successfully. Discussion The fetch agent state machine on the device can be reset by a write to a specific register. This reset can be intiated by a call to this method. Notification of the completion of this write can be had by registering a callback with the setFetchAgentResetCallback method.
337
submitLogin
Attempts to login to the LUN.
IOReturn ( *submitLogin)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns kIOReturnSuccess login has successlly begun. Discussion This call begins the login process. The login object should be configured prior to this call. If kIOReturnSuccess is returned from this call then the loginCompletion routine will be called when the login completes (successfully or unsuccesfully).
submitLogout
Attempts to logout of the LUN.
IOReturn ( *submitLogout)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibLoginInterface object. Return Value Returns kIOReturnSuccess if logout has successfully begun. Discussion This call begins the logout process. If kIOReturnSuccess is returned from this call then the logoutCompletion routine will be called when the logout completes (successfully or unsuccesfully).
submitORB
Submits the given orb
338
Parameters
self
The orb to be executed. Return Value Returns kIOReturnSuccess if the ORB has been started successfully. Discussion Starts execution of the given ORB. If the ORB is an immediate ORB it's addresss is written to the fetch agent. If it is a non immediate orb its address is appended to the last orb of the currently processing chain. The doorbell is not rung automatically it must be run manually with the ringDoorbell command described below.
339
IOFireWireSBP2LibLUNInterface
Declared in
Overview
Initial interface disovered for all drivers. The IOFireWireSBP2LibLUNInterface is the initial interface discovered by most drivers. It supplies the methods that control the operation of the LUN as a whole. Methods that control the behavior and execution of an SBP2 login session are supplied in a separate IOFireWireSBP2LibLoginInterface object. The LUN can be used to create one of these login objects. The LUN can also create IOFireWireSBP2LibManagementORBInterfaces for configuring and appending non-login related management functions. Login related management functions (ie. Login, Logout, Reconnect) are supplied by the IOFireWireSBP2LibLoginInterface. Finally the LUN can supply a reference to the IOFireWireUnit. This can be useful if a driver wishes to access the standard FireWire APIs.
Tasks
Miscellaneous
addCallbackDispatcherToRunLoop
(page 341) Adds a dispatcher for kernel callbacks to the specified runloop. (page 342) Opens a connection to a device that is not already open. (page 342) Creates a new IOFireWireSBP2LibLoginInterface object. (page 343) Creates a new IOFireWireSBP2LibMgmntORBInterface object. (page 343) Returns the refCon set with setRefCon.
close
createLogin
createMgmtORB
getRefCon
340
getSessionRef
open
(page 344) Exclusively opens a connection to the in-kernel device. (page 345) Opens a connection to a device that is already open. (page 345) Removes a dispatcher for kernel callbacks from the specified runloop. (page 346) Set callback for user space message routine. (page 346) Sets the ORB refCon.
openWithSessionRef
removeCallbackDispatcherFromRunLoop
setMessageCallback
setRefCon
Instance Methods
addCallbackDispatcherToRunLoop
Adds a dispatcher for kernel callbacks to the specified runloop.
IOReturn ( *addCallbackDispatcherToRunLoop)( void *self, CFRunLoopRef cfRunLoopRef );
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface.
cfRunLoopRef
Reference to a runloop Return Value Returns kIOReturnSuccess on success. Discussion The user space portions of the SBP2 api communicate with the in-kernel services by messaging the kernel. Similarly, the kernel messages the user space services in response. These responses need to be picked up by a piece of code. This call adds that code to the specified runloop. Most drivers will call this method on the
341
runloop that was created when your task was created. To avoid deadlock you must avoid sleeping (or spin waiting) the runloop to wait for SBP2 response. If you do this the dispatcher will never get to run and you will wait forever.
close
Opens a connection to a device that is not already open.
void ( *close)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface. Discussion Closes an exclusive access to the device. When a device is closed it may be unloaded by the kernel. If it is unloaded and then later reappears it will be represented by a different object. You won't be able to use this user client on the new object. The new object will have to be looked up in the IORegistry and a new user client will have to be opened on it.
createLogin
Creates a new IOFireWireSBP2LibLoginInterface object.
IUnknownVTbl** ( *createLogin)( void *self, REFIID iid );
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface.
iid
UUID for desired type of IOFireWireSBP2LibLoginInterface. Return Value Returns a pointer to a new IOFireWireSBP2LibLoginInterface. Discussion Creates a new IOFireWireSBP2LibLoginInterface object for the LUN. Login objects supply most of the SBP2 APIs related to login maintenance and Normal Command ORB execution.
342
createMgmtORB
Creates a new IOFireWireSBP2LibMgmntORBInterface object.
IUnknownVTbl** ( *createMgmtORB)( void *self, REFIID iid );
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface.
iid
UUID for desired type of IOFireWireSBP2LibMgmtORBInterface. Return Value Returns a pointer to a new IOFireWireSBP2Login. Discussion Creates a new IOFireWireSBP2LibMgmtORBInterface object. Management objects let you execute commands like QueryLogins, LogicalUnitReset, and AbortTask. These commands are configured after they are created here. When they are done executing (after a call to submit) the supplied completion routine will be called with the supplied refcon. Usually this refCon is the "this" pointer of completion method's object.
getRefCon
Returns the refCon set with setRefCon.
void * ( *getRefCon)( void *self);
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface. Return Value Returns the previously stored user defined value. Discussion Returns the user defined value previously stored in the ORB with setRefCon.
343
getSessionRef
Returns the session reference to an already open device.
IOFireWireSessionRef ( *getSessionRef)( void *self);
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface. Return Value Returns a sessionRef on success. Discussion Sometimes it is desirable to open multiple user clients on a device. In the case of FireWire sometimes we wish to have both the FireWire User Client and the SBP2 User Client open at the same time. The technique to arbitrate this is as follows: First open normally the device furthest from the root in the IORegistry. Second, get its sessionRef with a call to this method. Third open the device further up the chain by calling openWithSessionRef and passing the sessionRef returned from this call.
open
Exclusively opens a connection to the in-kernel device.
IOReturn ( *open)( void *self );
Parameters
self
344
Discussion Exclusively opens a connection to the in-kernel device. As long as the in-kernel device object is open, no other drivers will be able to open a connection to the device. When open the device on the bus may disappear, but the in-kernel object representing it will stay instantiated and can begin communicating with the device again if it ever reappears.
openWithSessionRef
Opens a connection to a device that is already open.
IOReturn ( *openWithSessionRef)( void *self, IOFireWireSessionRef sessionRef );
Parameters
sessionRef
Pointer to IOFireWireSBP2LibLUNInterface. Return Value Returns kIOReturnSuccess on success. Discussion Sometimes it is desirable to open multiple user clients on a device. In the case of FireWire sometimes we wish to have both the FireWire User Client and the SBP2 User Client open at the same time. The technique to arbitrate this is as follows : First open normally the device furthest from the root in the IORegistry. Second, get its sessionRef with the getSessionRef call. Third open the device further up the chain by calling this method and passing the sessionRef returned from the call in step 2.
removeCallbackDispatcherFromRunLoop
Removes a dispatcher for kernel callbacks from the specified runloop.
345
Parameters
self
setMessageCallback
Set callback for user space message routine.
void ( *setMessageCallback)( void *self, void *refCon, IOFWSBP2MessageCallback callback);
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface.
refCon
Address of completion routine. Discussion In FireWire & SBP2 bus status messages are delivered via IOKit's message routine. This routine is emulated in user space for SBP2 & FireWire messages via this callback. You should register here for bus reset, and reconnect messages.
setRefCon
Sets the ORB refCon.
346
Parameters
self
Pointer to IOFireWireSBP2LibLUNInterface.
refCon
a user defined value. Discussion Sets a user defined value on the ORB that can be retrieved later with the method getRefCon.
347
IOFireWireSBP2LibMgmtORBInterface
Declared in
Overview
Supplies non login related management ORBs. Management ORBs can be executed independent of a login, if necessary. Management ORBs are created using the IOFireWireSBP2LibLUNInterface.
Tasks
Miscellaneous
getRefCon
(page 349) Returns the current function of the management ORB. (page 349) Sets the function of the management ORB. (page 350) Sets the command to be managed by the management ORB. (page 350) Sets the command to be managed by the management ORB. (page 351) Sets the ORB completion routine. (page 351) Sets the login refCon. (page 352) Sets the response buffer for the management ORB. (page 352) Submits this ORB for execution.
setCommandFunction
setManageeLogin
setManageeORB
setORBCompleteCallback
setRefCon
setResponseBuffer
submitORB
348
Instance Methods
getRefCon
Returns the current function of the management ORB.
void * ( *getRefCon)( void *self);
Parameters
self
Pointer to a IOFireWireSBP2LibMgmtORBInterface. Return Value Returns the function of the management ORB. Discussion Returns the function of the management ORB. This is the same value that was set with setCommandFunction.
setCommandFunction
Sets the function of the management ORB.
IOReturn ( *setCommandFunction)( void *self, UInt32 function );
Parameters
self
Pointer to a IOFireWireSBP2LibMgmtORBInterface.
function
a value indicating the desired management function. Return Value Returns kIOReturnSuccess if function was a legal function. Discussion Sets the the function of the management ORB. Legal values are kFWSBP2QueryLogins, kFWSBP2AbortTask, kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset.
349
setManageeLogin
Sets the command to be managed by the management ORB.
IOReturn ( *setManageeLogin)( void *self, void *command );
Parameters
self
Pointer to a IOFireWireSBP2LibMgmtORBInterface.
command
a reference to an IOFireWireSBP2Login or an IOFireWireSBP2ORB. Return Value Returns kIOReturnSuccess on a success. Discussion All management functions except kFWSBP2QueryLogins require a reference to an ORB of some sort. kFWSBP2AbortTaskSet, kFWSBP2LogicalUnitReset, and kFWSBP2TargetReset require a reference to the login ORB. This method allows you to set the login ORB to be managed.
setManageeORB
Sets the command to be managed by the management ORB.
IOReturn ( *setManageeORB)( void *self, void *command );
Parameters
self
Pointer to a IOFireWireSBP2LibMgmtORBInterface.
command
350
Discussion All management functions except kFWSBP2QueryLogins require a reference to an ORB of some sort. kFWSBP2AbortTask requires a reference to the ORB to be aborted. This method allows you to set the Normal Command ORB to be managed.
setORBCompleteCallback
Sets the ORB completion routine.
void ( *setORBCompleteCallback)( void *self, void *refCon, IOFWSBP2ORBCompleteCallback callback );
Parameters
self
Pointer to a IOFireWireSBP2LibMgmtORBInterface.
refCon
refCon passed as first argument to completion routine Discussion Sets the completion routine to be called when the ORB finishes execution. The refCon set with setRefCon will also be passed as the third argument to the completion handler.
setRefCon
Sets the login refCon.
void ( *setRefCon)( void *self, void *refCon );
Parameters
self
Pointer to a IOFireWireSBP2LibMgmtORBInterface.
refCon
a user defined value. Discussion Sets a user defined value on the login that can be retrieved later with the method getRefCon.
351
setResponseBuffer
Sets the response buffer for the management ORB.
IOReturn ( *setResponseBuffer)( void *self, void *buf, UInt32 len );
Parameters
self
Pointer to a IOFireWireSBP2LibMgmtORBInterface.
buf
length of buffer. Return Value Returns kIOReturnSuccess on a success. Discussion Sets the response buffer for the management ORB. kFWSBP2QueryLogins returns a response to its query and needs to write it somewhere. This routine allows you to specify the location.
submitORB
Submits this ORB for execution.
IOReturn ( *submitORB)( void *self );
Parameters
self
352
IOFireWireSBP2LibORBInterface
Declared in
Overview
Represents an SBP2 normal command ORB. Supplies the APIs for configuring normal command ORBs. This includes setting the command block and writing the page tables for I/O. The ORBs are executed using the submitORB method in IOFireWireSBP2LibLoginInterface.
Tasks
Miscellaneous
getRefCon
(page 354) Returns the refCon set with setRefCon. (page 354) Creates a page table with the LSI workaround from a list of ranges. (page 355) Synchronize the buffers for input.
LSIWorkaroundSetCommandBuffersAsRanges
LSIWorkaroundSyncBuffersForInput
LSIWorkaroundSyncBuffersForOutput
(page 356) Synchronize the buffers for output. (page 356) Releases SBP2's reference to the command buffers. (page 357) Sets the command block portion of the ORB. (page 357) Creates a page table from a list of ranges. (page 358) Sets configuration flags for the ORB.
releaseCommandBuffers
setCommandBlock
setCommandBuffersAsRanges
setCommandFlags
353
setCommandGeneration
(page 359) Sets the command generation. (page 360) Sets the timeout of the ORB. (page 360) Sets max payload size for the ORB. (page 361) Sets the ORB refCon.
setCommandTimeout
setMaxORBPayloadSize
setRefCon
Instance Methods
getRefCon
Returns the refCon set with setRefCon.
void * ( *getRefCon)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface. Return Value Returns the previously stored user defined value. Discussion Returns the user defined value previously stored in the ORB with setRefCon.
LSIWorkaroundSetCommandBuffersAsRanges
Creates a page table with the LSI workaround from a list of ranges.
354
IOReturn ( *LSIWorkaroundSetCommandBuffersAsRanges)( void *self, FWSBP2VirtualRange *ranges, UInt32 withCount, UInt32 withDirection, UInt32 offset, UInt32 length );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
ranges
Number of bytes of data to map from offset. Return Value Returns KIOReturnSuccess if the page table was written successfully. Discussion Creates an LSI workaround page table with the given parameters. Any addresses mapped by this method routine must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. The SBP2 services do not release references to the command buffers just because the command has completed.
LSIWorkaroundSyncBuffersForInput
Synchronize the buffers for input.
IOReturn ( *LSIWorkaroundSyncBuffersForInput)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
355
Return Value Returns kIOReturnSuccess if sync was successful. Discussion Since double buffering may be invovled in the workaround. The driver needs to indicate when these buffers should be syncronized with the original descriptor. For data that will be input LSIWorkaroundSyncBuffersForInput should be called after receiving completion status for the ORB.
LSIWorkaroundSyncBuffersForOutput
Synchronize the buffers for output.
IOReturn ( *LSIWorkaroundSyncBuffersForOutput)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface. Return Value Returns kIOReturnSuccess if sync was successful. Discussion Since double buffering may be invovled in the workaround. The driver needs to indicate when these buffers should be syncronized with the original descriptor. For data that will be output LSIWorkaroundSyncBuffersForOutput should be called before submiting the ORB.
releaseCommandBuffers
Releases SBP2's reference to the command buffers.
IOReturn ( *releaseCommandBuffers)( void *self );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface. Return Value Returns KIOReturnSuccess if the page table was cleared successfully.
356
Discussion When you create a page table with one of the variants of setCommandBuffers. SBP2 holds on to a reference to the buffers until this method is called. This means that if a command completed and you released the buffers without calling this method you could leave FW in an inconsistent state.
setCommandBlock
Sets the command block portion of the ORB.
IOReturn ( *setCommandBlock)( void *self, void *buffer, UInt32 length );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
buffer
Number of bytes of data to copy. Return Value Returns KIOReturnSuccess if the command block was updated successfully. Discussion Copys the data provided in the buffer to the command block portion of the ORB.
setCommandBuffersAsRanges
Creates a page table from a list of ranges.
357
IOReturn ( *setCommandBuffersAsRanges)( void *self, FWSBP2VirtualRange *ranges, UInt32 withCount, UInt32 withDirection, UInt32 offset, UInt32 length );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
ranges
Number of bytes of data to map from offset. Return Value Returns KIOReturnSuccess if the page table was written successfully. Discussion Creates a page table with the given parameters. Any addresses mapped by this method must remain valid until setCommandBuffers is called again or releaseCommandBuffers is called. The SBP2 services do not release references to the command buffers just because the command has completed.
setCommandFlags
Sets configuration flags for the ORB.
void ( *setCommandFlags)( void *self, UInt32 flags );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
358
flags
The flags to be set. Discussion Sets the configuration flags for the ORB. These can be any of the following: kFWSBP2CommandCompleteNotify - Set the notify bit as specified in SBP2 standard. Set to receive completion/timeout notification on this ORB. You almost always want to set this. kFWSBP2CommandTransferDataFromTarget - Transfer direction as specified in SBP2 standard. Set if data is to be written by the device into the host's memory. kFWSBP2CommandImmediate - Immediate Append. ORB address will be written to fetch agent and not chained. It is only legal to have one immediate ORB in progress at a time. kFWSBP2CommandNormalORB - ORB format 0 - Format specified by SBP2 standard. Set this for most ORBs. kFWSBP2CommandReservedORB - ORB format 1 - Format reserved by SBP2 standard for future standardization. kFWSBP2CommandVendorORB - ORB format 2 - Format specified by SBP2 standard for vendor dependent ORBs. kFWSBP2CommandDummyORB - ORB format 3 - Format specified by SBP2 standard for dummy ORBs. kFWSBP2CommandCheckGeneration - If set upon submitORB, the ORB will only be appended if generation set with setCommandGeneration() matches the current generation. Pretty much all SBP2 drivers need sophisticated logic to track login state, so this is generally not used. kFWSBP2CommandFixedSize - Do not allocate more memory for page table if needed. If there is not enough space in the currently allocated page table, the setCommandBuffers call will fail. This is important to set if your device is the backing store, as we don't want to cause memory allocations on the paging path. kFWSBP2CommandVirtualORBs - Normally ORBs are backed by physical address spaces. Setting this flag makes this ORB backed by a pseudo address space. This can make ORBs easier to see in a bus trace. Virtual ORBs will have an address in the form of ffcX.XXXX.0000.0000. Pseudo address space backed ORBs are slower, so you won't want to set for deployment builds.
setCommandGeneration
Sets the command generation.
359
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
generation
The bus generation for command execution. Discussion This sets the bus generation this ORB should be appended in. It is only meaningful when combined with the kFWSBP2CommandCheckGeneration flags above.
setCommandTimeout
Sets the timeout of the ORB.
void ( *setCommandTimeout)( void *self, UInt32 timeout );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
timeout
The timeout duration in milliseconds. Discussion This sets the timeout for the ORB in milliseconds. Note that ORBs without timeouts can be "lost." You will obviously not recieve timeout notification for timeouts of zero. But perhaps less obviously you will not recieve orb reset notification, which is really a sort of accelerated timeout notification for bus reset situations.
setMaxORBPayloadSize
Sets max payload size for the ORB.
360
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
size
The maximum payload size in bytes. Discussion This sets the maximum payload size for this ORB only. This size is clipped by the global max payload size set in the login object.
setRefCon
Sets the ORB refCon.
void ( *setRefCon)( void *self, void *refCon );
Parameters
self
Pointer to IOFireWireSBP2LibORBInterface.
refCon
a user defined value. Discussion Sets a user defined value on the ORB that can be retrieved later with the method getRefCon.
361
IOFireWireUnitInterface
Declared in
Overview
IOFireWireDeviceInterface is your primary gateway to the functionality contained in IOFireWireLib. You can use IOFireWireDeviceInterface to:
IOFireWireReadCommandInterface IOFireWireReadQuadletCommandInterface IOFireWireWriteCommandInterface IOFireWireWriteQuadletCommandInterface IOFireWireCompareSwapCommandInterface IOFireWirePseudoAddressSpaceInterface -- pseudo address space services IOFireWirePhysicalAddressSpaceInterface -- physical address space services IOFireWireLocalUnitDirectoryInterface -- manage local unit directories in the mac IOFireWireConfigDirectoryInterface -- access and browse remote device config directories IOFireWireIsochChannelInterface -- create/manage talker and listener isoch channels IOFireWireLocalIsochPortInterface -- create local isoch ports IOFireWireRemoteIsochPortInterface -- create remote isoch ports IOFireWireDCLCommandPoolInterface -- create a DCL command pool allocator. perform synchronous read, write and lock operations perform other miscellanous bus operations, such as reset the FireWire bus. create FireWire command objects and interfaces used to perform synchronous/asynchronous read, write and lock operations. These include: create interfaces which provide a other extended services. These include:
362
IOFireWireUnitInterface Overview
create interfaces which provide isochronous services (see IOFireWireLibIsoch.h). These include:
363
IOFireWireWriteCommandInterface
Declared in
Overview
IOFireWireLib block read command object. Represents an object that is configured and submitted to issue synchronous and asynchronous block read commands. This interface contains all methods of IOFireWireCommandInterface. This interface will contain all v2 methods of IOFireWireCommandInterface when instantiated as v2 or newer.
Tasks
Miscellaneous
Cancel
(page 366) Cancel command execution (page 366) Gets the most recently received ack code for this transaction. (page 367) Set the command refCon value and callback handler, and submit the command to FireWire for execution. (page 367) Gets the refcon associated with this command (page 368) Gets the most recently received response code for this transaction. (page 368) Return command completion status.
GetAckCode
GetBuffer
GetRefCon
GetResponseCode
GetStatus
364
IOFireWireWriteCommandInterface Tasks
GetTargetAddress
(page 369) Get command target address. (page 369) Return number of bytes transferred by this command object when it last completed execution. (page 370) Is this command object currently executing? (page 371) Set the buffer where read data should be stored. (page 371) Set the completion handler to be called once the command completes asynchronous execution . (page 372) Set flags governing this command's execution. (page 373) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function. (page 374) Set the maximum size in bytes of packets transferred by this command. (page 375) Gets the most recently received ack code for this transaction. (page 375) Sets the maximum number of retries for this command. (page 376) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 376) Set command target address (page 377) Sets the duration of the timeout for this command. (page 377)
GetTransferredBytes
IsExecuting
SetBuffer
SetCallback
SetFlags
SetGeneration
SetMaxPacket
SetMaxPacketSpeed
SetMaxRetryCount
SetRefCon
SetTarget
SetTimeoutDuration
Submit
SubmitWithRefconAndCallback
(page 378) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
365
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetAckCode
Gets the most recently received ack code for this transaction.
UInt32 ( *GetAckCode)( IOFireWireLibCommandRef self );
Parameters
self
366
GetBuffer
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
void ( *GetBuffer)( IOFireWireLibCommandRef self, UInt32 *outSize, void **outBuf);
Parameters
self
The command object interface of interest Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
GetRefCon
Gets the refcon associated with this command
void * ( *GetRefCon)( IOFireWireLibCommandRef self );
Parameters
self
367
GetResponseCode
Gets the most recently received response code for this transaction.
UInt32 ( *GetResponseCode)( IOFireWireLibCommandRef self );
Parameters
self
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
368
GetTargetAddress
Get command target address.
void ( *GetTargetAddress)( IOFireWireLibCommandRef self, FWAddress *outAddr);
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID NO YES YES YES YES YES YES YES
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value A UInt32 containing the bytes transferred value
369
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
370
SetBuffer
Set the buffer where read data should be stored.
void ( *SetBuffer)( IOFireWireLibCommandRef self, UInt32 size, void *buf);
Parameters
self
A pointer to the receive buffer. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES NO NO NO YES NO YES NO
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
void ( *SetCallback)( IOFireWireLibCommandRef self, IOFireWireLibCommandCallback inCallback);
Parameters
self
371
inCallback
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetFlags
Set flags governing this command's execution.
void ( *SetFlags)( IOFireWireLibCommandRef self, UInt32 inFlags);
Parameters
self
372
inFlags
A UInt32 with bits set corresponding to the flags that should be set for this command object. The following values may be used:
kFWCommandNoFlags -- all flags off kFWCommandInterfaceForceNoCopy -- data sent by this command should always be received/sent directly from the buffer set with SetBuffer(). Whatever data is in the buffer when the command is submitted will be used. kFWCommandInterfaceForceCopyAlways -- data will always be copied out of the command object data buffer when SetBuffer() is called, up to a maximum allowed size (kFWUserCommandSubmitWithCopyMaxBufferBytes). This can result in faster data transfer. Changes made to the data buffer contents after calling SetBuffer() will be ignored; SetBuffer() should be called whenever the data buffer contents change. kFWCommandInterfaceSyncExecute -- Setting this flag causes the command object to execute synchronously. The calling context will block until the command object has completed execution or an error occurs. Using synchronous execution can avoid kernel transitions associated with asynchronous completion and often remove the need for a state machine. kFWCommandInterfaceForceBlockRequest -- Setting this flag causes read and write transactions to use block request packets even if the payload is 4 bytes. If this flag is not set 4 byte transactions will occur using quadlet transactions.
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
373
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetMaxPacket
Set the maximum size in bytes of packets transferred by this command.
IOReturn ( *SetMaxPacket)( IOFireWireLibCommandRef self, IOByteCount maxPacketSize);
Parameters
self
Size in bytes of largest packet that should be transferred by this command. Return Value An IOReturn result code indicating whether or not the command was successfully submitted
374
SetMaxPacketSpeed
Gets the most recently received ack code for this transaction.
void ( *SetMaxPacketSpeed)( IOFireWireLibCommandRef self, IOFWSpeed speed );
Parameters
self
SetMaxRetryCount
Sets the maximum number of retries for this command.
void ( *SetMaxRetryCount)( IOFireWireLibCommandRef self, UInt32 count );
Parameters
self
375
count
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
SetTarget
Set command target address
void ( *SetTarget)( IOFireWireLibCommandRef self, const FWAddress *addr);
Parameters
self
376
addr
SetTimeoutDuration
Sets the duration of the timeout for this command.
void ( *SetTimeoutDuration)( IOFireWireLibCommandRef self, UInt32 duration );
Parameters
self
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
377
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
Instance Variables
revision
UInt32 revision;
Interface revision.
378
version
UInt32 version;
Interface version.
379
IOFireWireWriteQuadletCommandInterface
Declared in
Overview
IOFireWireLib quadlet read command object. Obsolete; do not use. Use IOFireWireWriteCommandInterface v2 or newer and its function SetMaxPacket()
Tasks
Miscellaneous
Cancel
(page 381) Cancel command execution (page 382) Return command completion status. (page 382) Get command target address. (page 383) Return number of bytes transferred by this command object when it last completed execution. (page 384) Is this command object currently executing? (page 384) Set the completion handler to be called once the command completes asynchronous execution . (page 385) Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
GetStatus
GetTargetAddress
GetTransferredBytes
IsExecuting
SetCallback
SetGeneration
380
SetQuads
(page 386)
SetRefCon
(page 386) Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function. (page 387) Set command target address (page 387)
SetTarget
Submit
SubmitWithRefconAndCallback
(page 388) Set the command refCon value and callback handler, and submit the command to FireWire for execution.
Instance Methods
Cancel
Cancel command execution
IOReturn ( *Cancel)( IOFireWireLibCommandRef self, IOReturn reason);
Parameters
self
The command object interface of interest Return Value An IOReturn result code Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID YES YES YES YES YES YES
381
kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID
YES YES
GetStatus
Return command completion status.
IOReturn ( *GetStatus)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value An IOReturn error code indicating the completion error (if any) returned the last time this command object was executed Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
GetTargetAddress
Get command target address.
382
Parameters
self
A pointer to an FWAddress to contain the function result. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID NO YES YES YES YES YES YES YES
GetTransferredBytes
Return number of bytes transferred by this command object when it last completed execution.
UInt32 ( *GetTransferredBytes)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value A UInt32 containing the bytes transferred value Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID YES
383
IsExecuting
Is this command object currently executing?
const Boolean ( *IsExecuting)( IOFireWireLibCommandRef self);
Parameters
self
The command object interface of interest Return Value Returns true if the command object is executing. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetCallback
Set the completion handler to be called once the command completes asynchronous execution .
384
Parameters
self
A callback handler. Passing nil forces the command object to execute synchronously. Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
SetGeneration
Set FireWire bus generation for which the command object shall be valid. If the failOnReset attribute has been set, the command will only be considered for execution during the bus generation specified by this function.
void ( *SetGeneration)( IOFireWireLibCommandRef self, UInt32 generation);
Parameters
self
A bus generation. The current bus generation can be obtained from IOFireWireDeviceInterface::GetBusGeneration(). Discussion Availability: (for interfaces obtained with ID)
385
SetQuads
void ( *SetQuads)( IOFireWireLibWriteQuadletCommandRef self, UInt32 inQuads[], UInt32 inNumQuads);
Discussion IOFireWireLibWriteQuadletCommandRef
SetRefCon
Set the user refCon value. This is the user defined value that will be passed in the refCon argument to the completion function.
void ( *SetRefCon)( IOFireWireLibCommandRef self, void *refCon);
386
kIOFireWireReadCommandInterfaceID
YES
SetTarget
Set command target address
void ( *SetTarget)( IOFireWireLibCommandRef self, const FWAddress *addr);
Parameters
self
Submit
IOReturn ( *Submit)( IOFireWireLibCommandRef self);
387
SubmitWithRefconAndCallback
Set the command refCon value and callback handler, and submit the command to FireWire for execution.
IOReturn ( *SubmitWithRefconAndCallback)( IOFireWireLibCommandRef self, void *refCon, IOFireWireLibCommandCallback inCallback);
Parameters
self
The command object interface of interest Return Value An IOReturn result code indicating whether or not the command was successfully submitted Discussion Availability: (for interfaces obtained with ID)
kIOFireWireAsyncStreamCommandInterfaceID kIOFireWireCompareSwapCommandInterfaceID kIOFireWireWriteQuadletCommandInterfaceID kIOFireWireReadQuadletCommandInterfaceID kIOFireWireWriteCommandInterfaceID_v2 kIOFireWireWriteCommandInterfaceID kIOFireWireReadCommandInterfaceID_v2 kIOFireWireReadCommandInterfaceID YES YES YES YES YES YES YES YES
Instance Variables
revision
UInt32 revision;
Interface revision.
388
version
UInt32 version;
Interface version.
389
IOFWAsyncStreamListenerInterface
Declared in
IOFireWireLibIsoch.h
Overview
Represents and provides management functions for a asyn stream listener object.
Tasks
Miscellaneous
ClientCommandIsComplete
(page 391) Notify the async stream object that a packet notification handler has completed. (page 391) get the flags of listener. (page 392) get overrun counter from the DCL program. (page 392) Returns the user refCon value for this async stream interface. (page 392) Is notification on? (page 393) set flags for the listener. (page 393) Set the callback that should be called to handle incoming async stream packets (page 393) Set the callback that should be called when incoming packets are dropped by the address space.
GetFlags
GetOverrunCounter
GetRefCon
NotificationIsOn
SetFlags
SetListenerHandler
SetSkippedPacketHandler
390
TurnOffNotification
(page 394) Force packet notification off. (page 394) Try to turn on packet notifications for this channel.
TurnOnNotification
Instance Methods
ClientCommandIsComplete
Notify the async stream object that a packet notification handler has completed.
void ( *ClientCommandIsComplete)( IOFWAsyncStreamListenerInterfaceRef self, FWClientCommandID commandID, IOReturn status);
Parameters
self
The ID of the packet notification being completed. This is the same ID that was passed when a packet notification handler is called.
status
The completion status of the packet handler Discussion Packet notifications are received one at a time, in order. This function must be called after a packet handler has completed its work.
GetFlags
get the flags of listener.
UInt32 ( *GetFlags)( IOFWAsyncStreamListenerInterfaceRef self);
Parameters
self
391
GetOverrunCounter
get overrun counter from the DCL program.
UInt32 ( *GetOverrunCounter)( IOFWAsyncStreamListenerInterfaceRef self);
Parameters
self
The async stream interface to use. Return Value returns the counter value.
GetRefCon
Returns the user refCon value for this async stream interface.
void* ( *GetRefCon)( IOFWAsyncStreamListenerInterfaceRef self);
Parameters
self
The async stream interface to use. Return Value returns the callback object.
NotificationIsOn
Is notification on?
Boolean ( *NotificationIsOn)( IOFWAsyncStreamListenerInterfaceRef self);
Parameters
self
392
Return Value Returns true if packet notifications for this channel are active
SetFlags
set flags for the listener.
void ( *SetFlags)( IOFWAsyncStreamListenerInterfaceRef self, UInt32 flags );
Parameters
self
SetListenerHandler
Set the callback that should be called to handle incoming async stream packets
const IOFWAsyncStreamListenerHandler ( *SetListenerHandler)( IOFWAsyncStreamListenerInterfaceRef self, IOFWAsyncStreamListenerHandler inReceiver);
Parameters
self
The callback to set. Return Value Returns the callback that was previously set or nil for none.
SetSkippedPacketHandler
Set the callback that should be called when incoming packets are dropped by the address space.
393
Parameters
self
The callback to set. Return Value Returns the callback that was previously set or nil for none.
TurnOffNotification
Force packet notification off.
void ( *TurnOffNotification)( IOFWAsyncStreamListenerInterfaceRef self);
Parameters
self
TurnOnNotification
Try to turn on packet notifications for this channel.
Boolean ( *TurnOnNotification)( IOFWAsyncStreamListenerInterfaceRef self);
Parameters
self
The async stream interface to use. Return Value Returns true upon success
394
Instance Variables
revision
UInt16 revision;
Interface revision.
version
UInt16 version;
Interface version.
395
IOHIDDeviceDeviceInterface
Declared in
Overview
The object you use to access HID devices from user space, returned by version 1.5 of the IOHIDFamily. The functions listed here will work with any version of the IOHIDDeviceDeviceInterface. Note: Please note that methods declared in this interface follow the copy/get/set conventions.
Tasks
Miscellaneous
close
(page 397) Closes the task's connection to the IOHIDDevice. (page 397) Obtains a CFArrayRef containing the IOHIDDeviceDeviceInterface elements that match the passed matching dictionary. (page 398) Obtains the event source for this IOHIDDeviceDeviceInterface instance. (page 399) Obtains a property related to the IOHIDDevice. (page 399) Obtains a report of type kIOHIDReportTypeInput or kIOHIDReportTypeFeature from the IOHIDDevice. (page 401) Obtains the current value for an element.
copyMatchingElements
getAsyncEventSource
getProperty
getReport
getValue
open
396
setInputReportCallback
(page 402) Sets the input report callback to be used when data is received from the Input pipe. (page 403) Sets a property related to the IOHIDDevice. (page 404) Sends a report of type kIOHIDReportTypeOutput or kIOHIDReportTypeFeature to the IOHIDDevice. (page 405) Sets the value for an element.
setProperty
setReport
setValue
Instance Methods
close
Closes the task's connection to the IOHIDDevice.
IOReturn ( *close)( void *self, IOOptionBits options);
Parameters
self
Option bits to be passed down to the user client. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion Releases the client's access to the IOHIDDevice.
copyMatchingElements
Obtains a CFArrayRef containing the IOHIDDeviceDeviceInterface elements that match the passed matching dictionary.
397
IOReturn ( *copyMatchingElements)( void *self, CFDictionaryRef matchingDict, CFArrayRef *pElements, IOOptionBits options);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion Objects contained in the returned array are of type IOHIDElementRef. Please see IOHIDElement.h for additional API information. Elemenet properties are prefixed by kIOHIDElement and declared in IOHIDKeys.h.
getAsyncEventSource
Obtains the event source for this IOHIDDeviceDeviceInterface instance.
IOReturn ( *getAsyncEventSource)( void *self, CFTypeRef *pSource);
Parameters
self
Pointer to a CFType to return the run loop event source. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
398
getProperty
Obtains a property related to the IOHIDDevice.
IOReturn ( *getProperty)( void *self, CFStringRef key, CFTypeRef *pProperty);
Parameters
self
CFStringRef key
pProperty
Pointer to a CFTypeRef property. Return Value Returns kIOReturnSuccess if successful. Discussion Property keys are prefixed by kIOHIDDevice and declared in IOHIDKeys.h.
getReport
Obtains a report of type kIOHIDReportTypeInput or kIOHIDReportTypeFeature from the IOHIDDevice.
399
IOReturn ( *getReport)( void *self, IOHIDReportType reportType, uint32_t reportID, uint8_t *report, CFIndex *pReportLength, uint32_t timeout, IOHIDReportCallback callback, void *context, IOOptionBits options);
Parameters
self
Length of the report buffer. When finished, this will contain the actual length of the report.
timeout
Callback of type IOHIDReportCallback to be used when report data has been received from the device. If null, this method will behave synchronously.
context
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion This method is useful if specific knowledge of the unparsed report is known to the caller. Otherwise, using an IOHIDDeviceTransactionInterface with the kIOHIDTransactionDirectionTypeInput direction is recommended.
400
Note: In order to make use of asynchronous behavior, the event source obtained using getAsyncEventSource must be added to a run loop.
getValue
Obtains the current value for an element.
IOReturn ( *getValue)( void *self, IOHIDElementRef element, IOHIDValueRef *pValue, uint32_t timeout, IOHIDValueCallback callback, void *context, IOOptionBits options);
Parameters
self
Callback of type IOHIDReportCallback to be used when element value has been received from the device. If null, this method will behave synchronously.
context
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
401
Discussion If an element of type kIOHIDElementTypeFeature is passed, this method will issue a request to the IOHIDDevice. Otherwise, this will return the last value reported by the IOHIDDevice. If requesting multiple feature element values, please consider using an IOHIDDeviceTransactionInterface with the kIOHIDTransactionDirectionTypeInput direction. Note: In order to make use of asynchronous behavior, the event source obtained using getAsyncEventSource must be added to a run loop.
open
Opens the IOHIDDevice.
IOReturn ( *open)( void *self, IOOptionBits options);
Parameters
self
Option bits to be passed down to the user client. Return Value Returns kIOReturnSuccess if successful, some other mach error if the connection is no longer valid. Discussion Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes a link between the client's task and the actual device. To establish an exclusive link use the kIOHIDOptionsTypeSeizeDevice option.
setInputReportCallback
Sets the input report callback to be used when data is received from the Input pipe.
402
IOReturn ( *setInputReportCallback)( void *self, uint8_t *report, CFIndex reportLength, IOHIDReportCallback callback, void *context, IOOptionBits options);
Parameters
self
Pointer to a pre-allocated buffer to be filled and passed back via the callback.
reportLength
Callback of type IOHIDReportCallback to be used when report data has been receieved by the IOHIDDevice.
context
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion In order to function properly, the event source obtained using getAsyncEventSource must be added to a run loop.
setProperty
Sets a property related to the IOHIDDevice.
IOReturn ( *setProperty)( void *self, CFStringRef key, CFTypeRef property);
Parameters
self
403
key
CFStringRef key
property
CFTypeRef property. Return Value Returns kIOReturnSuccess if successful. Discussion Property keys are prefixed by kIOHIDDevice and declared in IOHIDKeys.h.
setReport
Sends a report of type kIOHIDReportTypeOutput or kIOHIDReportTypeFeature to the IOHIDDevice.
IOReturn ( *setReport)( void *self, IOHIDReportType reportType, uint32_t reportID, const uint8_t *report, CFIndex reportLength, uint32_t timeout, IOHIDReportCallback callback, void *context, IOOptionBits options);
Parameters
self
404
callback
Callback of type IOHIDReportCallback to be used after report data has been sent to the device. If null, this method will behave synchronously.
context
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion This method is useful if specific knowledge of the unparsed report is known to the caller. Otherwise, using an IOHIDDeviceTransactionInterface with the kIOHIDTransactionDirectionTypeOutput direction is recommended. Note: In order to make use of asynchronous behavior, the event source obtained using getAsyncEventSource must be added to a run loop.
setValue
Sets the value for an element.
IOReturn ( *setValue)( void *self, IOHIDElementRef element, IOHIDValueRef value, uint32_t timeout, IOHIDValueCallback callback, void *context, IOOptionBits options);
Parameters
self
405
callback
Callback of type IOHIDValueCallback to be used after report data has been sent to the device. If null, this method will behave synchronously.
context
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion If setting multiple element values, please consider using an IOHIDDeviceTransactionInterface with the kIOHIDTransactionDirectionTypeOutput direction. Note: In order to make use of asynchronous behavior, the event source obtained using getAsyncEventSource must be added to a run loop.
406
IOHIDDeviceInterface
Declared in
Overview
CFPlugin object subclass which provides the primary interface to HID devices.
Tasks
Miscellaneous
allocOutputTransaction
(page 408) Wrapper to return instances of the IOHIDOutputTransactionInterface. (page 408) Wrapper to return instances of the IOHIDQueueInterface. (page 408) Closes the device. (page 409) Creates async eventsource. (page 409) Creates an async port. (page 410) Gets the created async event source. (page 410) Gets the current async port. (page 410) Obtains the most recent value of an element.
allocQueue
close
createAsyncEventSource
createAsyncPort
getAsyncEventSource
getAsyncPort
getElementValue
open
407
queryElementValue
(page 411) Obtains the current value of an element. (page 412) Sets an element value on the device. (page 413) Sets callback to be used when device is removed. (page 413) Starts data delivery on all queues for this device. (page 413) Stops data delivery on all queues for this device.
setElementValue
setRemovalCallback
startAllQueues
stopAllQueues
Instance Methods
allocOutputTransaction
Wrapper to return instances of the IOHIDOutputTransactionInterface.
IOHIDOutputTransactionInterface ** ( *allocOutputTransaction) ( void *self);
allocQueue
Wrapper to return instances of the IOHIDQueueInterface.
IOHIDQueueInterface ** ( *allocQueue) ( void *self);
close
Closes the device.
408
createAsyncEventSource
Creates async eventsource.
IOReturn ( *createAsyncEventSource)( void *self, CFRunLoopSourceRef *source);
Parameters
source
Reference to CFRunLoopSourceRef that is created. Return Value Returns an IOReturn code. Discussion This method will create an async mach port, if one has not already been created.
createAsyncPort
Creates an async port.
IOReturn ( *createAsyncPort)( void *self, mach_port_t *port);
Parameters
port
Reference to mach port that is created. Return Value Returns an IOReturn code. Discussion The port must be created before any callbacks can be used.
409
getAsyncEventSource
Gets the created async event source.
CFRunLoopSourceRef ( *getAsyncEventSource)( void *self);
getAsyncPort
Gets the current async port.
mach_port_t ( *getAsyncPort)( void *self);
getElementValue
Obtains the most recent value of an element.
IOReturn ( *getElementValue)( void *self, IOHIDElementCookie elementCookie, IOHIDEventStruct *valueEvent);
Parameters
elementCookie
The event that will be filled. If a long value is present, it is up to the caller to deallocate it. Return Value Returns an IOReturn code. Discussion This call is most useful for interrupt driven elements, such as input type elements. Since feature type element values need to be polled from the device, it is recommended to use the queryElementValue method to obtain the current value. The timestamp field in the event details the last time the element value was altered.
410
open
Opens the device.
IOReturn ( *open)( void *self, uint32_t flags);
Parameters
flags
Flags to be passed down to the user client. Return Value Returns an IOReturn code.
queryElementValue
Obtains the current value of an element.
IOReturn ( *queryElementValue)( void *self, IOHIDElementCookie elementCookie, IOHIDEventStruct *valueEvent, uint32_t timeoutMS, IOHIDElementCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
elementCookie
The event that will be filled. If a long value is present, it is up to the caller to deallocate it.
timeoutMS
UNSUPPORTED.
callback
UNSUPPORTED.
callbackTarget
UNSUPPORTED.
callbackRefcon
UNSUPPORTED.
411
Return Value Returns an IOReturn code. Discussion This call is most useful for feature type elements. This method will poll the device for the current element value.
setElementValue
Sets an element value on the device.
IOReturn ( *setElementValue)( void *self, IOHIDElementCookie elementCookie, IOHIDEventStruct *valueEvent, uint32_t timeoutMS, IOHIDElementCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
elementCookie
The event that will be filled. If a long value is present, it will be copied.
timeoutMS
UNSUPPORTED.
callback
UNSUPPORTED.
callbackTarget
UNSUPPORTED.
callbackRefcon
UNSUPPORTED. Return Value Returns an IOReturn code. Discussion This call is most useful for feature type elements. It is recommended to use IOOutputTransaction for output type elements.
412
setRemovalCallback
Sets callback to be used when device is removed.
IOReturn ( *setRemovalCallback)( void *self, IOHIDCallbackFunction removalCallback, void *removalTarget, void *removalRefcon);
Parameters
removalCallback
startAllQueues
Starts data delivery on all queues for this device.
IOReturn ( *startAllQueues)( void *self);
stopAllQueues
Stops data delivery on all queues for this device.
IOReturn ( *stopAllQueues)( void *self);
413
IOHIDDeviceInterface121
Declared in
Overview
CFPlugin object subclass which provides the primary interface to HID devices. This class is a subclass of IOHIDDeviceInterface.
Tasks
Miscellaneous
getReport
(page 414) Obtains a report from the device. (page 415) Sends a report to the device.
setReport
Instance Methods
getReport
Obtains a report from the device.
414
IOReturn ( *getReport) ( void *self, IOHIDReportType reportType, uint32_t reportID, void *reportBuffer, uint32_t *reportBufferSize, uint32_t timeoutMS, IOHIDReportCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
reportType
Size of the reportBuffer in bytes. When finished, will contain the actual size of the report.
timeoutMS callback
The callback refcon passed to the callback. Return Value Returns an IOReturn code.
setReport
Sends a report to the device.
415
IOReturn ( *setReport) ( void *self, IOHIDReportType reportType, uint32_t reportID, void *reportBuffer, uint32_t reportBufferSize, uint32_t timeoutMS, IOHIDReportCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
reportType
The callback refcon passed to the callback. Return Value Returns an IOReturn code.
416
IOHIDDeviceInterface122
Declared in
Overview
CFPlugin object subclass which provides the primary interface to HID devices. This class is a subclass of IOHIDDeviceInterface121.
Tasks
Miscellaneous
copyMatchingElements
(page 417) Obtains specific elements defined by the device. (page 418) Sets the report handler callout to be called when the data is received from the Interrupt-In pipe.
setInterruptReportHandlerCallback
Instance Methods
copyMatchingElements
Obtains specific elements defined by the device.
IOReturn ( *copyMatchingElements)( void *self, CFDictionaryRef matchingDict, CFArrayRef *elements);
Parameters
matchingDict
Dictionary containg key/value pairs to match on. Pass a null value to match on all elements.
417
elements
Pointer to a CFArrayRef that will be returned by this method. It is up to the caller to release it when finished. Return Value Returns an IOReturn code. Discussion Using keys defined in IOHIDKeys.h for elements, create a matching dictonary containing items that you wish to search for. A null array indicates that no elements matching that criteria were found. Each item in the array is a reference to the same dictionary item that represents each element in the I/O Registry. It is up to the caller to release the returned array of elements.
setInterruptReportHandlerCallback
Sets the report handler callout to be called when the data is received from the Interrupt-In pipe.
IOReturn ( *setInterruptReportHandlerCallback)( void *self, void *reportBuffer, uint32_t reportBufferSize, IOHIDReportCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
reportBuffer
The callback refcon passed to the callback. Return Value Returns an IOReturn code.
418
Discussion In order for this to work correctly, you must call createAsyncPort and createAsyncEventSource.
419
IOHIDDeviceQueueInterface
Declared in
Overview
The object you use to access a HID queue from user space, returned by version 1.5 of the IOHIDFamily. The functions listed here will work with any version of the IOHIDDeviceQueueInterface. This behavior is useful when you need to keep track of all values of an input element, rather than just the most recent one. Note:Absolute element values (based on a fixed origin) will only be placed on a queue if there is a change in value.
Tasks
Miscellaneous
addElement
(page 421) Adds an element to this IOHIDDeviceQueueInterface instance. (page 421) Determines whether an element has been added to this IOHIDDeviceQueueInterface instance. (page 422) Dequeues a retained copy of an element value from the head of an IOHIDDeviceQueueInterface. (page 423) Obtains the event source for this IOHIDDeviceQueueInterface instance. (page 423) Obtains the queue depth for this IOHIDDeviceQueueInterface instance. (page 424) Removes an element from this IOHIDDeviceQueueInterface instance.
containsElement
copyNextValue
getAsyncEventSource
getDepth
removeElement
420
setDepth
(page 424) Sets the depth for this IOHIDDeviceQueueInterface instance. (page 425) Sets callback to be used when the queue transitions to non-empty. (page 425) Starts element value delivery to the queue.
setValueAvailableCallback
start
stop
Instance Methods
addElement
Adds an element to this IOHIDDeviceQueueInterface instance.
IOReturn ( *addElement)( void *self, IOHIDElementRef element, IOOptionBits options);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
containsElement
Determines whether an element has been added to this IOHIDDeviceQueueInterface instance.
421
IOReturn ( *containsElement)( void *self, IOHIDElementRef element, Boolean *pValue, IOOptionBits options);
Parameters
self
Pointer to a Boolean to return whether or not the element was found in the queue.
options
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
copyNextValue
Dequeues a retained copy of an element value from the head of an IOHIDDeviceQueueInterface.
IOReturn ( *copyNextValue)( void *self, IOHIDValueRef *pValue, uint32_t timeout, IOOptionBits options);
Parameters
self
Timeout in milliseconds before aborting an attempt to dequeue a value from the head of a queue.
options
422
Return Value Returns kIOReturnSuccess if successful, kIOReturnUnderrun if data is unavailble, or a kern_return_t if unsuccessful. Discussion Because the value is a retained copy, it is up to the caller to release the value using CFRelease. Use with setValueCallback to avoid polling the queue for data.
getAsyncEventSource
Obtains the event source for this IOHIDDeviceQueueInterface instance.
IOReturn ( *getAsyncEventSource)( void *self, CFTypeRef *pSource);
Parameters
self
Pointer to a CFType to return the run loop event source. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion The returned event source can be of type CFRunLoopSourceRef or CFRunLoopTimerRef.
getDepth
Obtains the queue depth for this IOHIDDeviceQueueInterface instance.
IOReturn ( *getDepth)( void *self, uint32_t *pDepth);
Parameters
self
Pointer to a uint32_t to obtain the number of elements that can be serviced by the queue.
423
removeElement
Removes an element from this IOHIDDeviceQueueInterface instance.
IOReturn ( *removeElement)( void *self, IOHIDElementRef element, IOOptionBits options);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
setDepth
Sets the depth for this IOHIDDeviceQueueInterface instance.
IOReturn ( *setDepth)( void *self, uint32_t depth, IOOptionBits options);
Parameters
self
The maximum number of elements in the queue before the oldest elements in the queue begin to be lost.
options
424
Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion Regardless of element value size, queue will guarantee n=depth elements will be serviced.
setValueAvailableCallback
Sets callback to be used when the queue transitions to non-empty.
IOReturn ( *setValueAvailableCallback)( void *self, IOHIDCallback callback, void *context);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion In order to make use of asynchronous behavior, the event source obtained using getAsyncEventSource must be added to a run loop.
start
Starts element value delivery to the queue.
425
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
stop
Stops element value delivery to the queue.
IOReturn ( *stop)( void *self, IOOptionBits options);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
426
IOHIDDeviceTransactionInterface
Declared in
Overview
The object you use to access a HID transaction from user space, returned by version 1.5 of the IOHIDFamily. The functions listed here will work with any version of the IOHIDDeviceTransactionInterface. This functionality is useful when either setting or getting the values for multiple parsed elements.
Tasks
Miscellaneous
addElement
(page 428) Adds an element to this IOHIDDeviceTransactionInterface instance. (page 428) Clears element transaction values for an IOHIDDeviceTransactionInterface. (page 429) Commits element transaction to an IOHIDDevice in this IOHIDDeviceTransactionInterface instance. (page 430) Checks whether an element has been added to this IOHIDDeviceTransactionInterface instance. (page 430) Obtains the event source for this IOHIDDeviceTransactionInterface instance. (page 431) Obtains the direction for this IOHIDDeviceTransactionInterface instance. (page 431) Obtains the transaction value for an element in this IOHIDDeviceTransactionInterface instance.
clear
commit
containsElement
getAsyncEventSource
getDirection
getValue
427
removeElement
(page 432) Removes an element from this IOHIDDeviceTransactionInterface instance. (page 433) Sets the direction for this IOHIDDeviceTransactionInterface instance. (page 433) Sets the transaction value for an element in this IOHIDDeviceTransactionInterface instance.
setDirection
setValue
Instance Methods
addElement
Adds an element to this IOHIDDeviceTransactionInterface instance.
IOReturn ( *addElement)( void *self, IOHIDElementRef element, IOOptionBits options);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
clear
Clears element transaction values for an IOHIDDeviceTransactionInterface.
428
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion In regards to kIOHIDTransactionDirectionTypeOutput direction, default element values will be preserved.
commit
Commits element transaction to an IOHIDDevice in this IOHIDDeviceTransactionInterface instance.
IOReturn ( *commit)( void *self, uint32_t timeout, IOHIDCallback callback, void *context, IOOptionBits options);
Parameters
self
Callback of type IOHIDCallback to be used when transaction has been completed. If null, this method will behave synchronously.
context
429
Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion In regards to kIOHIDTransactionDirectionTypeOutput direction, default element values will be used if element values are not set. If neither are set, that element will be omitted from the commit. After a transaction is committed, transaction element values will be cleared and default values preserved. Note: It is possible for elements from different reports to be present in a given transaction causing a commit to transcend multiple reports. Keep this in mind when setting a timeout.
containsElement
Checks whether an element has been added to this IOHIDDeviceTransactionInterface instance.
IOReturn ( *containsElement)( void *self, IOHIDElementRef element, Boolean *pValue, IOOptionBits options);
Parameters
self
Pointer to a Boolean to return whether or not the element was found in the transaction.
options
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
getAsyncEventSource
Obtains the event source for this IOHIDDeviceTransactionInterface instance.
430
Parameters
self
Pointer to a CFType to return the run loop event source. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion The returned event source can be of type CFRunLoopSourceRef or CFRunLoopTimerRef.
getDirection
Obtains the direction for this IOHIDDeviceTransactionInterface instance.
IOReturn ( *getDirection)( void *self, IOHIDTransactionDirectionType *pDirection);
Parameters
self
Pointer to a IOHIDTransactionDirectionType to obtain transaction direction. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion Direction constants are declared in IOHIDTransactionDirectionType.
getValue
Obtains the transaction value for an element in this IOHIDDeviceTransactionInterface instance.
431
IOReturn ( *getValue)( void *self, IOHIDElementRef element, IOHIDValueRef *pValue, IOOptionBits options);
Parameters
self
See IOHIDTransactionOption. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion Use the kIOHIDTransactionOptionDefaultOutputValue option to get the default element value.
removeElement
Removes an element from this IOHIDDeviceTransactionInterface instance.
IOReturn ( *removeElement)( void *self, IOHIDElementRef element, IOOptionBits options);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful.
432
setDirection
Sets the direction for this IOHIDDeviceTransactionInterface instance.
IOReturn ( *setDirection)( void *self, IOHIDTransactionDirectionType direction, IOOptionBits options);
Parameters
self
Reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion Direction constants are declared in IOHIDTransactionDirectionType. Changing directions is useful when dealing with elements of type kIOHIDElementTypeFeature as you use the transaction to both set and get element values.
setValue
Sets the transaction value for an element in this IOHIDDeviceTransactionInterface instance.
IOReturn ( *setValue)( void *self, IOHIDElementRef element, IOHIDValueRef value, IOOptionBits options);
Parameters
self
433
options
See IOHIDTransactionOption. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion This method is intended for use with transaction of direction kIOHIDTransactionDirectionTypeOutput. Use the kIOHIDTransactionOptionDefaultOutputValue option to set the default element value.
434
IOHIDOutputTransactionInterface
Declared in
Overview
CFPlugin object subclass which privides interface for output transactions to HID devices. Created by a IOHIDDeviceInterface object.
Tasks
Miscellaneous
addElement
(page 436) Adds an element to the transaction. (page 437) Clears the transaction. (page 437) Commits the transaction. (page 438) Creates the current transaction. (page 438) Creates an async event source. (page 438) Creates an async port. (page 439) Disposes of the current transaction. (page 439) Obtains the current event source.
clear
commit
create
createAsyncEventSource
createAsyncPort
dispose
getAsyncEventSource
435
getAsyncPort
(page 439) Obtains the current async port. (page 440) Obtains the default value of an element in a transaction. (page 440) Obtains the value of an element in a transaction. (page 441) Checks whether an element has been added to the transaction. (page 441) Removes an element from the transaction. (page 441) Sets the default value of an element in a transaction. (page 442) Sets the value of an element in a transaction.
getElementDefault
getElementValue
hasElement
removeElement
setElementDefault
setElementValue
Instance Methods
addElement
Adds an element to the transaction.
IOReturn ( *addElement) ( void *self, IOHIDElementCookie elementCookie);
Parameters
elementCookie
The element of interest. Return Value Returns an IOReturn code. Discussion If the element has already been added to transaction, an error will be returned.
436
clear
Clears the transaction.
IOReturn ( *clear)( void *self);
Return Value Returns an IOReturn code. Discussion Transaction element values will cleared. Default values will be preserved.
commit
Commits the transaction.
IOReturn ( *commit)( void *self, uint32_t timeoutMS, IOHIDCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
timeoutMS
UNSUPPORTED
callback
UNSUPPORTED
callbackTarget
UNSUPPORTED
callbackRefcon
UNSUPPORTED Return Value Returns an IOReturn code. Discussion Transaction element values, if set, will be sent to the device. Otherwise, the default element value will be used. If neither are set, that element will be omitted from the commit. After a transaction is committed, transaction element values will be cleared. Default values will be preserved.
437
create
Creates the current transaction.
IOReturn ( *create)( void *self);
Return Value Returns an IOReturn code. Discussion This method will free any memory that has been allocated for this transaction.
createAsyncEventSource
Creates an async event source.
IOReturn ( *createAsyncEventSource)( void *self, CFRunLoopSourceRef *source);
Parameters
source
The newly created event source Return Value Returns an IOReturn code. Discussion This will be used with setEventCallout.
createAsyncPort
Creates an async port.
IOReturn ( *createAsyncPort)( void *self, mach_port_t *port);
Parameters
port
438
Return Value Returns an IOReturn code. Discussion This will be used with createAsyncEventSource.
dispose
Disposes of the current transaction.
IOReturn ( *dispose)( void *self);
Return Value Returns an IOReturn code. Discussion The transaction will have to be recreated, in order to perform any operations on the transaction.
getAsyncEventSource
Obtains the current event source.
CFRunLoopSourceRef ( *getAsyncEventSource)( void *self);
getAsyncPort
Obtains the current async port.
mach_port_t ( *getAsyncPort)( void *self);
439
getElementDefault
Obtains the default value of an element in a transaction.
IOReturn ( *getElementDefault)( void *self, IOHIDElementCookie elementCookie, IOHIDEventStruct *outValueEvent);
Parameters
elementCookie
The event that will be filled. If a long value is present, it is up to the caller to deallocate it. Return Value Returns an IOReturn code. Discussion An error will be returned if the element has not been added to the transaction.
getElementValue
Obtains the value of an element in a transaction.
IOReturn ( *getElementValue)( void *self, IOHIDElementCookie elementCookie, IOHIDEventStruct *outValueEvent);
Parameters
elementCookie
The event that will be filled. If a long value is present, it is up to the caller to deallocate it. Return Value Returns an IOReturn code. Discussion An error will be returned if the element has not been added to the transaction.
440
hasElement
Checks whether an element has been added to the transaction.
Boolean ( *hasElement) ( void *self, IOHIDElementCookie elementCookie);
Parameters
elementCookie
The element of interest. Return Value Returns a Boolean value. Discussion Will return true if present, otherwise will return false.
removeElement
Removes an element from the transaction.
IOReturn ( *removeElement) ( void *self, IOHIDElementCookie elementCookie);
Parameters
elementCookie
The element of interest. Return Value Returns an IOReturn code. Discussion If the element has not been added to transaction, an error will be returned.
setElementDefault
Sets the default value of an element in a transaction.
441
Parameters
elementCookie
The event that will be filled. If a long value is present, it will be copied. Return Value Returns an IOReturn code. Discussion An error will be returned if the element has not been added to the transaction.
setElementValue
Sets the value of an element in a transaction.
IOReturn ( *setElementValue)( void *self, IOHIDElementCookie elementCookie, IOHIDEventStruct *valueEvent);
Parameters
elementCookie
The event that will be filled. If a long value is present, it will be copied. Return Value Returns an IOReturn code. Discussion An error will be returned if the element has not been added to the transaction.
442
IOHIDQueueInterface
Declared in
Overview
CFPlugin object subclass which provides an interface for input queues from HID devices. Created by an IOHIDDeviceInterface object.
Tasks
Miscellaneous
addElement
(page 444) Adds an element to the queue. (page 445) Creates the current queue. (page 445) Creates an async event source. (page 445) Creates an async port. (page 446) Disposes of the current queue. (page 446) Obtains the current event source. (page 446) Obtains the current async port. (page 447) Gets the event callout.
create
createAsyncEventSource
createAsyncPort
dispose
getAsyncEventSource
getAsyncPort
getEventCallout
443
getNextEvent
(page 447) Reads next event from the queue. (page 448) Checks whether an element has been added to the queue. (page 448) Removes an element from the queue. (page 449) Sets the event callout to be called when the queue transitions to non-empty. (page 449) Starts event delivery to the queue.
hasElement
removeElement
setEventCallout
start
stop
Instance Methods
addElement
Adds an element to the queue.
IOReturn ( *addElement)( void *self, IOHIDElementCookie elementCookie, uint32_t flags);
Parameters
elementCookie
Return Value Returns an IOReturn code. Discussion If the element has already been added to queue, an error will be returned.
444
create
Creates the current queue.
IOReturn ( *create)( void *self, uint32_t flags, uint32_t depth);
Parameters
flags
Pass kIOHIDQueueOptionsTypeEnqueueAll option to force the IOHIDQueue to enqueue all events, relative or absolute, regardless of change.
depth
The maximum number of elements in the queue before the oldest elements in the queue begin to be lost. Return Value Returns an IOReturn code.
createAsyncEventSource
Creates an async event source.
IOReturn ( *createAsyncEventSource)( void *self, CFRunLoopSourceRef *source);
Parameters
source
The newly created event source. Return Value Returns an IOReturn code. Discussion This will be used with setEventCallout.
createAsyncPort
Creates an async port.
445
Parameters
port
The newly created async port. Return Value Returns an IOReturn code. Discussion This will be used with createAsyncEventSource.
dispose
Disposes of the current queue.
IOReturn ( *dispose)( void *self);
getAsyncEventSource
Obtains the current event source.
CFRunLoopSourceRef ( *getAsyncEventSource)( void *self);
getAsyncPort
Obtains the current async port.
446
getEventCallout
Gets the event callout.
IOReturn ( *getEventCallout)( void *self, IOHIDCallbackFunction *outCallback, void **outCallbackTarget, void **outCallbackRefcon);
Parameters
outCallback
The callback refcon passed to the callback Return Value Returns an IOReturn code. Discussion This callback will be called the queue transitions to non-empty.
getNextEvent
Reads next event from the queue.
IOReturn ( *getNextEvent)( void *self, IOHIDEventStruct *event, AbsoluteTime maxTime, uint32_t timeoutMS);
Parameters
event
The event that will be filled. If a long value is present, it is up to the caller to deallocate it.
447
maxTime
UNSUPPORTED. If non-zero, limits read events to those that occurred on or before maxTime.
timeoutMS
UNSUPPORTED. The timeout in milliseconds, a zero timeout will cause this call to be non-blocking (returning queue empty) if there is a NULL callback, and blocking forever until the queue is non-empty if there is a valid callback. Return Value Returns an IOReturn code.
hasElement
Checks whether an element has been added to the queue.
Boolean ( *hasElement)( void *self, IOHIDElementCookie elementCookie);
Parameters
elementCookie
The element of interest. Return Value Returns a Boolean value. Discussion Will return true if present, otherwise will return false.
removeElement
Removes an element from the queue.
IOReturn ( *removeElement)( void *self, IOHIDElementCookie elementCookie);
Parameters
elementCookie
448
Return Value Returns an IOReturn code. Discussion If the element has not been added to queue, an error will be returned.
setEventCallout
Sets the event callout to be called when the queue transitions to non-empty.
IOReturn ( *setEventCallout)( void *self, IOHIDCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
callback
The callback refcon passed to the callback. Return Value Returns an IOReturn code. Discussion In order for this to work correctly, you must call createAsyncPort and createAsyncEventSource.
start
Starts event delivery to the queue.
IOReturn ( *start)( void *self);
449
stop
Stops event delivery to the queue.
IOReturn ( *stop)( void *self);
450
IOUPSPlugInInterface
Declared in
Overview
Represents and provides management functions for a UPS device.
Tasks
Miscellaneous
createAsyncEventSource
(page 452) Used to create an async run loop event source of the plugin. (page 452) Used to obtain the capabilities of the UPS device. (page 453) Used to poll the current state of the UPS. (page 453) Used to obtain the properties of the UPS device such as the name and transport. (page 454) Send a command to the UPS. (page 454) Set the callback that should be called to handle an event from the UPS.
getCapabilities
getEvent
getProperties
sendCommand
setEventCallback
451
Instance Methods
createAsyncEventSource
Used to create an async run loop event source of the plugin.
IOReturn ( *createAsyncEventSource)( void *thisPointer, CFTypeRef *source);
Parameters
thisPointer
Pointer to a CFTypeRef. It is expected that this point to either a CFRunLoopSourceRef or a CFRunLoopTimerRef. Return Value An IOReturn error code. Discussion This is an allocation method. Thus the caller must release the object that is returned.
getCapabilities
Used to obtain the capabilities of the UPS device.
IOReturn ( *getCapabilities)( void *thisPointer, CFSetRef *capabilities);
Parameters
thisPointer
Pointer to a CFSetRef that contains the capabilities. Return Value An IOReturn error code.
452
Discussion Keys are defined in IOPSKeys.h and begin with kIOPS. This is not an allocation method. Thus the caller does not release the CFSet that is returned.
getEvent
Used to poll the current state of the UPS.
IOReturn ( *getEvent)( void *thisPointer, CFDictionaryRef *event);
Parameters
thisPointer
Pointer to a CFDictionaryRef that contains the current event state. Return Value An IOReturn error code. Discussion Keys are defined in IOPSKeys.h and begin with kIOPS. This is not an allocation method. Thus the caller does not release the CFDictionary that is returned.
getProperties
Used to obtain the properties of the UPS device such as the name and transport.
IOReturn ( *getProperties)( void *thisPointer, CFDictionaryRef *properties);
Parameters
thisPointer
Pointer to a CFDictionaryRef that contains the properties. Return Value An IOReturn error code.
453
Discussion Property keys are defined in IOPSKeys.h. This is not an allocation method. Thus the caller does not release the CFDictionary that is returned.
sendCommand
Send a command to the UPS.
IOReturn ( *sendCommand)( void *thisPointer, CFDictionaryRef command);
Parameters
thisPointer
CFDictionaryRef that contains the command. Return Value An IOReturn error code. Discussion Command keys are defined in IOPSKeys.h and begin with kIOPSCommand. An error should be returned if your device does not know how to respond to a command.
setEventCallback
Set the callback that should be called to handle an event from the UPS.
IOReturn ( *setEventCallback)( void *thisPointer, IOUPSEventCallbackFunction callback, void *callbackTarget, void *callbackRefcon);
Parameters
thisPointer
454
callbackTarget
A user specified reference value. This will be passed to all callback functions. Return Value An IOReturn error code. Discussion The proivided callback method should be called whenever there is a change of state in the UPS. This should be used in conjunction with createAsyncEventSource.
455
IOUSBDeviceInterface
Declared in
Overview
The object you use to access USB devices from user space, returned by all versions of the IOUSBFamily currently shipping. The functions listed here will work with any version of the IOUSBDeviceInterface, including the one shipped with OS X version 10.0.
Tasks
Miscellaneous
CreateDeviceAsyncEventSource
(page 458) Creates a run loop source for delivery of all asynchronous notifications on this device. (page 458) Creates and registers a mach_port_t for asynchronous communications. (page 459) Creates an iterator to iterate over some or all of the interfaces of a device. (page 459) Sends a USB request on the default control pipe. (page 460) Sends an asynchronous USB request on the default control pipe. (page 461) Gets the current frame number of the bus to which the device is attached. (page 461) Returns the currently selected configuration in the device.
CreateDeviceAsyncPort
CreateInterfaceIterator
DeviceRequest
DeviceRequestAsync
GetBusFrameNumber
GetConfiguration
456
IOUSBDeviceInterface Tasks
GetConfigurationDescriptorPtr
(page 462) Returns a pointer to a configuration descriptor for a given index. (page 462) Returns the address of the device on its bus. (page 463) Returns the CFRunLoopSourceRef for this IOService instance. (page 463) Returns the mach_port_t port for this IOService instance. (page 464) Returns the power available to the device. (page 464) Returns the USB Class (bDeviceClass) of the device. (page 465) Returns the USB Product ID (idProduct) of the device. (page 465) Returns the USB Protocol (bDeviceProtocol) of the interface. (page 466) Returns the Device Release Number (bcdDevice) of the device. (page 466) Returns the speed of the device. (page 467) Returns the USB Subclass (bDeviceSubClass) of the device. (page 467) Returns the USB Vendor ID (idVendor) of the device. (page 468) Returns the location ID. (page 468) Returns the number of supported configurations in this device. (page 469) Tells the IOUSBFamily to issue a reset to the device. (page 469) Sets the configuration in the device. (page 470) Closes the task's connection to the IOUSBDevice.
GetDeviceAddress
GetDeviceAsyncEventSource
GetDeviceAsyncPort
GetDeviceBusPowerAvailable
GetDeviceClass
GetDeviceProduct
GetDeviceProtocol
GetDeviceReleaseNumber
GetDeviceSpeed
GetDeviceSubClass
GetDeviceVendor
GetLocationID
GetNumberOfConfigurations
ResetDevice
SetConfiguration
USBDeviceClose
457
USBDeviceOpen
Instance Methods
CreateDeviceAsyncEventSource
Creates a run loop source for delivery of all asynchronous notifications on this device.
IOReturn ( *CreateDeviceAsyncEventSource)( void *self, CFRunLoopSourceRef *source);
Parameters
self
Pointer to a CFRunLoopSourceRef to return the newly created run loop event source. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion The OS X kernel does not spawn a thread to callback to the client. Instead it delivers completion notifications (see CreateInterfaceAsyncPort). This routine wraps that port with the appropriate routing code so that the completion notifications can be automatically routed through the client's CFRunLoop.
CreateDeviceAsyncPort
Creates and registers a mach_port_t for asynchronous communications.
IOReturn ( *CreateDeviceAsyncPort)( void *self, mach_port_t *port);
Parameters
self
458
port
Pointer to a mach_port_t to return the newly created port. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion The OS X kernel does not spawn a thread to callback to the client. Instead it delivers completion notifications on this mach port. After receiving a message on this port the client is obliged to call the IOKitLib.h IODispatchCalloutFromMessage() function for decoding the notification message.
CreateInterfaceIterator
Creates an iterator to iterate over some or all of the interfaces of a device.
IOReturn ( *CreateInterfaceIterator)( void *self, IOUSBFindInterfaceRequest *req, io_iterator_t *iter);
Parameters
self
Pointer to a an io_iterator_t to contain the new iterator. Return Value Returns kIOReturnSuccess if successful or kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
DeviceRequest
Sends a USB request on the default control pipe.
459
Parameters
self
Pointer to an IOUSBDevRequest containing the request. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the device is not open for exclusive access. Discussion The device must be open to issue this call. Care should be taken when issuing a device request which changes the state of the device. Use the API, for example, to change the configuration of the device or to select an alternate setting on an interface.
DeviceRequestAsync
Sends an asynchronous USB request on the default control pipe.
IOReturn ( *DeviceRequestAsync)( void *self, IOUSBDevRequest *req, IOAsyncCallback1 callback, void *refCon);
Parameters
self
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refCon
460
Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNotOpen if the device is not open for exclusive access, or kIOUSBNoAsyncPortErr if no Async port has been created for this interface. Discussion The device must be open to issue this command. Care should be taken when issuing a device request which changes the state of the device. Use the API, for example, to change the configuration of the device or to select an alternate setting on an interface.
GetBusFrameNumber
Gets the current frame number of the bus to which the device is attached.
IOReturn ( *GetBusFrameNumber)( void *self, UInt64 *frame, AbsoluteTime *atTime);
Parameters
self
Pointer to a returned AbsoluteTime, which is the system time ("wall time") when the frame number register was read. This system time could be the time at the beginning, middle, or end of the given frame. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetConfiguration
Returns the currently selected configuration in the device.
461
Parameters
self
Pointer to UInt8 to hold the configuration value. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetConfigurationDescriptorPtr
Returns a pointer to a configuration descriptor for a given index.
IOReturn ( *GetConfigurationDescriptorPtr)( void *self, UInt8 configIndex, IOUSBConfigurationDescriptorPtr *desc);
Parameters
self
The index (zero based) of the desired config descriptor. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion Note that this will point to the data as received from the USB bus and hence will be in USB bus order (i.e. little endian). The device does not have to be open to use this function.
GetDeviceAddress
Returns the address of the device on its bus.
462
Parameters
self
Pointer to USBDeviceAddress to hold the result. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetDeviceAsyncEventSource
Returns the CFRunLoopSourceRef for this IOService instance.
CFRunLoopSourceRef ( *GetDeviceAsyncEventSource)( void *self);
Parameters
self
Pointer to the IOUSBDeviceInterface. Return Value Returns the run loop source if one has been created, 0 otherwise.
GetDeviceAsyncPort
Returns the mach_port_t port for this IOService instance.
mach_port_t ( *GetDeviceAsyncPort)( void *self);
Parameters
self
Pointer to the IOUSBDeviceInterface. Return Value Returns the port if one exists, 0 otherwise.
463
GetDeviceBusPowerAvailable
Returns the power available to the device.
IOReturn ( *GetDeviceBusPowerAvailable)( void *self, UInt32 *powerAvailable);
Parameters
self
Pointer to UInt32 to hold the power available (in 2 mA increments). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetDeviceClass
Returns the USB Class (bDeviceClass) of the device.
IOReturn ( *GetDeviceClass)( void *self, UInt8 *devClass);
Parameters
self
Pointer to UInt8 to hold the device Class. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
464
GetDeviceProduct
Returns the USB Product ID (idProduct) of the device.
IOReturn ( *GetDeviceProduct)( void *self, UInt16 *devProduct);
Parameters
self
Pointer to UInt16 to hold the ProductID. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetDeviceProtocol
Returns the USB Protocol (bDeviceProtocol) of the interface.
IOReturn ( *GetDeviceProtocol)( void *self, UInt8 *devProtocol);
Parameters
self
Pointer to UInt8 to hold the device Protocol. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
465
GetDeviceReleaseNumber
Returns the Device Release Number (bcdDevice) of the device.
IOReturn ( *GetDeviceReleaseNumber)( void *self, UInt16 *devRelNum);
Parameters
self
Pointer to UInt16 to hold the Device Release Number. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetDeviceSpeed
Returns the speed of the device.
IOReturn ( *GetDeviceSpeed)( void *self, UInt8 *devSpeed);
Parameters
self
Pointer to UInt8 to hold the speed (kUSBDeviceSpeedLow, kUSBDeviceSpeedFull, kUSBDeviceSpeedHigh, or kUSBDeviceSpeedSuper). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
466
GetDeviceSubClass
Returns the USB Subclass (bDeviceSubClass) of the device.
IOReturn ( *GetDeviceSubClass)( void *self, UInt8 *devSubClass);
Parameters
self
Pointer to UInt8 to hold the device Subclass. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetDeviceVendor
Returns the USB Vendor ID (idVendor) of the device.
IOReturn ( *GetDeviceVendor)( void *self, UInt16 *devVendor);
Parameters
self
Pointer to UInt16 to hold the vendorID. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
467
GetLocationID
Returns the location ID.
IOReturn ( *GetLocationID)( void *self, UInt32 *locationID);
Parameters
self
Pointer to UInt32 to hold the location ID. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The location ID is a 32 bit number which is unique among all USB devices in the system, and which will not change on a system reboot unless the topology of the bus itself changes. The device does not have to be open to use this function.
GetNumberOfConfigurations
Returns the number of supported configurations in this device.
IOReturn ( *GetNumberOfConfigurations)( void *self, UInt8 *numConfig);
Parameters
self
Pointer to UInt8 to hold the number of configurations. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
468
ResetDevice
Tells the IOUSBFamily to issue a reset to the device.
IOReturn ( *ResetDevice)( void *self);
Parameters
self
Pointer to the IOUSBDeviceInterface. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access. Discussion It will not reenumerate the device, which means that the cached device descriptor values will not be updated after the reset. (If you want the IOUSBFamily to reload the cached values, use the call USBDeviceReEnumerate). Prior to version 1.8.5 of the IOUSBFamily, this call also sent a message to all clients of the IOUSBDevice (IOUSBInterfaces and their drivers). The device must be open to use this function. This behavior was eliminated in version 1.8.5 of the IOUSBFamily.
SetConfiguration
Sets the configuration in the device.
IOReturn ( *SetConfiguration)( void *self, UInt8 configNum);
Parameters
self
The value of the desired configuration (from IOUSBConfigurationDescriptor.bConfigurationValue). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access.
469
Discussion Note that setting the configuration causes any existing IOUSBInterface objects attached to the IOUSBDevice to be destroyed, and all of the interfaces in the new configuration to be instantiated as new IOUSBInterface objects. The device must be open to use this function.
USBDeviceClose
Closes the task's connection to the IOUSBDevice.
IOReturn ( *USBDeviceClose)( void *self);
Parameters
self
Pointer to the IOUSBDeviceInterface. Return Value Returns kIOReturnSuccess if successful, some other mach error if the connection is no longer valid. Discussion Releases the client's exclusive access to the IOUSBDevice.
USBDeviceOpen
Opens the IOUSBDevice for exclusive access.
IOReturn ( *USBDeviceOpen)( void *self);
Parameters
self
Pointer to the IOUSBDeviceInterface. Return Value Returns kIOReturnExclusiveAccess if some other task has the device opened already, kIOReturnError if the connection with the kernel cannot be established or kIOReturnSuccess if successful. Discussion Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes an exclusive link between the client's task and the actual device.
470
IOUSBDeviceInterface182
IOUSBDeviceInterface
IOUSBLib.h (page 1142)
Overview
The object you use to access USB devices from user space, returned by the IOUSBFamily version 1.8.2 and above. The functions listed here include all of the functions defined for the IOUSBDeviceInterface and some new functions that are available on OS X version 10.0.4 and later.
Tasks
Miscellaneous
DeviceRequestAsyncTO
(page 472) Sends an asynchronous USB request on the default control pipe. (page 473) Sends a USB request on the default control pipe. (page 473) Aborts a transaction on the default control pipe. (page 474) Opens the IOUSBDevice for exclusive access. (page 474) Tells the USB Family to either suspend or resume the port to which a device is attached. (page 475) Returns the manufacturer string index in the device descriptor.
DeviceRequestTO
USBDeviceAbortPipeZero
USBDeviceOpenSeize
USBDeviceSuspend
USBGetManufacturerStringIndex
471
USBGetProductStringIndex
(page 475) Returns the product string index in the device descriptor. (page 476) Returns the serial number string index in the device descriptor.
USBGetSerialNumberStringIndex
Instance Methods
DeviceRequestAsyncTO
Sends an asynchronous USB request on the default control pipe.
IOReturn ( *DeviceRequestAsyncTO)( void *self, IOUSBDevRequestTO *req, IOAsyncCallback1 callback, void *refCon);
Parameters
self
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refCon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNotOpen if the device is not open for exclusive access, orkIOUSBNoAsyncPortErr if no Async port has been created for this interface. Discussion This function sends an asynchronous USB request on the default control pipe. The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. The device must be open to issue this command. Care should be taken when issuing a device request which changes the state of the device. Use the API, for example, to change the configuration of the device or to select an alternate setting on an interface.
472
DeviceRequestTO
Sends a USB request on the default control pipe.
IOReturn ( *DeviceRequestTO)( void *self, IOUSBDevRequestTO *req);
Parameters
self
Pointer to an IOUSBDevRequestTO containing the request. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the device is not open for exclusive access. Discussion This function sends a USB request on the default control pipe. The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. The device must be open to issue this command. Care should be taken when issuing a device request which changes the state of the device. Use the API, for example, to change the configuration of the device or to select an alternate setting on an interface.
USBDeviceAbortPipeZero
Aborts a transaction on the default control pipe.
IOReturn ( *USBDeviceAbortPipeZero)( void *self);
Parameters
self
Pointer to the IOUSBDeviceInterface. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access. Discussion The device must be open to use this function.
473
USBDeviceOpenSeize
Opens the IOUSBDevice for exclusive access.
IOReturn ( *USBDeviceOpenSeize)( void *self);
Parameters
self
Pointer to the IOUSBDeviceInterface. Return Value Returns kIOReturnExclusiveAccess if some other task has the device opened already and refuses to close it, kIOReturnError if the connection with the kernel can not be established or kIOReturnSuccess if successful. Discussion This function opens the IOUSBDevice for exclusive access. If another client has the device opened, an attempt is made to get that client to close it before returning. Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes an exclusive link between the client's task and the actual device.
USBDeviceSuspend
Tells the USB Family to either suspend or resume the port to which a device is attached.
IOReturn ( *USBDeviceSuspend)( void *self, Boolean suspend);
Parameters
self
TRUE to cause the port to be suspended, FALSE to cause it to be resumed. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access. Discussion The device must be open to use this function.
474
USBGetManufacturerStringIndex
Returns the manufacturer string index in the device descriptor.
IOReturn ( *USBGetManufacturerStringIndex)( void *self, UInt8 *msi);
Parameters
self
Pointer to UInt8 to hold the string index. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
USBGetProductStringIndex
Returns the product string index in the device descriptor.
IOReturn ( *USBGetProductStringIndex)( void *self, UInt8 *psi);
Parameters
self
Pointer to UInt8 to hold the string index. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
475
USBGetSerialNumberStringIndex
Returns the serial number string index in the device descriptor.
IOReturn ( *USBGetSerialNumberStringIndex)( void *self, UInt8 *snsi);
Parameters
self
Pointer to UInt8 to hold the string index. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
476
IOUSBDeviceInterface187
IOUSBDeviceInterface182
IOUSBLib.h (page 1142)
Overview
The object you use to access USB devices from user space, returned by the IOUSBFamily version 10.8.7 and above. The functions listed here include all of the functions defined for the IOUSBDeviceInterface, IOUSBDeviceInterface182, and some new functions that are available on OS X version 10.1.2 and later.
Tasks
Miscellaneous
USBDeviceReEnumerate
Instance Methods
USBDeviceReEnumerate
Tells the IOUSBFamily to reenumerate the device.
477
Parameters
self
A UInt32 reserved for future use. Ignored in current implementation. Set to zero. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the device is not open for exclusive access. Discussion This function will send a terminate message to all clients of the IOUSBDevice (such as IOUSBInterfaces and their drivers, as well as the current User Client), emulating an unplug of the device. The IOUSBFamily will then enumerate the device as if it had just been plugged in. This call should be used by clients wishing to take advantage of the Device Firmware Update Class specification. The device must be open to use this function.
478
IOUSBDeviceInterface197
IOUSBDeviceInterface187
IOUSBLib.h (page 1142)
Overview
The object you use to access USB devices from user space, returned by the IOUSBFamily version 1.9.7 and above. The functions listed here include all of the functions defined for the IOUSBDeviceInterface, IOUSBDeviceInterface182, IOUSBDeviceInterface187, and some new functions that are available on OS X version 10.2.3 and later.
Tasks
Miscellaneous
GetBusMicroFrameNumber
(page 479) Gets the current micro frame number of the bus to which the device is attached. (page 480) Returns the version of the IOUSBLib and the version of the IOUSBFamily.
GetIOUSBLibVersion
Instance Methods
GetBusMicroFrameNumber
Gets the current micro frame number of the bus to which the device is attached.
479
Parameters
self
Pointer to an AbsoluteTime, which should be within 1ms of the time when the bus frame number was acquired. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device does not have to be open to use this function.
GetIOUSBLibVersion
Returns the version of the IOUSBLib and the version of the IOUSBFamily.
IOReturn ( *GetIOUSBLibVersion)( void *self, NumVersion *ioUSBLibVersion, NumVersion *usbFamilyVersion);
Parameters
self
Pointer to a NumVersion structure that on return will contain the version of the IOUSBLib.
usbFamilyVersion
Pointer to a NumVersion structure that on return will contain the version of the IOUSBFamily. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
480
Discussion The device does not have to be open to use this function.
481
IOUSBDeviceInterface245
IOUSBDeviceInterface197
IOUSBLib.h (page 1142)
Overview
The object you use to access USB devices from user space, returned by the IOUSBFamily version 2.4.5 and above. The functions listed here include all of the functions defined for the IOUSBDeviceInterface, IOUSBDeviceInterface182, IOUSBDeviceInterface187, IOUSBDeviceInterface197, and some new functions that are available on OS X version 10.2.3 and later.
482
IOUSBDeviceInterface300
IOUSBDeviceInterface245
IOUSBLib.h (page 1142)
Overview
The object you use to access USB devices from user space, returned by the IOUSBFamily version 3.0.0 and above. The functions listed here include all of the functions defined for the IOUSBDeviceInterface, IOUSBDeviceInterface182, IOUSBDeviceInterface187, IOUSBDeviceInterface197, IOUSBDeviceInterface245, and some new functions that are available on OS X version 10.5 and later.
Tasks
Miscellaneous
GetBusFrameNumberWithTime
(page 483) Gets a recent frame number of the bus to which the device is attached, along with a system time corresponding to the start of that frame
Instance Methods
GetBusFrameNumberWithTime
Gets a recent frame number of the bus to which the device is attached, along with a system time corresponding to the start of that frame
483
Parameters
self
Pointer to a returned AbsoluteTime, which is the system time ("wall time") as close as possible to the beginning of that USB frame. The jitter on this value may be as much as 200 microseconds. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnUnsupported is the bus doesn't support this function. Discussion The device does not have to be open to use this function.
484
IOUSBDeviceInterface320
IOUSBDeviceInterface300
IOUSBLib.h (page 1142)
Overview
The object you use to access USB devices from user space, returned by the IOUSBFamily version 3.2.0 and above. The functions listed here include all of the functions defined for the IOUSBDeviceInterface, IOUSBDeviceInterface182, IOUSBDeviceInterface187, IOUSBDeviceInterface197, IOUSBDeviceInterface245, or IOUSBDeviceInterface300 and some new functions that are available on OS X version 10.5.4 and later.
Tasks
Miscellaneous
GetExtraPowerAllocated
(page 486) Clients can use this API to ask how much extra power has already been reserved by this device. Units are milliAmps (mA). (page 486) Returns status information about the USB device, such as whether the device is captive or whether it is in the suspended state. (page 487) Clients can use this API to reserve extra power for use by this device while the machine is asleep or while it is awake. Units are milliAmps (mA). (page 488) Clients can use this API to tell the system that they will not use power that was previously reserved by using the RequestExtraPower API.
GetUSBDeviceInformation
RequestExtraPower
ReturnExtraPower
485
Instance Methods
GetExtraPowerAllocated
Clients can use this API to ask how much extra power has already been reserved by this device. Units are milliAmps (mA).
IOReturn ( *GetExtraPowerAllocated)( void *self, UInt32 type, UInt32 *powerAllocated);
Parameters
self
Indicates whether the allocated power was to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake)
powerAllocated
Amount of power to be returned, in mA. Return Value Value returned can be 0 if no power has been allocated. Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device has to be open to use this function.
GetUSBDeviceInformation
Returns status information about the USB device, such as whether the device is captive or whether it is in the suspended state.
IOReturn ( *GetUSBDeviceInformation)( void *self, UInt32 *info);
Parameters
self
486
info
Pointer to a buffer that returns a bit field of information on the device (see the USBDeviceInformationBits in USB.h). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnUnsupported is the bus doesn't support this function. Discussion The device does not have to be open to use this function.
RequestExtraPower
Clients can use this API to reserve extra power for use by this device while the machine is asleep or while it is awake. Units are milliAmps (mA).
IOReturn ( *RequestExtraPower)( void *self, UInt32 type, UInt32 requestedPower, UInt32 *powerAvailable);
Parameters
self
Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake)
requestedPower
Amount of power that was reserved, in mA Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnUnsupported is the bus doesn't support this function. Discussion The device has to be open to use this function.
487
ReturnExtraPower
Clients can use this API to tell the system that they will not use power that was previously reserved by using the RequestExtraPower API.
IOReturn ( *ReturnExtraPower)( void *self, UInt32 type, UInt32 powerReturned);
Parameters
self
Indicates whether the power is to be used during wake or sleep (One of kUSBPowerDuringSleep or kUSBPowerDuringWake)
powerReturned
Amount of power to be returned, in mA. Return Value If the returnedPower was not previously allocated, an error will be returned. This will include the case for power that was requested for sleep but was returned for wake. Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The device has to be open to use this function.
488
IOUSBDeviceInterface500
IOUSBDeviceInterface320
IOUSBLib.h (page 1142)
Overview
The object you use to access USB devices from user space, returned by the IOUSBFamily version 3.2.0 and above. The functions listed here include all of the functions defined for the IOUSBDeviceInterface, IOUSBDeviceInterface182, IOUSBDeviceInterface187, IOUSBDeviceInterface197, IOUSBDeviceInterface245, IOUSBDeviceInterface300, or IOUSBDeviceInterface320 and some new functions that are available on OS X version 10.7.3 and later.
Tasks
Miscellaneous
GetBandwidthAvailableForDevice
(page 489) Returns the amount of bandwidth available on the bus for allocation to periodic pipes. If the device is a high or super speed device, it will be the number of bytes per microframe (125 secs). If it is a full speed device, it will be the number of bytes per frame (1ms)
Instance Methods
GetBandwidthAvailableForDevice
Returns the amount of bandwidth available on the bus for allocation to periodic pipes. If the device is a high or super speed device, it will be the number of bytes per microframe (125 secs). If it is a full speed device, it will be the number of bytes per frame (1ms)
489
Parameters
self
Pointer to UInt32 to hold the amount of bandwidth available (in bytes per frame or microframe). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion This function is useful for determining the correct AltInterface setting as well as for using SetPipePolicy. The interface does not have to be open to use this function.
490
IOUSBInterfaceInterface
Declared in
Overview
The object you use to access a USB device interface from user space, returned by all versions of the IOUSBFamily currently shipping. The functions listed here will work with any version of the IOUSBInterfaceInterface, including the one shipped with OS X version 10.0.
Tasks
Miscellaneous
AbortPipe
(page 493) Aborts any outstanding transactions on the pipe with status kIOReturnAborted. (page 494) Clears the halted bit and the data toggle bit on the pipe's endpoint in the controller. (page 494) Sends a USB request on a control pipe. (page 495) Sends an asynchronous USB request on a control pipe. (page 496) Creates a run loop source for delivery of all asynchronous notifications on this device. (page 497) Creates and registers a mach_port_t for asynchronous communications. (page 497) Returns the alternate setting currently selected in this interface.
ClearPipeStall
ControlRequest
ControlRequestAsync
CreateInterfaceAsyncEventSource
CreateInterfaceAsyncPort
GetAlternateSetting
491
IOUSBInterfaceInterface Tasks
GetBusFrameNumber
(page 497) Gets the current frame number of the bus to which the interface and its device are attached. (page 498) Returns the current configuration value set in the device (the interface will be part of that configuration.) (page 499) Returns the device of which this interface is part. (page 499) Returns the USB Product ID (idProduct) of the device of which this interface is a part. (page 500) Returns the Device Release Number (bcdDevice) of the device of which this interface is a part. (page 500) Returns the USB Vendor ID (idVendor) of the device of which this interface is a part. (page 501) Returns the CFRunLoopSourceRef for this IOService instance. (page 501) Returns the mach_port_t port for this IOService instance. (page 501) Returns the USB Class of the interface (bInterfaceClass). (page 502) Returns the interface number (zero-based index) of this interface within the current configuration of the device. (page 502) Returns the USB Protocol of the interface (bInterfaceProtocol). (page 503) Returns the USB Subclass of the interface (bInterfaceSubClass). (page 503) Returns the location ID. (page 504) Returns the number of endpoints in this interface. (page 504) Gets the properties for a pipe. (page 505) Gets the current status of a pipe.
GetConfigurationValue
GetDevice
GetDeviceProduct
GetDeviceReleaseNumber
GetDeviceVendor
GetInterfaceAsyncEventSource
GetInterfaceAsyncPort
GetInterfaceClass
GetInterfaceNumber
GetInterfaceProtocol
GetInterfaceSubClass
GetLocationID
GetNumEndpoints
GetPipeProperties
GetPipeStatus
492
ReadIsochPipeAsync
(page 506) Performs a read on an ISOCHRONOUS pipe. (page 507) Reads data on a BULK IN or an INTERRUPT pipe. (page 508) Performs an asynchronous read on a BULK IN or an INTERRUPT pipe. (page 509) Equivalent to ClearPipeStall. (page 509) Changes the AltInterface setting. (page 510) Closes the task's connection to the IOUSBInterface. (page 510) Opensthe IOUSBInterface for exclusive access. (page 511) Performs an asynchronous write on an ISOCHRONOUS pipe. (page 512) Writes data on a BULK OUT or INTERRUPT OUT pipe. (page 512) Performs an asynchronous write on a BULK OUT or INTERRUPT OUT pipe.
ReadPipe
ReadPipeAsync
ResetPipe
SetAlternateInterface
USBInterfaceClose
USBInterfaceOpen
WriteIsochPipeAsync
WritePipe
WritePipeAsync
Instance Methods
AbortPipe
Aborts any outstanding transactions on the pipe with status kIOReturnAborted.
IOReturn ( *AbortPipe)( void *self, UInt8 pipeRef);
Parameters
self
493
Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion If there are outstanding asynchronous transactions on the pipe, the callbacks will happen. Note that this command will also clear the halted bit on the endpoint in the controller, but will NOT clear the data toggle bit. If you want to clear the data toggle bit as well, see ClearPipeStall or ClearPipeStallBothEnds for more information. The interface must be open for the pipe to exist.
ClearPipeStall
Clears the halted bit and the data toggle bit on the pipe's endpoint in the controller.
IOReturn ( *ClearPipeStall)( void *self, UInt8 pipeRef);
Parameters
self
Index for the desired pipe (1 - GetNumEndpoints). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion This function also returns any outstanding transactions on the pipe with status kIOUSBTransactionReturned. If there are outstanding asynchronous transactions on the pipe, the callbacks will happen. The data toggle may need to be resynchronized. The driver may handle this by sending a ClearFeature(ENDPOINT_HALT) to the default control pipe, specifying the device's endpoint for this pipe. See also ClearPipeStallBothEnds.
ControlRequest
Sends a USB request on a control pipe.
494
Parameters
self
Index of the control pipe to use. Use zero for the default control pipe on the device.
req
Pointer to an IOUSBDevRequest containing the request. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion If the request is a standard request which will change the state of the device, the device must be open, which means you should be using the IOUSBDeviceInterface for this command.
ControlRequestAsync
Sends an asynchronous USB request on a control pipe.
IOReturn ( *ControlRequestAsync)( void *self, UInt8 pipeRef, IOUSBDevRequest *req, IOAsyncCallback1 callback, void *refCon);
Parameters
self
Index of the control pipe to use. Use zero for the default control pipe on the device.
req
495
callback
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refCon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNotOpen if the interface is not open for exclusive access, or kIOUSBNoAsyncPortErr if no Async port has been created for this interface. Discussion Use pipeRef=0 for the default device control pipe. If the request is a standard request which will change the state of the device, the device must be open, which means you should be using the IOUSBDeviceInterface for this command.
CreateInterfaceAsyncEventSource
Creates a run loop source for delivery of all asynchronous notifications on this device.
IOReturn ( *CreateInterfaceAsyncEventSource)( void *self, CFRunLoopSourceRef *source);
Parameters
self
Pointer to a CFRunLoopSourceRef to return the newly created run loop event source. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if failed. Discussion The OS X kernel does not spawn a thread to callback to the client. Instead it delivers completion notifications on a Mach port (see CreateInterfaceAsyncPort). This routine wraps that port with the appropriate routing code so that the completion notifications can be automatically routed through the client's CFRunLoop.
496
CreateInterfaceAsyncPort
Creates and registers a mach_port_t for asynchronous communications.
IOReturn ( *CreateInterfaceAsyncPort)( void *self, mach_port_t *port);
Parameters
self
Pointer to the IOUSBInterfaceInterface. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if failed. Discussion The OS X kernel does not spawn a thread to callback to the client. Instead it delivers completion notifications on this Mach port. After receiving a message on this port the client is obliged to call the IOKitLib.h: IODispatchCalloutFromMessage() function for decoding the notification message.
GetAlternateSetting
Returns the alternate setting currently selected in this interface.
IOReturn ( *GetAlternateSetting)( void *self, UInt8 *intfAltSetting);
Parameters
self
Pointer to UInt8 to hold the alternate setting value. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetBusFrameNumber
Gets the current frame number of the bus to which the interface and its device are attached.
497
Parameters
self
Pointer to an AbsoluteTime, which should be within 1ms of the time when the bus frame number was attained. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetConfigurationValue
Returns the current configuration value set in the device (the interface will be part of that configuration.)
IOReturn ( *GetConfigurationValue)( void *self, UInt8 *configVal);
Parameters
self
Pointer to UInt8 to hold the configuration value. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
498
GetDevice
Returns the device of which this interface is part.
IOReturn ( *GetDevice)( void *self, io_service_t *device);
Parameters
self
Pointer to io_service_t to hold the result. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function. The returned device can be used to create a CFPlugin to talk to the device.
GetDeviceProduct
Returns the USB Product ID (idProduct) of the device of which this interface is a part.
IOReturn ( *GetDeviceProduct)( void *self, UInt16 *devProduct);
Parameters
self
Pointer to UInt16 to hold the ProductID. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
499
GetDeviceReleaseNumber
Returns the Device Release Number (bcdDevice) of the device of which this interface is a part.
IOReturn ( *GetDeviceReleaseNumber)( void *self, UInt16 *devRelNum);
Parameters
self
Pointer to UInt16 to hold the Release Number. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetDeviceVendor
Returns the USB Vendor ID (idVendor) of the device of which this interface is a part.
IOReturn ( *GetDeviceVendor)( void *self, UInt16 *devVendor);
Parameters
self
Pointer to UInt16 to hold the vendorID. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
500
GetInterfaceAsyncEventSource
Returns the CFRunLoopSourceRef for this IOService instance.
CFRunLoopSourceRef ( *GetInterfaceAsyncEventSource)( void *self);
Parameters
self
Pointer to the IOUSBInterfaceInterface. Return Value Returns the run loop source if one has been created, 0 otherwise. Discussion (description)
GetInterfaceAsyncPort
Returns the mach_port_t port for this IOService instance.
mach_port_t ( *GetInterfaceAsyncPort)( void *self);
Parameters
self
Pointer to the IOUSBInterfaceInterface. Return Value Returns the port if one exists, 0 otherwise.
GetInterfaceClass
Returns the USB Class of the interface (bInterfaceClass).
IOReturn ( *GetInterfaceClass)( void *self, UInt8 *intfClass);
Parameters
self
501
intfClass
Pointer to UInt8 to hold the interface Class. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetInterfaceNumber
Returns the interface number (zero-based index) of this interface within the current configuration of the device.
IOReturn ( *GetInterfaceNumber)( void *self, UInt8 *intfNumber);
Parameters
self
Pointer to UInt8 to hold the interface number. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetInterfaceProtocol
Returns the USB Protocol of the interface (bInterfaceProtocol).
IOReturn ( *GetInterfaceProtocol)( void *self, UInt8 *intfProtocol);
Parameters
self
502
intfProtocol
Pointer to UInt8 to hold the interface Protocol. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetInterfaceSubClass
Returns the USB Subclass of the interface (bInterfaceSubClass).
IOReturn ( *GetInterfaceSubClass)( void *self, UInt8 *intfSubClass);
Parameters
self
Pointer to UInt8 to hold the interface Subclass. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetLocationID
Returns the location ID.
IOReturn ( *GetLocationID)( void *self, UInt32 *locationID);
Parameters
self
503
Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The location ID is a 32 bit number which is unique among all USB devices in the system, and which will not change on a system reboot unless the topology of the bus itself changes. The interface does not have to be open to use this function.
GetNumEndpoints
Returns the number of endpoints in this interface.
IOReturn ( *GetNumEndpoints)( void *self, UInt8 *intfNumEndpoints);
Parameters
self
Pointer to UInt8 to hold the number of endpoints. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetPipeProperties
Gets the properties for a pipe.
504
IOReturn ( *GetPipeProperties)( void *self, UInt8 pipeRef, UInt8 *direction, UInt8 *number, UInt8 *transferType, UInt16 *maxPacketSize, UInt8 *interval);
Parameters
self
Pointer to an UInt8 to get the interval for polling the pipe for data (in milliseconds). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion Once an interface is opened, all of the pipes in that interface get created by the kernel. The number of pipes can be retrieved by GetNumEndpoints. The client can then get the properties of any pipe using an index of 1 to GetNumEndpoints. Pipe 0 is the default control pipe in the device.
GetPipeStatus
Gets the current status of a pipe.
505
Parameters
self
Index for the desired pipe (1 - GetNumEndpoints). Return Value Returns kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Otherwise, the status of the pipe is returned. Returns kIOUSBPipeStalled if the pipe is stalled. See ClearPipeStall or ClearPipeStallBothEnds for more information. Discussion The interface must be open for the pipe to exist.
ReadIsochPipeAsync
Performs a read on an ISOCHRONOUS pipe.
IOReturn ( *ReadIsochPipeAsync)( void *self, UInt8 pipeRef, void *buf, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, IOAsyncCallback1 callback, void *refcon);
Parameters
self
The bus frame number on which to start the read (obtained from GetBusFrameNumber).
506
numFrames
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist.
ReadPipe
Reads data on a BULK IN or an INTERRUPT pipe.
IOReturn ( *ReadPipe)( void *self, UInt8 pipeRef, void *buf, UInt32 *size);
Parameters
self
On entry: a pointer to the size of the buffer pointed to by buf. On exit: a pointer to the number of bytes actually read from the device.
507
Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist.
ReadPipeAsync
Performs an asynchronous read on a BULK IN or an INTERRUPT pipe.
IOReturn ( *ReadPipeAsync)( void *self, UInt8 pipeRef, void *buf, UInt32 size, IOAsyncCallback1 callback, void *refcon);
Parameters
self
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the interface is not open for exclusive access.
508
ResetPipe
Equivalent to ClearPipeStall.
IOReturn ( *ResetPipe)( void *self, UInt8 pipeRef);
Parameters
self
Index for the desired pipe (1 - GetNumEndpoints). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist.
SetAlternateInterface
Changes the AltInterface setting.
IOReturn ( *SetAlternateInterface)( void *self, UInt8 alternateSetting);
Parameters
self
The new alternate setting for the interface. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access.
509
USBInterfaceClose
Closes the task's connection to the IOUSBInterface.
IOReturn ( *USBInterfaceClose)( void *self);
Parameters
self
Pointer to the IOUSBInterfaceInterface. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion Releases the client's exclusive access to the IOUSBInterface.
USBInterfaceOpen
Opensthe IOUSBInterface for exclusive access.
IOReturn ( *USBInterfaceOpen)( void *self);
Parameters
self
Pointer to the IOUSBInterfaceInterface. Return Value Returns kIOReturnExclusiveAccess if some other task has the device opened already, kIOReturnError if the connection with the kernel cannot be established or kIOReturnSuccess if successful. Discussion Before the client can transfer data to and from the interface, it must have succeeded in opening the interface. This establishes an exclusive link between the client's task and the actual interface device. Opening the interface causes pipes to be created on each endpoint contained in the interface. If the interface contains isochronous endpoints, an attempt is made to allocate bandwidth on the bus for each of those pipes. If there is not enough bandwidth available, an isochronous pipe may be created with a bandwidth of zero. The software must then call SetPipePolicy to change the size of that pipe before it can be used for I/O.
510
WriteIsochPipeAsync
Performs an asynchronous write on an ISOCHRONOUS pipe.
IOReturn ( *WriteIsochPipeAsync)( void *self, UInt8 pipeRef, void *buf, UInt64 frameStart, UInt32 numFrames, IOUSBIsocFrame *frameList, IOAsyncCallback1 callback, void *refcon);
Parameters
self
The bus frame number on which to start the write (obtained from GetBusFrameNumber).
numFrames
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist.
511
WritePipe
Writes data on a BULK OUT or INTERRUPT OUT pipe.
IOReturn ( *WritePipe)( void *self, UInt8 pipeRef, void *buf, UInt32 size);
Parameters
self
The size of the data buffer. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist.
WritePipeAsync
Performs an asynchronous write on a BULK OUT or INTERRUPT OUT pipe.
512
IOReturn ( *WritePipeAsync)( void *self, UInt8 pipeRef, void *buf, UInt32 size, IOAsyncCallback1 callback, void *refcon);
Parameters
self
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist.
513
IOUSBInterfaceInterface182
IOUSBInterfaceInterface
IOUSBLib.h (page 1142)
Overview
The object you use to access a USB device interface from user space, returned by the IOUSBFamily version 1.8.2 and above. The functions listed here include all of the functions defined for the IOUSBInterfaceInterface and some new functions that are available on OS X version 10.0.4 and later.
Tasks
Miscellaneous
ControlRequestAsyncTO
(page 515) Sends an asynchronous USB request on a control pipe. (page 516) Sends a USB request on a control pipe. (page 516) Performs an asynchronous read on a BULK IN pipe, with specified timeout values. (page 518) Performs a read on a BULK IN pipe, specifying timeout values. (page 519) Returns the string index in the interface descriptor. (page 519) Performs an asynchronous write on a BULK OUT pipe, with specified timeout values.
ControlRequestTO
ReadPipeAsyncTO
ReadPipeTO
USBInterfaceGetStringIndex
WritePipeAsyncTO
514
WritePipeTO
(page 521) Performs an asynchronous write on a BULK OUT pipe, with specified timeout values.
Instance Methods
ControlRequestAsyncTO
Sends an asynchronous USB request on a control pipe.
IOReturn ( *ControlRequestAsyncTO)( void *self, UInt8 pipeRef, IOUSBDevRequestTO *req, IOAsyncCallback1 callback, void *refCon);
Parameters
self
Index of the control pipe to use. Use zero for the default control pipe on the device.
req
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refCon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. Use pipeRef=0 for the default device control pipe. If the request is a standard request which will change the state of the device, the device must be open, which means you should be using the IOUSBDeviceInterface for this command.
515
ControlRequestTO
Sends a USB request on a control pipe.
IOReturn ( *ControlRequestTO)( void *self, UInt8 pipeRef, IOUSBDevRequestTO *req);
Parameters
self
Index of the control pipe to use. Use zero for the default control pipe on the device.
req
Pointer to an IOUSBDevRequestTO containing the request. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnAborted if the thread is interrupted before the call completes, kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The IOUSBDevRequestTO structure allows the client to specify timeout values for this request. If the request is a standard request which will change the state of the device, the device must be open, which means you should be using the IOUSBDeviceInterface for this command.
ReadPipeAsyncTO
Performs an asynchronous read on a BULK IN pipe, with specified timeout values.
516
IOReturn ( *ReadPipeAsyncTO)( void *self, UInt8 pipeRef, void *buf, UInt32 size, UInt32 noDataTimeout, UInt32 completionTimeout, IOAsyncCallback1 callback, void *refcon);
Parameters
self
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.
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.
callback
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Returns kIOReturnBadArgument if timeout values are specified for an interrupt pipe. If an error is returned, the size parameter is not updated and the buffer will NOT contain any valid data. Discussion The interface must be open for the pipe to exist.
517
If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See ClearPipeStall or ClearPipeStallBothEnds. Timeouts do not apply to interrupt pipes, so you should use the ReadPipeAsync API to perform an asynchronous read from an interrupt pipe.
ReadPipeTO
Performs a read on a BULK IN pipe, specifying timeout values.
IOReturn ( *ReadPipeTO)( void *self, UInt8 pipeRef, void *buf, UInt32 *size, UInt32 noDataTimeout, UInt32 completionTimeout);
Parameters
self
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.
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. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the interface is not open for exclusive access. Returns kIOReturnBadArgument if timeout values are specified for an interrupt pipe. If an error is returned, the size parameter is not updated and the buffer will NOT contain any valid data.
518
Discussion The interface must be open for the pipe to exist. If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See ClearPipeStall or ClearPipeStallBothEnds. Timeouts do not apply to interrupt pipes, so you should use the ReadPipe API to perform a read from an interrupt pipe.
USBInterfaceGetStringIndex
Returns the string index in the interface descriptor.
IOReturn ( *USBInterfaceGetStringIndex)( void *self, UInt8 *si);
Parameters
self
Pointer to UInt8 to hold the string index. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
WritePipeAsyncTO
Performs an asynchronous write on a BULK OUT pipe, with specified timeout values.
519
IOReturn ( *WritePipeAsyncTO)( void *self, UInt8 pipeRef, void *buf, UInt32 size, UInt32 noDataTimeout, UInt32 completionTimeout, IOAsyncCallback1 callback, void *refcon);
Parameters
self
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.
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.
callback
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist. If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See ClearPipeStall or ClearPipeStallBothEnds.
520
WritePipeTO
Performs an asynchronous write on a BULK OUT pipe, with specified timeout values.
IOReturn ( *WritePipeTO)( void *self, UInt8 pipeRef, void *buf, UInt32 size, UInt32 noDataTimeout, UInt32 completionTimeout);
Parameters
self
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.
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. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnAborted if the thread is interrupted before the call completes, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion The interface must be open for the pipe to exist. If a timeout is specified and the request times out, the driver may need to resynchronize the data toggle. See ClearPipeStall or ClearPipeStallBothEnds.
521
IOUSBInterfaceInterface183
IOUSBInterfaceInterface182
IOUSBLib.h (page 1142)
Overview
The object you use to access a USB device interface from user space, returned by the IOUSBFamily version 1.8.3 and above. The functions listed here include all of the functions defined for the IOUSBInterfaceInterface, IOUSBInterfaceInterface182, and some new functions that are available on OS X version 10.1 and later.
Tasks
Miscellaneous
USBInterfaceOpenSeize
Instance Methods
USBInterfaceOpenSeize
Opens the IOUSBInterface for exclusive access.
IOReturn ( *USBInterfaceOpenSeize)( void *self);
Parameters
self
522
Return Value Returns kIOReturnExclusiveAccess if some other task has the interface open already and refuses to close it, kIOReturnError if the connection with the kernel cannot be established or kIOReturnSuccess if successful. Discussion If another client has the device open, an attempt is made to get that client to close it before returning. Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes an exclusive link between the clients task and the actual device.
523
IOUSBInterfaceInterface190
IOUSBInterfaceInterface183
IOUSBLib.h (page 1142)
Overview
The object you use to access a USB device interface from user space, returned by the IOUSBFamily version 1.9 and above. The functions listed here include all of the functions defined for the IOUSBInterfaceInterface, IOUSBInterfaceInterface182, IOUSBInterfaceInterface183, and some new functions that are available on OS X version 10.2 and later.
Tasks
Miscellaneous
ClearPipeStallBothEnds
(page 525) Equivalent to ClearPipeStall. (page 525) Returns the amount of bandwidth available on the bus for allocation to isochronous pipes. If the device is a high speed device, it will be the number of bytes per microframe (125 secs). If it is a full speed device, it will be the number of bytes per frame (1ms) (page 526) Returns the transfer type, max packet size, and interval of a specified endpoint, whether or not the endpoint has a pipe currently established. (page 527) Changes the amount of bandwidth of an isochronous pipe or interrupt pipe, or the polling interval of an interrupt pipe.
GetBandwidthAvailable
GetEndpointProperties
SetPipePolicy
524
Instance Methods
ClearPipeStallBothEnds
Equivalent to ClearPipeStall.
IOReturn ( *ClearPipeStallBothEnds)( void *self, UInt8 pipeRef);
Parameters
self
Index for the desired pipe (1 - GetNumEndpoints). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Discussion This function is equivalent to ClearPipeStall except that it also attempts to clear the halt and toggle bits on the device's endpoint for the pipe by sending a ClearFeature(ENDPOINT_HALT) to the default control pipe in the device, specifying the endpoint for the pipe represented by pipeRef. For most devices, this resynchronizes the data toggle between the two endpoints to ensure that there is no loss of data.
GetBandwidthAvailable
Returns the amount of bandwidth available on the bus for allocation to isochronous pipes. If the device is a high speed device, it will be the number of bytes per microframe (125 secs). If it is a full speed device, it will be the number of bytes per frame (1ms)
IOReturn ( *GetBandwidthAvailable)( void *self, UInt32 *bandwidth);
Parameters
self
Pointer to UInt32 to hold the amount of bandwidth available (in bytes per 1ms frame).
525
Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion This function is useful for determining the correct AltInterface setting as well as for using SetPipePolicy. The interface does not have to be open to use this function.
GetEndpointProperties
Returns the transfer type, max packet size, and interval of a specified endpoint, whether or not the endpoint has a pipe currently established.
IOReturn ( *GetEndpointProperties)( void *self, UInt8 alternateSetting, UInt8 endpointNumber, UInt8 direction, UInt8 *transferType, UInt16 *maxPacketSize, UInt8 *interval);
Parameters
self
Pointer to UInt8 to hold the endpoint's transfer type (kUSBControl, kUSBIsoc, etc).
maxPacketSize
Pointer to UInt8 to hold the polling interval for interrupt endpoints. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
526
Discussion This function may be useful for determining which alternate interface to select when trying to balance bandwidth allocations among isochronous pipes. The interface does not have to be open to use this function.
SetPipePolicy
Changes the amount of bandwidth of an isochronous pipe or interrupt pipe, or the polling interval of an interrupt pipe.
IOReturn ( *SetPipePolicy)( void *self, UInt8 pipeRef, UInt16 maxPacketSize, UInt8 maxInterval);
Parameters
self
The desired size for the isochronous or interrupt pipe. Valid values are 0 through the maxPacketSize defined in the endpoint descriptor.
maxInterval
the desired polling interval in milliseconds, up to a maximum of 128 ms. The system can only poll devices powers of 2 (1, 2, 4, 8, 16, 32, 64, or 128 ms). A value of 0 is illegal. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. May also return kIOReturnNoBandwidth if there is not enough bandwidth available on the bus, or kIOReturnBadArgument if the desired maxPacketSize is outside of the allowed range. Discussion A pipe may be made smaller or larger (up to the maxPacketSize specified in the endpoint descriptor). When an interface is first opened, all pipes are created with their descriptor-supplied maxPacketSize. For isochronous or interrupt pipes, if there is not enough bandwidth on the bus to allocate to the pipe, the pipe is created with a reserved bandwidth of zero. Any attempts to transfer data on a pipe with zero bandwidth will result in a kIOReturnNoBandwidth error. The pipe must first be given some bandwidth using this call. This can also be
527
used to return bandwidth for an isochronous or an interrupt pipe. If the driver knows that the device will not be sending the maxPacketSize data, it can use this call to return that unused bandwidth to the system. If an interrupt pipe wants to change the polling interval, it can do so with this call. The interface must be open for the pipe to exist.
528
IOUSBInterfaceInterface192
IOUSBInterfaceInterface190
IOUSBLib.h (page 1142)
Overview
The object you use to access a USB device interface from user space, returned by the IOUSBFamily version 1.9.2 and above. The functions listed here include all of the functions defined for the IOUSBInterfaceInterface, IOUSBInterfaceInterface182, IOUSBInterfaceInterface183, IOUSBInterfaceInterface190, and some new functions that are available on OS X version 10.2.3 and later.
Tasks
Miscellaneous
LowLatencyCreateBuffer
(page 530) Allocates a buffer of type bufferType. (page 531) Releases a buffer that was previously allocated using LowLatencyCreateBuffer(). (page 531) Performs an asynchronous read on a isochronous pipe and updates the frame list at primary interrupt time. (page 534) Performs an asynchronous write on an isochronous pipe and updates the frame list at primary interrupt time.
LowLatencyDestroyBuffer
LowLatencyReadIsochPipeAsync
LowLatencyWriteIsochPipeAsync
529
Instance Methods
LowLatencyCreateBuffer
Allocates a buffer of type bufferType.
IOReturn ( *LowLatencyCreateBuffer)( void *self, void **buffer, IOByteCount size, UInt32 bufferType);
Parameters
self
Pointer to a pointer that will receive the pointer to the buffer created by this call.
size
Type of buffer: one of kUSBLowLatencyWriteBuffer, kUSBLowLatencyReadBuffer, or kUSBLowLatencyFrameListBuffer. See the documentation for USB.h. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. If the buffer can't be allocated, it will return kIOReturnNoMemory. Discussion This function allocates a buffer of type bufferType. The buffer can then be used with the LowLatencyIsochReadPipeAsync() or LowLatencyIsochWritePipeAsync() calls. The LowLatencyIsochReadPipeAsync() or LowLatencyIsochWritePipeAsync() calls require the clients to pre-allocate the data buffer and the frame list buffer parameters. This call is used to allocate those buffers. After the client is done using the buffers, they need to be released through the LowLatencyDestroyBuffer() call. If the buffer is to be used for reading data, the type passed in should be kUSBLowLatencyReadBuffer. If the buffer is to be used for writing data, the type should be kUSBLowLatencyWriteBuffer. For frame list data, the type should be kUSBLowLatencyFrameListBuffer.
530
The client can create multiple data and frame list buffers, or it can allocate a large buffer and then use only a portion of the buffer in calls to LowLatencyReadIsochPipeAsync() or LowLatencyWriteIsochPipeAsync(). The interface must be open for the pipe to exist.
LowLatencyDestroyBuffer
Releases a buffer that was previously allocated using LowLatencyCreateBuffer().
IOReturn ( *LowLatencyDestroyBuffer) ( void *self, void *buffer );
Parameters
self
Pointer to the buffer previously allocated using LowLatencyCreateBuffer(). Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. If the buffer was not previously allocated using LowLatencyCreateBuffer() it will return kIOReturnBadArgument. Discussion The interface must be open for the pipe to exist.
LowLatencyReadIsochPipeAsync
Performs an asynchronous read on a isochronous pipe and updates the frame list at primary interrupt time.
531
IOReturn ( *LowLatencyReadIsochPipeAsync)( void *self, UInt8 pipeRef, void *buf, UInt64 frameStart, UInt32 numFrames, UInt32 updateFrequency, IOUSBLowLatencyIsocFrame *frameList, IOAsyncCallback1 callback, void *refcon);
Parameters
self
Buffer to hold the data, previously allocated with LowLatencyCreateBuffer() using a kUSBLowLatencyReadBuffer type.
frameStart
The bus frame number on which to start the read (obtained from GetBusFrameNumber).
numFrames
Specifies how often, in milliseconds, the frame list data should be updated. Valid range is 0 - 8. If 0, it means that the framelist should be updated at the end of the transfer.
frameList
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
Arbitrary pointer which is passed as a parameter to the callback routine. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Will return kIOUSBLowLatencyBufferNotPreviouslyAllocated or kIOUSBLowLatencyFrameListNotPreviouslyAllocated if the buffer or the frameList were not previously allocated using LowLatencyCreateBuffer().
532
Discussion The LowLatencyReadIsochPipeAsync() and LowLatencyWriteIsochPipeAsync() calls are analogous to ReadIsochPipeAsync() and WriteIsochPipeAsync(). They differ in that the frame list data is updated at primary interrupt time . This means that the client can inspect the frStatus and frActCount fields as soon as the transaction completes, without having to wait for the callback to happen (depending on the value of updateFrequency). The callback will still happen when all the frames have been received. The client can specify how often the USB stack should update the frame list data by specifying the updateFrequency: this value can range from 0 - 8. If the value is between 1 and 8, the frame list will be updated every updateFrequency milliseconds. If the value is 0, the frame list will only be updated once all the frames in the transfer have been received. For example, consider a transfer with numFrames equal to 64. If the update frequency is 4, the frame list data will be updated every 4 milliseconds. If the update frequency is 0, the frame list will only be updated at the end of the transfer, after the 64 frames have been sent or received. The difference between using an update frequency of 0 and using the non-low latency isoch calls is that in the former case, the frame list will be updated at primary interrupt time, while in the latter, it will be updated at secondary interrupt time. Regardless of the value of updateFrequency, the frame list will always be updated on the last frame of a transfer. The rationale for adding this call is that because completion routines run on the USB Workloop, they can be scheduled to run a number of milliseconds after the USB transfer has finished. This latency is variable and depends on what other higher priority threads are running on the system. This latency presents a problem for applications, such as audio processing, that depend on receiving data, processing it, and sending it back out, and need to do this as fast as possible. Since applications that use isochronous data know when the data should be available, they can look at the frame list at the expected time and note the frActCount and frStatus (and frTimeStamp if needed) and determine how many valid bytes are in their data buffer and whether there was an error. They can then access their data buffer and process the actual data. In order to update the frame list at primary interrupt time and to allow the client to see that update, the frame list buffer needs to be shared between the kernel and user space. The same thing applies to the data buffer. This is a difference between the low latency isoch calls and the regular isoch calls. The LowLatencyCreateBuffer() call is used to pre-allocate the buffers. The client must use that call to allocate the data and the frame list buffers. The client can pass a portion of the buffer that was previously allocated. The USB stack will range-check the data and frame list buffers to make sure they are within the ranges of the buffers previously allocated. This allows the client, if it so desires, to allocate a large data buffer and pass portions of it to the read or write calls. The same applies to the frame list buffers. Of course, the client can also pre-allocate several data buffers and several frame list buffers and use those for each transfer. Once the transfer completes, the buffers can be reused in subsequent calls. When all transfers are finished, the client needs to call LowLatencyDestroyBuffer() for each buffer that was created with LowLatencyCreateBuffer(). The interface must be open for the pipe to exist. The buf pointer and the frameList pointer need to be pre-allocated using LowLatencyCreateBuffer(). After using them, they should be freed using LowLatencyDestroyBuffer().
533
LowLatencyWriteIsochPipeAsync
Performs an asynchronous write on an isochronous pipe and updates the frame list at primary interrupt time.
IOReturn ( *LowLatencyWriteIsochPipeAsync)( void *self, UInt8 pipeRef, void *buf, UInt64 frameStart, UInt32 numFrames, UInt32 updateFrequency, IOUSBLowLatencyIsocFrame *frameList, IOAsyncCallback1 callback, void *refcon);
Parameters
self
Buffer to hold the data, previously allocated with LowLatencyCreateBuffer() using a kUSBLowLatencyWriteBuffer type.
frameStart
The bus frame number on which to start the write (obtained from GetBusFrameNumber).
numFrames
Specifies how often, in milliseconds, should the frame list data be updated. Valid range is 0 - 8. If 0, it means that the framelist should be updated at the end of the transfer.
frameList
An IOAsyncCallback1 method. A message addressed to this callback is posted to the Async port upon completion.
refcon
534
Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access. Will return kIOUSBLowLatencyBufferNotPreviouslyAllocated or kIOUSBLowLatencyFrameListNotPreviouslyAllocated if the buffer or the frameList were not previously allocated using LowLatencyCreateBuffer(). Discussion The LowLatencyReadIsochPipeAsync() and LowLatencyWriteIsochPipeAsync() calls are analogous to ReadIsochPipeAsync() and WriteIsochPipeAsync(). They differ in that the frame list data is updated at primary interrupt time . This means that the client can inspect the frStatus and frActCount fields as soon as the transaction completes, without having to wait for the callback to happen (depending on the value of updateFrequency). The callback will still happen when the all the frames have been received. The client can specify how often the USB stack should update the frame list data by specifying the updateFrequency: this value can range from 0 - 8. If the value is between 1 and 8, the frame list will be updated every updateFrequency milliseconds. If the value is 0, the frame list will only be updated once all the frames in the transfer have been received. For example, consider a transfer with numFrames equal to 64. If the update frequency is 4, the frame list data will be updated every 4 milliseconds. If the update frequency is 0, the frame list will only be updated at the end of the transfer, after the 64 frames have been sent or received. The difference between using an update frequency of 0 and using the non-low latency isoch calls is that in the former case, the frame list will be updated at primary interrupt time, while in the latter, it will be updated at secondary interrupt time. Regardless of the value of updateFrequency, the frame list will always be updated on the last frame of a transfer. The rationale for adding this call is that because completion routines run on the USB Workloop, they can be scheduled to run a number of milliseconds after the USB transfer has finished. This latency is variable and depends on what other higher priority threads are running on the system. This latency presents a problem for applications, such as audio processing, that depend on receiving data, processing it, and sending it back out, and need to do this as fast as possible. Since applications that use isochronous data know when the data should be available, they can look at the frame list at the expected time and note the frActCount and frStatus (and frTimeStamp if needed) and determine how many valid bytes are in their data buffer and whether there was an error. They can then access their data buffer and process the actual data. In order to update the frame list at primary interrupt time and to allow the client to see that update, the frame list buffer needs to be shared between the kernel and user space. The same thing applies to the data buffer. This is a difference between the low latency isoch calls and the regular isoch calls. The LowLatencyCreateBuffer() call is used to pre-allocate the buffers. The client must use that call to allocate the data and the frame list buffers. The client can pass a portion of the buffer that was previously allocated. The USB stack will range-check the data and frame list buffers to make sure they are within the ranges of the buffers previously allocated. This allows the client, if it so desires, to allocate a large data buffer and pass portions of it to the read or write calls. The same applies to the frame list buffers. Of course, the client can also pre-allocate several data buffers and
535
several frame list buffers and use those for each transfer. Once the transfer completes, the buffers can be reused in subsequent calls. When all transfers are finished, the client needs to call LowLatencyDestroyBuffer() for each buffer that was created with LowLatencyCreateBuffer(). The interface must be open for the pipe to exist. The buf pointer and the frameList pointer need to be pre-allocated using LowLatencyCreateBuffer(). After using them, they should be freed using LowLatencyDestroyBuffer().
536
IOUSBInterfaceInterface197
IOUSBInterfaceInterface192
IOUSBLib.h (page 1142)
Overview
The object you use to access a USB device interface from user space, returned by the IOUSBFamily version 1.9.7 and above. The functions listed here include all of the functions defined for the IOUSBInterfaceInterface, IOUSBInterfaceInterface182, IOUSBInterfaceInterface183, IOUSBInterfaceInterface190, IOUSBInterfaceInterface192, and some new functions that are available on OS X version 10.2.5 and later.
Tasks
Miscellaneous
GetBusMicroFrameNumber
(page 537) Gets the current micro frame number of the bus to which the interface and its device are attached. (page 538) Returns the number of microseconds in each USB Frame. (page 539) Returns the version of the IOUSBLib and the version of the IOUSBFamily.
GetFrameListTime
GetIOUSBLibVersion
Instance Methods
GetBusMicroFrameNumber
Gets the current micro frame number of the bus to which the interface and its device are attached.
537
Parameters
self
Pointer to an AbsoluteTime, which should be within 1ms of the time when the bus frame number was attained. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
GetFrameListTime
Returns the number of microseconds in each USB Frame.
IOReturn ( *GetFrameListTime)( void *self, UInt32 *microsecondsInFrame);
Parameters
self
Pointer to UInt32 to hold the number of microseconds in each USB frame. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService.
538
Discussion This function can be used to determine whether the device is functioning in full speed or a high speed. In the case of a full speed device, the returned value will be kUSBFullSpeedMicrosecondsInFrame. In the case of a high speed device, the return value will be kUSBHighSpeedMicrosecondsInFrame. (This API should really be called GetUSBFrameTime). The interface does not have to be open to use this function.
GetIOUSBLibVersion
Returns the version of the IOUSBLib and the version of the IOUSBFamily.
IOReturn ( *GetIOUSBLibVersion)( void *self, NumVersion *ioUSBLibVersion, NumVersion *usbFamilyVersion);
Parameters
self
Pointer to a NumVersion structure that on return will contain the version of the IOUSBLib.
usbFamilyVersion
Pointer to a NumVersion structure that on return will contain the version of the IOUSBFamily. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService. Discussion The interface does not have to be open to use this function.
539
MMCDeviceInterface
Declared in
Overview
Basic interface for an MMC-2 Compliant Device. After rendezvous with a MMC-2 Compliant Device in the IORegistry you can create an instance of this interface as a proxy to the IOService. Once you have this interface, or one of its subclasses, you can issue some select MMC-2 calls to the device without getting exclusive access first.
Tasks
Miscellaneous
GetConfiguration
(page 541) Issues a GET_CONFIGURATION command to the device as defined in MMC-2. (page 542) Issues a GET_PERFORMANCE command to the device as defined in MMC-2. (page 544) Issues a GET_PERFORMANCE command to the device as defined in Mt. Fuji 5. (page 545) Gets a handle to the SCSITaskDeviceInterface without closing the user client connection which was initiated by IOCreateCFPlugInForService. (page 545) Issues a GET_EVENT_STATUS_NOTIFICATION command to the device as defined in MMC-2. (page 546) Issues an INQUIRY command to the device as defined in SPC-2. (page 547) Issues a MODE_SENSE_10 command to the device as defined in SPC-2.
GetPerformance
GetPerformanceV2
GetSCSITaskDeviceInterface
GetTrayState
Inquiry
ModeSense10
540
ReadDiscInformation
(page 548) Issues a READ_DISC_INFORMATION command to the device as defined in MMC-2. (page 549) Issues a READ_DISC_INFORMATION command to the device as defined in MMC-5. (page 550) Issues a READ_DISC_STRUCTURE command to the device as defined in MMC-5. (page 551) Issues a READ_DVD_STRUCTURE command to the device as defined in MMC-2. (page 552) Issues a READ_FORMAT_CAPACITIES command to the device as defined in MMC-2. (page 553) Issues a READ_TOC_PMA_ATIP command to the device as defined in MMC-2/SFF-8020i. (page 554) Issues a READ_TRACK_INFORMATION command to the device as defined in MMC-2. (page 555) Issues a READ_TRACK_INFORMATION command to the device as defined in Mt. Fuji 5. (page 556) Issues a SET_CD_SPEED command to the device as defined in MMC-2. (page 557) Issues a SET_STREAMING command to the device as defined in MMC-5. (page 558) Issues a START_STOP_UNIT command to the device as defined in SBC-3. (page 559) Issues a MODE_SELECT command to the device as defined in SPC-2 with the Write Parameters Mode Page Code as defined in MMC-2. (page 559) Issues a TEST_UNIT_READY command to the device as defined in SPC-2.
ReadDiscInformationV2
ReadDiscStructure
ReadDVDStructure
ReadFormatCapacities
ReadTableOfContents
ReadTrackInformation
ReadTrackInformationV2
SetCDSpeed
SetStreaming
SetTrayState
SetWriteParametersModePage
TestUnitReady
Instance Methods
GetConfiguration
Issues a GET_CONFIGURATION command to the device as defined in MMC-2.
541
IOReturn ( *GetConfiguration )( void *self, SCSICmdField1Byte RT, SCSICmdField2Byte STARTING_FEATURE_NUMBER, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
Pointer to the buffer where the mode sense data should be placed.
bufferSize
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to get configuration information from the device.
GetPerformance
Issues a GET_PERFORMANCE command to the device as defined in MMC-2.
542
IOReturn ( *GetPerformance )( void *self, SCSICmdField2Bit TOLERANCE, SCSICmdField1Bit WRITE, SCSICmdField2Bit EXCEPT, SCSICmdField4Byte STARTING_LBA, SCSICmdField2Byte MAXIMUM_NUMBER_OF_DESCRIPTORS, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
Pointer to the buffer where the mode sense data should be placed.
bufferSize
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION.
543
Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to get performance information from the device.
GetPerformanceV2
Issues a GET_PERFORMANCE command to the device as defined in Mt. Fuji 5.
IOReturn ( *GetPerformanceV2 )( void *self, SCSICmdField5Bit DATA_TYPE, SCSICmdField4Byte STARTING_LBA, SCSICmdField2Byte MAXIMUM_NUMBER_OF_DESCRIPTORS, SCSICmdField1Byte TYPE, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
The DATA_TYPE field as described for the GET_PERFORMANCE command in Mt. Fuji 5.
STARTING_LBA
The STARTING_LBA field as described in Mt. Fuji 5 for the GET_PERFORMANCE command.
MAXIMUM_NUMBER_OF_DESCRIPTORS
The MAXIMUM_NUMBER_OF_DESCRIPTORS field as described in Mt. Fuji 5 for the GET_PERFORMANCE command.
TYPE
The TYPE field as described for the GET_PERFORMANCE command in Mt. Fuji 5.
buffer
Pointer to the buffer where the mode sense data should be placed.
bufferSize
544
taskStatus
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to get performance information from the device.
GetSCSITaskDeviceInterface
Gets a handle to the SCSITaskDeviceInterface without closing the user client connection which was initiated by IOCreateCFPlugInForService.
SCSITaskDeviceInterface ** ( *GetSCSITaskDeviceInterface )( void *self );
Parameters
self
Pointer to an MMCDeviceInterface for one IOService. Return Value Returns a handle to a SCSITaskDeviceInterface if successful, otherwise NULL. Discussion Once an MMCDeviceInterface is opened the client may use this function to get a handle to the interface used to create and send SCSITasks directly to the device.
GetTrayState
Issues a GET_EVENT_STATUS_NOTIFICATION command to the device as defined in MMC-2.
545
Parameters
self
Pointer to a UInt8 which will hold the tray state on completion of the routine. The tray state can be one of two values, kMMCDeviceTrayClosed or kMMCDeviceTrayOpen. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to find out if the device's medium tray is open.
Inquiry
Issues an INQUIRY command to the device as defined in SPC-2.
IOReturn ( *Inquiry )( void *self, SCSICmd_INQUIRY_StandardData *inquiryBuffer, UInt32 inqBufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
The amount of INQUIRY data to ask the device for (some devices return less INQUIRY data than the size of SCSICmd_INQUIRY_StandardData and will need to be reset if more than that amount is specified). This value must be less than the size of SCSICmd_INQUIRY_StandardData.
546
taskStatus
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to get inquiry data from the drive.
ModeSense10
Issues a MODE_SENSE_10 command to the device as defined in SPC-2.
IOReturn ( *ModeSense10 )( void *self, SCSICmdField1Bit LLBAA, SCSICmdField1Bit DBD, SCSICmdField2Bit PC, SCSICmdField6Bit PAGE_CODE, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
547
buffer
Pointer to the buffer where the mode sense data should be placed.
bufferSize
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to get mode page information from the device.
ReadDiscInformation
Issues a READ_DISC_INFORMATION command to the device as defined in MMC-2.
IOReturn ( *ReadDiscInformation ) ( void *self, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
548
taskStatus
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to read information about the disc (CD-R/RW, (un)finalized, etc..
ReadDiscInformationV2
Issues a READ_DISC_INFORMATION command to the device as defined in MMC-5.
IOReturn ( *ReadDiscInformationV2 ) ( void *self, SCSICmdField3Bit DATA_TYPE, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
549
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to read information about the disc (CD-R/RW, (un)finalized, etc..
ReadDiscStructure
Issues a READ_DISC_STRUCTURE command to the device as defined in MMC-5.
IOReturn ( *ReadDiscStructure ) ( void *self, SCSICmdField4Bit MEDIA_TYPE, SCSICmdField4Byte ADDRESS, SCSICmdField1Byte LAYER_NUMBER, SCSICmdField1Byte FORMAT, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
550
buffer
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to read information about Disc specific structures on the disc.
ReadDVDStructure
Issues a READ_DVD_STRUCTURE command to the device as defined in MMC-2.
IOReturn ( *ReadDVDStructure ) ( void *self, SCSICmdField4Byte ADDRESS, SCSICmdField1Byte LAYER_NUMBER, SCSICmdField1Byte FORMAT, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
551
FORMAT
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to read information about DVD specific structures on the disc.
ReadFormatCapacities
Issues a READ_FORMAT_CAPACITIES command to the device as defined in MMC-2.
IOReturn ( *ReadFormatCapacities ) ( void *self, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
Pointer to the buffer where the mode sense data should be placed.
552
bufferSize
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to get format capacity information from the media.
ReadTableOfContents
Issues a READ_TOC_PMA_ATIP command to the device as defined in MMC-2/SFF-8020i.
IOReturn ( *ReadTableOfContents )( void *self, SCSICmdField1Bit MSF, SCSICmdField4Bit FORMAT, SCSICmdField1Byte TRACK_SESSION_NUMBER, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
553
buffer
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to read the table of contents from the media.
ReadTrackInformation
Issues a READ_TRACK_INFORMATION command to the device as defined in MMC-2.
IOReturn ( *ReadTrackInformation ) ( void *self, SCSICmdField2Bit ADDRESS_NUMBER_TYPE, SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS_TRACK_SESSION_NUMBER, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
554
buffer
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to read information about selected tracks on the disc.
ReadTrackInformationV2
Issues a READ_TRACK_INFORMATION command to the device as defined in Mt. Fuji 5.
IOReturn ( *ReadTrackInformationV2 ) ( void *self, SCSICmdField1Bit OPEN, SCSICmdField2Bit ADDRESS_NUMBER_TYPE, SCSICmdField4Byte LOGICAL_BLOCK_ADDRESS_TRACK_SESSION_NUMBER, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
555
LOGICAL_BLOCK_ADDRESS_TRACK_SESSION_NUMBER
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to read information about selected tracks on the disc.
SetCDSpeed
Issues a SET_CD_SPEED command to the device as defined in MMC-2.
IOReturn ( *SetCDSpeed ) ( void *self, SCSICmdField2Byte LOGICAL_UNIT_READ_SPEED, SCSICmdField2Byte LOGICAL_UNIT_WRITE_SPEED, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
556
LOGICAL_UNIT_WRITE_SPEED
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to change the read and/or write CD speed of the drive.
SetStreaming
Issues a SET_STREAMING command to the device as defined in MMC-5.
IOReturn ( *SetStreaming ) ( void *self, SCSICmdField1Byte TYPE, void *buffer, SCSICmdField2Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
557
taskStatus
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened the client may send this command to change streaming attributes. Clients should check for the Real-time Streaming Feature (107h) before using this command.
SetTrayState
Issues a START_STOP_UNIT command to the device as defined in SBC-3.
IOReturn ( *SetTrayState )( void *self, UInt8 trayState );
Parameters
self
A UInt8 describing which tray state is desired. The tray state can be one of two values, kMMCDeviceTrayClosed or kMMCDeviceTrayOpen. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNotPermitted if media is inserted, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened and all volumes associated with that device's media have been unmounted, the client may send this command to eject the tray.
558
SetWriteParametersModePage
Issues a MODE_SELECT command to the device as defined in SPC-2 with the Write Parameters Mode Page Code as defined in MMC-2.
IOReturn ( *SetWriteParametersModePage )( void *self, void *buffer, SCSICmdField1Byte bufferSize, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
buffer
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to set the default values returned in a READ_DISC_INFORMATION call.
TestUnitReady
Issues a TEST_UNIT_READY command to the device as defined in SPC-2.
IOReturn ( *TestUnitReady )( void *self, SCSITaskStatus *taskStatus, SCSI_Sense_Data *senseDataBuffer );
Parameters
self
559
taskStatus
Pointer to a SCSITaskStatus to get the status of the SCSITask which was executed. Valid SCSITaskStatus values are defined in SCSITask.h
senseDataBuffer
Pointer to a buffer the size of the SCSI_Sense_Data struct found in SCSICmds_REQUEST_SENSE_Defs.h. The sense data is only valid if the SCSITaskStatus is kSCSITaskStatus_CHECK_CONDITION. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, kIOReturnNoMemory if a SCSITask couldn't be created, or kIOReturnExclusiveAccess if the device is already opened for exclusive access by another client. Discussion Once an MMCDeviceInterface is opened, the client may send this command to test if the drive is ready.
Instance Variables
revision
UInt16 revision;
Interface revision
version
UInt16 version;
Interface version
560
SCSITaskDeviceInterface
Declared in
Overview
Basic interface for a SCSITask Device. After rendezvous with a SCSITask Device in the IORegistry you can create an instance of this interface as a proxy to the IOService. Once you have this interface, or one of its subclasses, you can create SCSITasks to send to the device. Use the CreateSCSITask method to create new SCSITask instances for this device.
Tasks
Miscellaneous
AddCallbackDispatcherToRunLoop
(page 562) Convenience method to add asynchronous callback mechanisms to the CFRunLoop of choice. (page 562) Method to create SCSITasks. (page 563) Method to find out if the device can be opened exclusively by the caller. (page 563) Method to obtain exclusive access to the device so that SCSITasks can be sent to it. (page 564) Method to release exclusive access to the device so that other clients can send commands to it. (page 564) Convenience method to remove asynchronous callback mechanisms from the CFRunLoop.
CreateSCSITask
IsExclusiveAccessAvailable
ObtainExclusiveAccess
ReleaseExclusiveAccess
RemoveCallbackDispatcherFromRunLoop
561
Instance Methods
AddCallbackDispatcherToRunLoop
Convenience method to add asynchronous callback mechanisms to the CFRunLoop of choice.
IOReturn ( *AddCallbackDispatcherToRunLoop ) ( void *self, CFRunLoopRef cfRunLoopRef );
Parameters
self
The CFRunLoop to which asynchronous callback notifications should be attached. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNoMemory if a mach port could not be allocated and initialized properly. Discussion Once a SCSITaskDeviceInterface is opened, the client may make synchronous or asynchronous requests to the device. This method creates and initializes a mach_port_t for receiving asynchronous callback notifications via the CFRunLoop mechanism.
CreateSCSITask
Method to create SCSITasks.
SCSITaskInterface ** ( *CreateSCSITask )( void *self );
Parameters
self
Pointer to a SCSITaskDeviceInterface instance. Return Value Returns a handle to an instance of a SCSITaskInterface or NULL if one could not be allocated.
562
Discussion Once a SCSITaskDeviceInterface is opened, the client may request exclusive access to the device. Once the client has successfully gained exclusive access, it becomes the Logical Unit Driver. It then can use this method to allocate SCSITasks to be sent to the device.
IsExclusiveAccessAvailable
Method to find out if the device can be opened exclusively by the caller.
Boolean ( *IsExclusiveAccessAvailable ) ( void *self );
Parameters
self
Pointer to an instance of an SCSITaskDeviceInterface. Return Value Returns false if the device has been opened for exclusive access, otherwise true. Discussion Method to find out if the device can be opened exclusively by the caller.
ObtainExclusiveAccess
Method to obtain exclusive access to the device so that SCSITasks can be sent to it.
IOReturn ( *ObtainExclusiveAccess ) ( void *self );
Parameters
self
Pointer to a SCSITaskDeviceInterface instance. Return Value Returns kIOReturnSuccess if exclusive access was granted, else if media is still mounted it returns kIOReturnBusy. If another client already has exclusive access, kIOReturnExclusiveAccess is returned. Discussion Once a SCSITaskDeviceInterface is opened, the client may request exclusive access to the device. Once the client has successfully gained exclusive access, it becomes the Logical Unit Driver and all in-kernel Logical Unit Drivers are quiesced.
563
ReleaseExclusiveAccess
Method to release exclusive access to the device so that other clients can send commands to it.
IOReturn ( *ReleaseExclusiveAccess ) ( void *self );
Parameters
self
Pointer to a SCSITaskDeviceInterface instance. Return Value Returns kIOReturnSuccess if exclusive access was released, else some appropriate error. Discussion Once a SCSITaskDeviceInterface is opened, the client may request exclusive access to the device. Once the client has successfully gained exclusive access, it becomes the Logical Unit Driver and all in-kernel Logical Unit Drivers (if any are matched on the device) are quiesced. This method releases this access and unquiesces the in-kernel drivers (if any).
RemoveCallbackDispatcherFromRunLoop
Convenience method to remove asynchronous callback mechanisms from the CFRunLoop.
void ( *RemoveCallbackDispatcherFromRunLoop ) ( void *self );
Parameters
self
Pointer to a SCSITaskDeviceInterface instance. Discussion Once a SCSITaskDeviceInterface is opened, the client may make synchronous or asynchronous requests to the device. This method removes the asynchronous notifications delivered via the CFRunLoop. This should be called only after calling AddCallbackDispatcherToRunLoop.
564
Instance Variables
revision
UInt16 revision;
Interface revision
version
UInt16 version;
Interface version
565
SCSITaskInterface
Declared in
Overview
Basic interface for a SCSITask. After rendezvous with a SCSITask Device in the IORegistry you can create an instance of this interface using the CreateSCSITask method in the SCSITaskDeviceInterface. Once you have this interface, or one of its subclasses, you can manipulate SCSITasks to send to the device.
Tasks
Miscellaneous
AbortTask
(page 567) Method to abort the SCSITask. (page 568) Method to execute the SCSITask asynchronously. (page 568) Method to execute the SCSITask synchronously. (page 569) Method to get the auto-sense data from the SCSITask. (page 570) Method to get the task's SCSICommandDescriptorBlock. (page 570) Method to get the task's SCSICommandDescriptorBlock size. (page 571) Method to get the actual transfer count in bytes from the SCSITask.
ExecuteTaskAsync
ExecuteTaskSync
GetAutoSenseData
GetCommandDescriptorBlock
GetCommandDescriptorBlockSize
GetRealizedDataTransferCount
566
GetSCSIServiceResponse
(page 571) Method to get the SCSIServiceResponse from the SCSITask. (page 572) Method to get the task's attribute. (page 572) Method to get the SCSITaskState from the SCSITask. (page 573) Method to get the SCSITaskStatus from the SCSITask. (page 573) Method to get the timeout duration for the SCSITask. (page 573) Method to find out if the task is active or not. (page 574) Method to reset the SCSITask to defaults. (page 574) Method to set the auto-sense data for the SCSITask. (page 575) Method to set the task's SCSICommandDescriptorBlock. (page 576) Method to set the task's scatter-gather list entries. (page 576) Method to set the task's attribute. (page 577) Method to set the asynchronous completion routine for the SCSITask. (page 578) Method to set the timeout duration for the SCSITask.
GetTaskAttribute
GetTaskState
GetTaskStatus
GetTimeoutDuration
IsTaskActive
ResetForNewTask
SetAutoSenseDataBuffer
SetCommandDescriptorBlock
SetScatterGatherEntries
SetTaskAttribute
SetTaskCompletionCallback
SetTimeoutDuration
Instance Methods
AbortTask
Method to abort the SCSITask.
567
Parameters
task
Pointer to an instance of an SCSITaskInterface. Return Value Returns kIOReturnSuccess, kIOReturnUnsupported or kIOReturnError. Discussion This method can be used to abort an SCSITask which is already in progress.
ExecuteTaskAsync
Method to execute the SCSITask asynchronously.
IOReturn ( *ExecuteTaskAsync ) ( void *task );
Parameters
task
Pointer to an instance of an SCSITaskInterface. Return Value Returns a valid IOReturn code such as kIOReturnSuccess, kIOReturnError, kIOReturnVMError, kIOReturnCannotWire, etc. It will return kIOReturnNotPermitted if the client has not called AddCallbackDispatcherToRunLoop on the SCSITaskDeviceInterface. NOTE: IOReturn is defined as kern_return_t and as such, you may get errors back that do not fall under the IOKit subsystem error domain (sys_iokit) defined in IOReturn.h. Discussion This method can be used to execute the SCSITask asynchronously.
ExecuteTaskSync
Method to execute the SCSITask synchronously.
568
IOReturn ( *ExecuteTaskSync ) ( void *task, SCSI_Sense_Data *senseDataBuffer, SCSITaskStatus *outStatus, UInt64 *realizedTransferCount );
Parameters
task
Pointer to a buffer for REQUEST_SENSE data. May be NULL if caller does not wish to have sense data returned. If caller has previously called SetAutoSenseDataBuffer(), this parameter is ignored.
outStatus
Pointer to an SCSITaskStatus. May be NULL if caller does not wish to have task status returned.
realizedTransferCount
Pointer to an UInt64 which reflects how much data was actually transferred. May be NULL if caller does not wish to know how many bytes were transferred. Return Value Returns a valid IOReturn code such as kIOReturnSuccess, kIOReturnError, kIOReturnVMError, kIOReturnCannotWire, etc. NOTE: IOReturn is defined as kern_return_t and as such, you may get errors back that do not fall under the IOKit subsystem error domain (sys_iokit) defined in IOReturn.h. Discussion This method can be used to execute the SCSITask synchronously.
GetAutoSenseData
Method to get the auto-sense data from the SCSITask.
IOReturn ( *GetAutoSenseData ) ( void *task, SCSI_Sense_Data *senseDataBuffer );
Parameters
task
Pointer to a buffer the size of the SCSI_Sense_Data structure. If caller has previously called SetAutoSenseDataBuffer(), this routine will return an error.
569
Return Value Returns kIOReturnSuccess if sense data is valid, otherwise kIOReturnError. Discussion This method can be used to get the auto-sense data from the SCSITask.
GetCommandDescriptorBlock
Method to get the task's SCSICommandDescriptorBlock.
IOReturn ( *GetCommandDescriptorBlock ) ( void *task, UInt8 *outCDB );
Parameters
task
Pointer to an array the size of the SCSICommandDescriptorBlock in question. Clients should call GetCommandDescriptorBlockSize first to find out how large an array should be passed in. Return Value Returns kIOReturnSucces or kIOReturnError. Discussion This method can be used to get the SCSITasks' SCSICommandDescriptorBlock.
GetCommandDescriptorBlockSize
Method to get the task's SCSICommandDescriptorBlock size.
UInt8 ( *GetCommandDescriptorBlockSize ) ( void *task );
Parameters
task
Pointer to an instance of an SCSITaskInterface. Return Value UInt8 which is the size of the SCSICommandDescriptorBlock. Valid values are 6, 10, 12, and 16 which have enums defined in SCSITask.h
570
Discussion This method can be used to get the size of the SCSITask's SCSICommandDescriptorBlock.
GetRealizedDataTransferCount
Method to get the actual transfer count in bytes from the SCSITask.
UInt64 ( *GetRealizedDataTransferCount ) ( void *task );
Parameters
task
Pointer to an instance of an SCSITaskInterface. Return Value Returns a UInt64 value of bytes transferred. Discussion This method can be used to get the actual transfer count in bytes from the SCSITask.
GetSCSIServiceResponse
Method to get the SCSIServiceResponse from the SCSITask.
IOReturn ( *GetSCSIServiceResponse ) ( void *task, SCSIServiceResponse *outServiceResponse );
Parameters
task
Pointer to an SCSIServiceResponse. Return Value Returns kIOReturnSuccess or kIOReturnError. Discussion This method can be used to get the SCSIServiceResponse from the SCSITask.
571
GetTaskAttribute
Method to get the task's attribute.
IOReturn ( *GetTaskAttribute ) ( void *task, SCSITaskAttribute *outAttribute );
Parameters
task
Pointer to the attribute value stored in the SCSITask. Return Value Returns kIOReturnSuccess or kIOReturnError. Discussion This method can be used to get the SCSITasks' SCSITaskAttribute field. Valid values are defined in SCSITask.h
GetTaskState
Method to get the SCSITaskState from the SCSITask.
IOReturn ( *GetTaskState ) ( void *task, SCSITaskState *outState );
Parameters
task
Pointer to an SCSITaskState. Return Value Returns kIOReturnSuccess or kIOReturnError. Discussion This method can be used to get the SCSITaskState from the SCSITask.
572
GetTaskStatus
Method to get the SCSITaskStatus from the SCSITask.
IOReturn ( *GetTaskStatus ) ( void *task, SCSITaskStatus *outStatus );
Parameters
task
Pointer to an SCSITaskStatus. Return Value Returns kIOReturnSuccess or kIOReturnError. Discussion This method can be used to get the SCSITaskStatus from the SCSITask.
GetTimeoutDuration
Method to get the timeout duration for the SCSITask.
UInt32 ( *GetTimeoutDuration ) ( void *task );
Parameters
task
Pointer to an instance of an SCSITaskInterface. Return Value Returns a value between zero and ULONG_MAX. Discussion This method can be used to get the timeout duration for the SCSITask. The timeout duration is counted in milliseconds.
IsTaskActive
Method to find out if the task is active or not.
573
Parameters
task
Pointer to an instance of an SCSITaskInterface. Return Value Returns 0 if the task is not active, non-zero if it is active. Discussion Method to find out if the task is active or not. The task is considered "active" if the SCSITaskState is not kSCSITaskState_NEW nor kSCSITaskState_ENDED.
ResetForNewTask
Method to reset the SCSITask to defaults.
IOReturn ( *ResetForNewTask ) ( void *task );
Parameters
task
Pointer to an instance of an SCSITaskInterface. Return Value Returns kIOReturnSuccess if reset was successful, otherwise kIOReturnError. Discussion This method can be used to reset the SCSITask to defaults.
SetAutoSenseDataBuffer
Method to set the auto-sense data for the SCSITask.
574
Parameters
task
Pointer to a buffer. May be be NULL if the caller wants to restrict the size to be less than the normal 18 bytes of sense data.
senseDataLength
Amount of sense data to retrieve. Zero is not a valid value. Return Value Returns kIOReturnSuccess if sense data buffer was set, otherwise kIOReturnError. Discussion This method can be used to set the auto-sense data buffer for the SCSITask.
SetCommandDescriptorBlock
Method to set the task's SCSICommandDescriptorBlock.
IOReturn ( *SetCommandDescriptorBlock ) ( void *task, UInt8 *inCDB, UInt8 inSize );
Parameters
task
The size of the array inCDB. Valid values are 6, 10, 12, and 16 which have enums defined in SCSITask.h. Return Value Returns kIOReturnSuccess or kIOReturnError. Discussion This method can be used to set the SCSITasks' SCSICommandDescriptorBlock.
575
SetScatterGatherEntries
Method to set the task's scatter-gather list entries.
IOReturn ( *SetScatterGatherEntries ) ( void *task, SCSITaskSGElement *inScatterGatherList, UInt8 inScatterGatherEntries, UInt64 inTransferCount, UInt8 inTransferDirection );
Parameters
task
The TOTAL amount of data to transfer. The length of all the entries in the scatter-gather list should at least add up to the amount in inTransferCount.
inTransferDirection
The transfer direction as defined in SCSITask.h. Valid values are kSCSIDataTransfer_NoDataTransfer, kSCSIDataTransfer_FromTargetToInitiator, and kSCSIDataTransfer_FromInitiatorToTarget. Return Value Returns kIOReturnSucces or kIOReturnError. Discussion This method can be used to set the SCSITask's scatter-gather list entries. Scatter-gather lists are represented as an array of SCSITaskSGElements. The SCSITaskSGElement structure has two elements, the address of the buffer and the length of the buffer.
SetTaskAttribute
Method to set the task's attribute.
576
Parameters
task
The new attribute value to be stored in the SCSITask. Return Value Returns kIOReturnSuccess or kIOReturnError. Discussion This method can be used to set the SCSITask's SCSITaskAttribute field. Valid values are defined in SCSITask.h
SetTaskCompletionCallback
Method to set the asynchronous completion routine for the SCSITask.
IOReturn ( *SetTaskCompletionCallback ) ( void *task, SCSITaskCallbackFunction callback, void *refCon );
Parameters
task
A value to be returned to the caller upon completion of the routine. This field is not used by the SCSITaskInterface. Return Value Returns kIOReturnSuccess, kIOReturnError, or kIOReturnNotPermitted if the client has not called AddCallbackDispatcherToRunLoop on the SCSITaskDeviceInterface. Discussion This method can be used to set the asynchronous completion routine for the SCSITask.
577
SetTimeoutDuration
Method to set the timeout duration for the SCSITask.
IOReturn ( *SetTimeoutDuration ) ( void *task, UInt32 inTimeoutDurationMS );
Parameters
task
UInt32 representing the timeout in milliseconds. Return Value Returns kIOReturnSucces or kIOReturnError. Discussion This method can be used to set the timeout duration for the SCSITask. The timeout duration is counted in milliseconds. A value of zero is equivalent to "Wait Forever", but on some buses, this isn't possible, so ULONG_MAX is used.
Instance Variables
revision
UInt16 revision;
Interface revision
version
UInt16 version;
Interface version
578
Other References
579
ATASMARTLib.h Reference
Declared in
ATASMARTLib.h
Overview
ATASMARTLib implements non-kernel task access to ATA SMART data.
Included Headers
Constants
See the Overview for header-level documentation.
Defines
#define kIOATASMARTInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x08, 0xAB, 0xE2, 0x1C, 0x20, 0xD4, 0x11,
580
0xD6, \ 0x8D, 0xF6, 0x00, 0x03, 0x93, 0x5A, 0x76, 0xB2) #define kIOATASMARTLibFactoryID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x5E, 0x65, 0x9F, 0x92, 0x20, 0xD3, 0x11, 0xD6, \ 0xBD, 0xB5, 0x00, 0x03, 0x93, 0x5A, 0x76, 0xB2) #define kIOATASMARTUserClientTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x24, 0x51, 0x4B, 0x7A, 0x28, 0x04, 0x11, 0xD6, \ 0x8A, 0x02, 0x00, 0x30, 0x65, 0x70, 0x48, 0x66) #define kIOPropertySMARTCapableKey "SMART Capable"
581
Constants
kIOATASMARTInterfaceID
UUID for the IOATASMARTInterface Factory. Available in OS X v10.2 and later. Declared in ATASMARTLib.h.
kIOATASMARTUserClientTypeID
Factory ID for creating an ATA SMART user client. Available in OS X v10.2 and later. Declared in ATASMARTLib.h.
kIOPropertySMARTCapableKey
Property to search for in IORegistry to find SMART capable devices without hardcoding the search to a particular device class. Available in OS X v10.4 and later. Declared in ATASMARTLib.h.
582
Declared in
IOAudioDefines.h
Overview Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOAudioControlChannelIDKey "IOAudioControlChannelID" kIOAudioControlChannelNameAll "All Channels" kIOAudioControlChannelNameCenter "Center" kIOAudioControlChannelNameFrontLeftCenter "FrontLeftCenter" kIOAudioControlChannelNameFrontRightCenter "FrontRightCenter" kIOAudioControlChannelNameKey "IOAudioControlChannelName" kIOAudioControlChannelNameLeft "Left" kIOAudioControlChannelNameLeftRear "LeftRear" kIOAudioControlChannelNameRearCenter "RearCenter" kIOAudioControlChannelNameRight "Right" kIOAudioControlChannelNameRightRear "RightRear" kIOAudioControlChannelNameSub "Sub" kIOAudioControlChannelNameSurroundLeft "SurroundLeft" kIOAudioControlChannelNameSurroundRight "SurroundRight" kIOAudioControlTypeKey "IOAudioControlType" kIOAudioControlValueIsReadOnlyKey "IOAudioControlValueIsReadOnly" kIOAudioControlValueKey "IOAudioControlValue" kIOAudioDeviceIconNameKey "IOAudioDeviceIconName" kIOAudioDeviceIconNameKey "IOAudioDeviceIconName" kIOAudioDeviceManufacturerNameKey "IOAudioDeviceManufacturerName" kIOAudioDeviceNameKey "IOAudioDeviceName" kIOAudioEngineFullChannelCategoryNamesKey "IOAudioEngineChannelCategoryNames" kIOAudioEngineFullChannelNamesKey "IOAudioEngineChannelNames"
583
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOAudioEngineFullChannelCategoryNamesKey "IOAudioEngineChannelCategoryNames" kIOAudioEngineFullChannelNumberNamesKey "IOAudioEngineChannelNumberNames" kIOAudioEngineFullChannelNumberNamesKey "IOAudioEngineChannelNumberNames" kIOAudioEngineOutputSampleLatencyKey "IOAudioEngineOutputSampleLatency" kIOAudioEngineStateKey "IOAudioEngineState" kIOAudioLevelControlMaxDBKey "IOAudioLevelControlMaxDB" kIOAudioLevelControlMaxValueKey "IOAudioLevelControlMaxValue" kIOAudioLevelControlMinDBKey "IOAudioLevelControlMinDB" kIOAudioLevelControlMinValueKey "IOAudioLevelControlMinValue" kIOAudioPortNameKey "IOAudioPortName" kIOAudioPortSubTypeKey "IOAudioPortSubType" kIOAudioPortTypeKey "IOAudioPortType" kIOAudioSampleRateKey "IOAudioSampleRate" kIOAudioStreamDirectionKey "IOAudioStreamDirection" kIOAudioStreamSampleLatencyKey "IOAudioStreamSampleLatency"
Constants
kIOAudioControlChannelIDKey
The key in the IORegistry for the IOAudioControl channel ID attribute The value for this key is an integer which may be driver defined. Default values for common channel types are provided in the following defines. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameAll
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for all channels. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameCenter
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the center channel. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameFrontLeftCenter
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the FrontLeftCenter channel. Available in OS X v10.6 and later. Declared in IOAudioDefines.h.
584
kIOAudioControlChannelNameFrontRightCenter
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the FrontRightCenter channel. Available in OS X v10.6 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameKey
The key in the IORegistry for the IOAudioControl name attribute. This name should be a human-readable name for the channel(s) represented by the port. *** NOTE *** We really need to make all of the human-readable attributes that have potential to be used in a GUI localizable. There will need to be localized strings in the kext bundle matching the text. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameLeft
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the left channel. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameLeftRear
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the left rear channel. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameRearCenter
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the RearCenter channel. Available in OS X v10.6 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameRight
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the right channel. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameRightRear
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the right rear channel. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
585
kIOAudioControlChannelNameSub
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the sub/LFE channel. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameSurroundLeft
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the SurroundLeft channel. Available in OS X v10.6 and later. Declared in IOAudioDefines.h.
kIOAudioControlChannelNameSurroundRight
The value for the kIOAudioControlChannelNameKey in the IORegistry representing the channel name for the SurroundRight channel. Available in OS X v10.6 and later. Declared in IOAudioDefines.h.
kIOAudioControlTypeKey
The key in the IORegistry for the IOAudioCntrol type attribute. The value of this text attribute may be defined by the driver, however system-defined types recognized by the upper-level software are "Level", "Mute", "Selector". Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioControlValueIsReadOnlyKey
The key in the IORegistry for the IOAudioControl value-is-read-only attribute. The value returned by this key is a 32-bit integer but the value doesn't have any direct meaning. Instead, the presence of this key indicates that the value for the control is read-only Available in OS X v10.2 and later. Declared in IOAudioDefines.h.
kIOAudioControlValueKey
The key in the IORegistry for the IOAudioControl value attribute. The value returned by this key is a 32-bit integer representing the current value of the IOAudioControl. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioDeviceIconName
The key in the IORegistry for the IOAudioDevice icon name attribute.
586
kIOAudioDeviceIconNameKey
The key in the IORegistry for the IOAudioDevice icon name attribute. Available in OS X v10.5 and later. Declared in IOAudioDefines.h.
kIOAudioDeviceManufacturerNameKey
The key in the IORegistry for the IOAudioDevice manufacturer name attribute. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioDeviceNameKey
The key in the IORegistry for the IOAudioDevice name attribute. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioEngineFullChannelCategoryNamesKey
The key in the IORegistry for the IOAudioEngine's dictionary of category names for each channel keyed by the device channel Available in OS X v10.2 and later. Declared in IOAudioDefines.h.
kIOAudioEngineFullChannelNamesKey
The key in the IORegistry for the IOAudioEngine's dictionary of fully constructed names for each channel keyed by the device channel Available in OS X v10.2 and later. Declared in IOAudioDefines.h.
kIOAudioEngineFullChannelNamesKey
The key in the IORegistry for the IOAudioEngine's dictionary of category names for each channel keyed by the device channel Available in OS X v10.2 and later. Declared in IOAudioDefines.h.
kIOAudioEngineFullChannelNamesKey
The key in the IORegistry for the IOAudioEngine's dictionary of number names for each channel keyed by the device channel Available in OS X v10.2 and later. Declared in IOAudioDefines.h.
kIOAudioEngineFullChannelNumberNamesKey
The key in the IORegistry for the IOAudioEngine's dictionary of number names for each channel keyed by the device channel Available in OS X v10.2 and later. Declared in IOAudioDefines.h.
587
kIOAudioEngineOutputSampleLatencyKey
The key in the IORegistry for the IOAudioEngine output sample latency key Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioEngineStateKey
The key in the IORegistry for the IOAudioEngine state atrribute The value for this key may be one of: "Running", "Stopped" or "Paused". Currently the "Paused" state is unimplemented. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioLevelControlMaxDBKey
The key in the IORgistry for the IOAudioControl maximum db value attribute. The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit integer. It represents the maximum value in db for the IOAudioControl. This value matches the maximum value attribute. This is currently valid for Level controls or other driver-defined controls that have a minimum and maximum db value. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioLevelControlMaxValueKey
The key in the IORegistry for the IOAudioControl maximum value attribute. The value returned by this key is a 32-bit integer representing the maximum value for the IOAudioControl. This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum value. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioLevelControlMinDBKey
The key in the IORgistry for the IOAudioControl minimum db value attribute. The value returned by this key is a fixed point value in 16.16 format represented as a 32-bit integer. It represents the minimum value in db for the IOAudioControl. This value matches the minimum value attribute. This is currently valid for Level controls or other driver-defined controls that have a minimum and maximum db value. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
588
kIOAudioLevelControlMinValueKey
The key in the IORegistry for the IOAudioControl minimum value attribute. The value returned by this key is a 32-bit integer representing the minimum value for the IOAudioControl. This is currently only valid for Level controls or other driver-defined controls that have a minimum and maximum value. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioPortNameKey
The key in the IORegistry for the IOAudioPort name attribute. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioPortSubTypeKey
The key in the IORegistry for the IOAudioPort subtype attribute. The IOAudioPort subtype is a driver-defined text attribute designed to complement the type attribute. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioPortTypeKey
The key in the IORegistry for the IOAudioPort type attribute. This is a driver-defined text attribute that may contain any type. Common types are defined as: "Speaker", "Headphones", "Microphone", "CD", "Line", "Digital", "Mixer", "PassThru". Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioSampleRateKey
The key in the IORegistry for the IOAudioEngine sample rate attribute This value is represented as an integer in samples per second. Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
kIOAudioStreamDirectionKey
The key in the IORegistry for the IOAudioStream direction attribute. The value for this key may be either "Output" or "Input". Available in OS X v10.1 and later. Declared in IOAudioDefines.h.
589
kIOAudioStreamSampleLatencyKey
The key in the IORegistry for the IOAudioStream output sample latency key Tells the HAL how much latency is on a particular stream. If two streams on the same engine have different latencies (e.g. one is analog, one is digital), then set this property on both streams to inform the HAL of the latency differences. Alternately, you can set the engine latency, and just include the latency additional to that for the particular stream. The HAL will add the engine and stream latency numbers together to get the total latency. Available in OS X v10.3 and later. Declared in IOAudioDefines.h. See Also
kIOAudioDeviceIconNameKey kIOAudioDeviceIconName kIOAudioEngineFullChannelNamesKey kIOAudioEngineFullChannelCategoryNamesKey kIOAudioEngineFullChannelNumberNamesKey kIOAudioEngineFullChannelNamesKey
590
IOAudioLib.h Reference
Declared in
IOAudioLib.h
Overview
C interface to IOAudio functions
Included Headers
<IOKit/audio/IOAudioTypes.h>
Functions
See the Overview for header-level documentation.
IOAudioFlush
Indicate the position at which the audio stream can be stopped.
Parameters
connect
591
IOAudioIsOutput
Determines if the audio stream is an output stream
Parameters
service out
IOAudioSetErase
Set autoerase flag, returns old value
Parameters
connect
592
Declared in
IOAudioTypes.h
Overview
Included Headers
Data Types
See the Overview for header-level documentation.
IOAudioControlCalls
The set of constants passed to IOAudioControlUserClient::getExternalMethodForIndex() when making calls from the IOAudioFamily user client code.
Constants
kIOAudioControlCallSetValue
Used to set the value of an IOAudioControl. Available in OS X v10.1 and later. Declared in IOAudioTypes.h.
593
kIOAudioControlCallGetValue
Used to get the value of an IOAudioControl. Available in OS X v10.1 and later. Declared in IOAudioTypes.h. Availability Available in OS X v10.1 and later. Declared in
IOAudioTypes.h
IOAudioControlNotifications
The set of constants passed in the type field of IOAudioControlUserClient::registerNotificaitonPort().
Constants
kIOAudioControlValueChangeNotification
Used to request value change notifications. Available in OS X v10.1 and later. Declared in IOAudioTypes.h.
kIOAudioControlRangeChangeNotification
Used to request range change notifications. Available in OS X v10.2 and later. Declared in IOAudioTypes.h. Availability Available in OS X v10.1 and later. Declared in
IOAudioTypes.h
594
IOAudioEngineCalls
The set of constants passed to IOAudioEngineUserClient::getExternalMethodForIndex() when making calls from the IOAudioFamily user client code.
typedef enum _IOAudioEngineCalls { kIOAudioEngineCallRegisterClientBuffer = 0, kIOAudioEngineCallUnregisterClientBuffer = 1, kIOAudioEngineCallGetConnectionID = 2, kIOAudioEngineCallStart = 3, kIOAudioEngineCallStop = 4, kIOAudioEngineCallGetNearestStartTime = 5 } IOAudioEngineCalls;
IOAudioEngineMemory
Used to identify the type of memory requested by a client process to be mapped into its process space
Constants
kIOAudioSampleBuffer
This requests the IOAudioEngine's sample buffer Available in OS X v10.2 and later. Declared in IOAudioTypes.h.
kIOAudioStatusBuffer
This requests the IOAudioEngine's status buffer. It's type is IOAudioEngineStatus. Available in OS X v10.2 and later. Declared in IOAudioTypes.h.
595
kIOAudioMixBuffer
This requests the IOAudioEngine's mix buffer Available in OS X v10.2 and later. Declared in IOAudioTypes.h. Discussion This is the parameter to the type field of IOMapMemory when called on an IOAudioEngine. This is only intended for use by the Audio Device API library. Availability Available in OS X v10.1 and later. Declared in
IOAudioTypes.h
IOAudioEngineState
Represents the state of an IOAudioEngine
Constants
kIOAudioEngineRunning
The IOAudioEngine is currently running - it is transferring data to or from the device. Available in OS X v10.1 and later. Declared in IOAudioTypes.h.
kIOAudioEngineStopped
The IOAudioEngine is currently stopped - no activity is occurring. Available in OS X v10.1 and later. Declared in IOAudioTypes.h. Availability Available in OS X v10.1 and later. Declared in
IOAudioTypes.h
596
IOAudioEngineStatus
Shared-memory structure giving audio engine status
typedef struct _IOAudioEngineStatus { UInt32 fVersion; volatile UInt32 fCurrentLoopCount; volatile AbsoluteTime fLastLoopTime; volatile UInt32 fEraseHeadSampleFrame; } IOAudioEngineStatus;
IOAudioNotificationMessage
Used in the mach message for IOAudio notifications.
typedef struct _IOAudioNotificationMessage { mach_msg_header_t messageHeader; UInt32 type; UInt32 ref; void *sender; } IOAudioNotificationMessage;
IOAudioSMPTETime
A structure for holding a SMPTE time.
typedef struct _IOAudioSMPTETime { SInt16 fSubframes; SInt16 fSubframeDivisor; UInt32 fCounter; UInt32 fType;
597
UInt32 fFlags; SInt16 fHours; SInt16 fMinutes; SInt16 fSeconds; SInt16 fFrames; } IOAudioSMPTETime;
Declared in
IOAudioTypes.h
IOAudioStreamDirection
Represents the direction of an IOAudioStream
Constants
kIOAudioStreamDirectionOutput
Input buffer Available in OS X v10.1 and later. Declared in IOAudioTypes.h. Availability Available in OS X v10.1 and later. Declared in
IOAudioTypes.h
598
SMPTETime
A structure for holding a SMPTE time.
typedef struct _IOAudioSMPTETime { SInt16 fSubframes; SInt16 fSubframeDivisor; UInt32 fCounter; UInt32 fType; UInt32 fFlags; SInt16 fHours; SInt16 fMinutes; SInt16 fSeconds; SInt16 fFrames; } IOAudioSMPTETime;
Declared in
IOAudioTypes.h
Constants
See the Overview for header-level documentation.
Defines
Constants
kIOAudioControlNumCalls
The number of elements in the IOAudioControlCalls enum. Available in OS X v10.1 and later. Declared in IOAudioTypes.h.
599
kIOAudioEngineDefaultMixBufferSampleSize
The number of elements in the IOAudioEngineCalls enum. Available in OS X v10.1 and later. Declared in IOAudioTypes.h.
600
Declared in
IOBDBlockStorageDevice.h
Overview
This header contains the IOBDBlockStorageDevice class definition.
Included Headers
<IOKit/storage/IOBDTypes.h>
Constants
See the Overview for header-level documentation.
Defines
Constants
kIOBDBlockStorageDeviceClass
kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. kIOBDBlockStorageDeviceClass is the name of the IOBDBlockStorageDevice class. Available in OS X v10.5 and later. Declared in IOBDBlockStorageDevice.h.
601
Declared in
IOBDMedia.h
Overview
This header contains the IOBDMedia class definition.
Constants
See the Overview for header-level documentation.
Defines
kIOBDMediaClass "IOBDMedia" kIOBDMediaTypeKey "Type" kIOBDMediaTypeR "BD-R" kIOBDMediaTypeRE "BD-RE" kIOBDMediaTypeROM "BD-ROM"
Constants
kIOBDMediaClass
kIOBDMediaClass is the name of the IOBDMedia class. kIOBDMediaClass is the name of the IOBDMedia class. Available in OS X v10.5 and later. Declared in IOBDMedia.h.
kIOBDMediaTypeKey
kIOBDMediaTypeKey is a property of IOBDMedia objects. It has an OSString value. The kIOBDMediaTypeKey property identifies the BD media type (BD-ROM, BD-R, BD-RE, etc). See the kIOBDMediaType contants for possible values. Available in OS X v10.5 and later. Declared in IOBDMedia.h.
602
kIOBDMediaTypeR
The kIOBDMediaTypeKey constant for BD-R media. Available in OS X v10.5 and later. Declared in IOBDMedia.h.
kIOBDMediaTypeRE
The kIOBDMediaTypeKey constant for BD-RE media. Available in OS X v10.5 and later. Declared in IOBDMedia.h.
kIOBDMediaTypeROM
The kIOBDMediaTypeKey constant for BD-ROM media. Available in OS X v10.5 and later. Declared in IOBDMedia.h.
603
Declared in
IOBlockStorageDevice.h
Overview
This header contains the IOBlockStorageDevice class definition.
Included Headers
<IOKit/IOTypes.h> <IOKit/storage/IOStorageDeviceCharacteristics.h>
Constants
See the Overview for header-level documentation.
Defines
Constants
kIOBlockStorageDeviceClass
The name of the IOBlockStorageDevice class. Available in OS X v10.2 and later. Declared in IOBlockStorageDevice.h.
kIOBlockStorageDeviceWriteCacheStateKey
The name of the property used to get or set the write cache state of the block storage device. Available in OS X v10.3 and later. Declared in IOBlockStorageDevice.h.
604
Declared in
IOBlockStorageDriver.h
Overview
This header contains the IOBlockStorageDriver class definition.
Included Headers
<IOKit/IOTypes.h>
Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOBlockStorageDriverClass "IOBlockStorageDriver" kIOBlockStorageDriverStatisticsBytesReadKey "Bytes (Read)" kIOBlockStorageDriverStatisticsBytesWrittenKey "Bytes (Write)" kIOBlockStorageDriverStatisticsKey "Statistics" kIOBlockStorageDriverStatisticsLatentReadTimeKey "Latency Time (Read)" kIOBlockStorageDriverStatisticsLatentWriteTimeKey "Latency Time (Write)" kIOBlockStorageDriverStatisticsReadErrorsKey "Errors (Read)" kIOBlockStorageDriverStatisticsReadRetriesKey "Retries (Read)" kIOBlockStorageDriverStatisticsReadsKey "Operations (Read)" kIOBlockStorageDriverStatisticsTotalReadTimeKey "Total Time (Read)" kIOBlockStorageDriverStatisticsTotalWriteTimeKey "Total Time (Write)" kIOBlockStorageDriverStatisticsWriteErrorsKey "Errors (Write)" kIOBlockStorageDriverStatisticsWriteRetriesKey "Retries (Write)" kIOBlockStorageDriverStatisticsWritesKey "Operations (Write)"
605
Constants
kIOBlockStorageDriverClass
The name of the IOBlockStorageDriver class. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsBytesReadKey
Describes the number of bytes read since the block storage driver was instantiated. This property describes the number of bytes read since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsBytesWrittenKey
Describes the number of bytes written since the block storage driver was instantiated. This property describes the number of bytes written since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsKey
Holds a table of numeric values describing the driver's operating statistics. This property holds a table of numeric values describing the driver's operating statistics. The table is an OSDictionary, where each entry describes one given statistic. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsLatentReadTimeKey
Describes the number of nanoseconds of latency during reads since the block storage driver was instantiated. This property describes the number of nanoseconds of latency during reads since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
606
kIOBlockStorageDriverStatisticsLatentWriteTimeKey
Describes the number of nanoseconds of latency during writes since the block storage driver was instantiated. This property describes the number of nanoseconds of latency during writes since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsReadErrorsKey
Describes the number of read errors encountered since the block storage driver was instantiated. This property describes the number of read errors encountered since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsReadRetriesKey
Describes the number of read retries required since the block storage driver was instantiated. This property describes the number of read retries required since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsReadsKey
Describes the number of read operations processed since the block storage driver was instantiated. This property describes the number of read operations processed since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsTotalReadTimeKey
Describes the number of nanoseconds spent performing reads since the block storage driver was instantiated. This property describes the number of nanoseconds spent performing reads since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
607
kIOBlockStorageDriverStatisticsTotalWriteTimeKey
Describes the number of nanoseconds spent performing writes since the block storage driver was instantiated. This property describes the number of nanoseconds spent performing writes since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsWriteErrorsKey
Describes the number of write errors encountered since the block storage driver was instantiated. This property describes the number of write errors encountered since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsWriteRetriesKey
Describes the number of write retries required since the block storage driver was instantiated. This property describes the number of write retries required since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
kIOBlockStorageDriverStatisticsWritesKey
Describes the number of write operations processed since the block storage driver was instantiated. This property describes the number of write operations processed since the block storage driver was instantiated. It is one of the statistic entries listed under the top-level kIOBlockStorageDriverStatisticsKey property table. It has an OSNumber value. Available in OS X v10.0 and later. Declared in IOBlockStorageDriver.h.
IOMediaState
The different states that getMediaState() can report.
608
kIOMediaStateBusy = 2 };
Constants
kIOMediaStateOffline
Media is available and ready for operations. Available in OS X v10.4 and later. Declared in IOBlockStorageDriver.h.
kIOMediaStateBusy
Media is available, but not ready for operations. Available in OS X v10.4 and later. Declared in IOBlockStorageDriver.h.
609
Declared in
IOCDBlockStorageDevice.h
Overview
This header contains the IOCDBlockStorageDevice class definition.
Included Headers
<IOKit/storage/IOCDTypes.h>
Constants
See the Overview for header-level documentation.
Defines
Constants
kIOCDBlockStorageDeviceClass
kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. kIOCDBlockStorageDeviceClass is the name of the IOCDBlockStorageDevice class. Available in OS X v10.2 and later. Declared in IOCDBlockStorageDevice.h.
610
Declared in
IOCDMedia.h
Overview
This header contains the IOCDMedia class definition.
Constants
See the Overview for header-level documentation.
Defines
kIOCDMediaClass "IOCDMedia" kIOCDMediaTOCKey "TOC" kIOCDMediaTypeKey "Type" kIOCDMediaTypeR "CD-R" kIOCDMediaTypeROM "CD-ROM" kIOCDMediaTypeRW "CD-RW"
Constants
kIOCDMediaClass
kIOCDMediaClass is the name of the IOCDMedia class. kIOCDMediaClass is the name of the IOCDMedia class. Available in OS X v10.0 and later. Declared in IOCDMedia.h.
611
kIOCDMediaTOCKey
kIOCDMediaTOCKey is a property of IOCDMedia objects. It has an OSData value and a CDTOC structure. The kIOCDMediaTOCKey property contains the CD's full table of contents, formatted as a CDTOC structure. The CDTOC structure is same as what is returned by a READ TOC command, format 0x02. All fields in the TOC are guaranteed to be binary-encoded (no BCD-encoded numbers are ever passed). Available in OS X v10.0 and later. Declared in IOCDMedia.h.
kIOCDMediaTypeKey
kIOCDMediaTypeKey is a property of IOCDMedia objects. It has an OSString value. The kIOCDMediaTypeKey property identifies the CD media type (CD-ROM, CD-R, CD-RW, etc). See the kIOCDMediaType contants for possible values. Available in OS X v10.0 and later. Declared in IOCDMedia.h.
kIOCDMediaTypeR
The kIOCDMediaTypeKey constant for CD Recordable (CD-R) media. Available in OS X v10.0 and later. Declared in IOCDMedia.h.
kIOCDMediaTypeROM
The kIOCDMediaTypeKey constant for CD-ROM media (inclusive of the CD-I, CD-ROM XA, and CD Audio standards, and mixed mode combinations thereof ). Available in OS X v10.0 and later. Declared in IOCDMedia.h.
kIOCDMediaTypeRW
The kIOCDMediaTypeKey constant for CD ReWritable (CD-RW) media. Available in OS X v10.0 and later. Declared in IOCDMedia.h.
612
Declared in
IODVDBlockStorageDevice.h
Overview
This header contains the IODVDBlockStorageDevice class definition.
Included Headers
<IOKit/storage/IODVDTypes.h>
Constants
See the Overview for header-level documentation.
Defines
Constants
kIODVDBlockStorageDeviceClass
kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. kIODVDBlockStorageDeviceClass is the name of the IODVDBlockStorageDevice class. Available in OS X v10.2 and later. Declared in IODVDBlockStorageDevice.h.
613
Declared in
IODVDMedia.h
Overview
This header contains the IODVDMedia class definition.
Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define
kIODVDMediaClass "IODVDMedia" kIODVDMediaTypeHDR "HD DVD-R" kIODVDMediaTypeHDRAM "HD DVD-RAM" kIODVDMediaTypeHDROM "HD DVD-ROM" kIODVDMediaTypeHDRW "HD DVD-RW" kIODVDMediaTypeKey "Type" kIODVDMediaTypePlusR "DVD+R" kIODVDMediaTypePlusRW "DVD+RW" kIODVDMediaTypeR "DVD-R" kIODVDMediaTypeRAM "DVD-RAM" kIODVDMediaTypeROM "DVD-ROM" kIODVDMediaTypeRW "DVD-RW"
Constants
kIODVDMediaClass
kIODVDMediaClass is the name of the IODVDMedia class. kIODVDMediaClass is the name of the IODVDMedia class. Available in OS X v10.0 and later. Declared in IODVDMedia.h.
614
kIODVDMediaTypeHDR
The kIODVDMediaTypeKey constant for HD DVD Recordable (HD DVD-R) media. Available in OS X v10.5 and later. Declared in IODVDMedia.h.
kIODVDMediaTypeHDRAM
The kIODVDMediaTypeKey constant for HD DVD-RAM media. Available in OS X v10.5 and later. Declared in IODVDMedia.h.
kIODVDMediaTypeHDROM
The kIODVDMediaTypeKey constant for HD DVD-ROM media. Available in OS X v10.5 and later. Declared in IODVDMedia.h.
kIODVDMediaTypeHDRW
The kIODVDMediaTypeKey constant for HD DVD ReWritable (HD DVD-RW) media. Available in OS X v10.5 and later. Declared in IODVDMedia.h.
kIODVDMediaTypeKey
kIODVDMediaTypeKey is a property of IODVDMedia objects. It has an OSString value. The kIODVDMediaTypeKey property identifies the DVD media type (DVD-ROM, DVD-R, DVD-RW, DVD+RW, DVD-RAM, etc). See the kIODVDMediaType contants for possible values. Available in OS X v10.0 and later. Declared in IODVDMedia.h.
kIODVDMediaTypePlusR
The kIODVDMediaTypeKey constant for DVD "Plus" Recordable (DVD+R) media. Available in OS X v10.3 and later. Declared in IODVDMedia.h.
kIODVDMediaTypePlusRW
The kIODVDMediaTypeKey constant for DVD "Plus" ReWritable (DVD+RW) media. Available in OS X v10.0 and later. Declared in IODVDMedia.h.
kIODVDMediaTypeR
The kIODVDMediaTypeKey constant for DVD Recordable (DVD-R) media. Available in OS X v10.0 and later. Declared in IODVDMedia.h.
615
kIODVDMediaTypeRAM
The kIODVDMediaTypeKey constant for DVD-RAM media. Available in OS X v10.0 and later. Declared in IODVDMedia.h.
kIODVDMediaTypeROM
The kIODVDMediaTypeKey constant for DVD-ROM media. Available in OS X v10.0 and later. Declared in IODVDMedia.h.
kIODVDMediaTypeRW
The kIODVDMediaTypeKey constant for DVD ReWritable (DVD-RW) media. Available in OS X v10.0 and later. Declared in IODVDMedia.h.
616
IODataQueueClient.h Reference
Declared in
IODataQueueClient.h
Overview
Included Headers
Functions
See the Overview for header-level documentation.
IODataQueueAllocateNotificationPort
Allocates and returns a new mach port able to receive data available notifications from an IODataQueue.
mach_port_t IODataQueueAllocateNotificationPort();
Return Value Returns a newly allocated mach port on success. On failure, it returns MACH_PORT_NULL.
617
Discussion This port is intended to be passed down into the kernel and into an IODataQueue to allow it to send the appropriate notification. The returned mach port is allocated with a queue limit of one message. This allows only one mach message to be queued up at a time. The IODataQueue code is written with the restriction in mind and will only queue up a message if no messages alread have been sent. Availability Available in OS X v10.0 and later. Declared in
IODataQueueClient.h
IODataQueueDataAvailable
Used to determine if more data is avilable on the queue.
Parameters
dataQueue
The IODataQueueMemory region mapped from the kenel. Return Value Returns true if data is available and false if not. Availability Available in OS X v10.0 and later. Declared in
IODataQueueClient.h
IODataQueueDequeue
Dequeues the next available entry on the queue and copies it into the given data pointer.
618
Parameters
dataQueue
A pointer to the data memory region in which to copy the next entry data on the queue. If this parameter is 0 (NULL), it will simply move to the next entry.
dataSize
A pointer to the size of the data parameter. On return, this contains the size of the actual entry data even if the original size was not large enough. Return Value Returns kIOReturnSuccess on success. Other return values possible are: kIOReturnUnderrun - queue is empty, kIOReturnBadArgument - no dataQueue or no dataSize, kIOReturnNoSpace - dataSize is too small for entry. Discussion This function will dequeue the next available entry on the queue. If a data pointer is provided, it will copy the data into the memory region if there is enough space available as specified in the dataSize parameter. If no data pointer is provided, it will simply move the head value past the current entry. Availability Available in OS X v10.0 and later. Declared in
IODataQueueClient.h
IODataQueueEnqueue
Enqueues a new entry on the queue.
Parameters
dataQueue
The IODataQueueMemory region mapped from the kernel created from an IOSharedDataQueue.
data
619
dataSize
Size of the data pointed to by data. Return Value Returns kIOReturnSuccess on success. Other return values possible are: kIOReturnOverrun - queue is full. Discussion This method adds a new data entry of dataSize to the queue. It sets the size parameter of the entry pointed to by the tail value and copies the memory pointed to by the data parameter in place in the queue. Once that is done, it moves the tail to the next available location. When attempting to add a new entry towards the end of the queue and there isn't enough space at the end, it wraps back to the beginning. If the queue is empty when a new entry is added, the port specified in IODataQueueSetNotificationPort will be used to send a message to the client process that data is now available.
Please note that using this method without mapped memory create from an IOSharedDataQueue will result in undefined behavior.
IODataQueuePeek
Used to peek at the next entry on the queue.
Parameters
dataQueue
The IODataQueueMemory region mapped from the kernel. Return Value Returns a pointer to the next IODataQueueEntry if one is available. Zero is returned if the queue is empty. Discussion This function can be used to look at the next entry which allows the entry to be received without having to copy it with IODataQueueDequeue. In order to do this, call IODataQueuePeek to get the entry. Then call IODataQueueDequeue with a NULL data pointer. That will cause the head to be moved to the next entry, but no memory to be copied.
620
IODataQueueSetNotificationPort
Creates a simple mach message targeting the mach port specified in port.
Parameters
dataQueue
The IODataQueueMemory region mapped from the kernel created from an IOSharedDataQueue.
notifyPort
The mach port to target with the notification message. Return Value Returns kIOReturnSuccess on success. Returns kIOReturnBadArgument if either dataQueue is 0 (NULL). Discussion This message is sent when data is added to an empty queue. It is to notify another user process that new data has become available. Please note that using this method without mapped memory create from an IOSharedDataQueue will result
in undefined behavior.
IODataQueueWaitForAvailableData
Wait for an incoming dataAvailable message on the given notifyPort.
621
Parameters
dataQueue
Mach port on which to listen for incoming messages. Return Value Returns kIOReturnSuccess on success. Returns kIOReturnBadArgument if either dataQueue is 0 (NULL) or notiryPort is MACH_PORT_NULL. Returns the result of the mach_msg() listen call on the given port. Discussion This method will simply wait for an incoming message on the given notifyPort. Once it is received, the return from mach_msg() is returned. Availability Available in OS X v10.0 and later. Declared in
IODataQueueClient.h
622
Declared in
IODataQueueShared.h
Overview
Included Headers
Data Types
See the Overview for header-level documentation.
IODataQueueAppendix
A struct mapping to the appendix region of a data queue.
Discussion This struct is variable sized dependent on the version. The struct represents the data queue appendix information. Availability Available in OS X v10.5 and later. Declared in
IODataQueueShared.h
623
IODataQueueEntry
Represents an entry within the data queue
Discussion This is a variable sized struct. The data field simply represents the start of the data region. The size of the data region is stored in the size field. The whole size of the specific entry is the size of a UInt32 plus the size of the data region. Availability Available in OS X v10.0 and later. Declared in
IOSharedDataQueue.h
IODataQueueMemory
A struct mapping to the header region of a data queue.
typedef struct _IODataQueueMemory { UInt32 queueSize; volatile UInt32 head; volatile UInt32 tail; IODataQueueEntry queue[1]; } IODataQueueMemory;
Discussion This struct is variable sized. The struct represents the data queue header information plus a pointer to the actual data queue itself. The size of the struct is the combined size of the header fields (3 * sizeof(UInt32)) plus the actual size of the queue region. This size is stored in the queueSize field. Availability Available in OS X v10.0 and later. Declared in
IODataQueue.h
624
Constants
See the Overview for header-level documentation.
Defines
#define DATA_QUEUE_ENTRY_HEADER_SIZE (sizeof(IODataQueueEntry) - 4) #define DATA_QUEUE_MEMORY_APPENDIX_SIZE (sizeof(IODataQueueAppendix)) #define DATA_QUEUE_MEMORY_HEADER_SIZE (sizeof(IODataQueueMemory) - sizeof(IODataQueueEntry))
Constants
DATA_QUEUE_ENTRY_HEADER_SIZE
Represents the size of the data queue entry header independent of the actual size of the data in the entry. This is the overhead of each entry in the queue. The total size of an entry is equal to this value plus the size stored in the entry's size field (in IODataQueueEntry). Available in OS X v10.0 and later. Declared in IODataQueueShared.h.
DATA_QUEUE_MEMORY_APPENDIX_SIZE
Represents the size of the data queue memory appendix independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of queue header and size of the queue data region which is stored in the queueSize field of IODataQueueMeory. Available in OS X v10.5 and later. Declared in IODataQueueShared.h.
DATA_QUEUE_MEMORY_HEADER_SIZE
Represents the size of the data queue memory header independent of the actual size of the queue data itself. The total size of the queue memory is equal to this value plus the size of the queue appendix and the size of the queue data region which is stored in the queueSize field of IODataQueueMeory. Available in OS X v10.0 and later. Declared in IODataQueueShared.h.
625
Declared in
IOEthernetController.h
Overview
Included Headers
<IOKit/network/IONetworkController.h>
Constants
See the Overview for header-level documentation.
Defines
#define kIOEthernetAddressSize 6 #define kIOEthernetControllerClass "IOEthernetController" #define kIOEthernetCRCSize 4 #define kIOEthernetDisabledWakeOnLANFilterGroup \ "IOEthernetDisabledWakeOnLANFilterGroup" #define kIOEthernetMaxPacketSize 1518 #define kIOEthernetMinPacketSize 64 #define kIOEthernetWakeOnLANFilterGroup "IOEthernetWakeOnLANFilterGroup"
Constants
kIOEthernetAddressSize
The number of bytes in an Ethernet hardware address. Available in OS X v10.0 and later. Declared in IOEthernetController.h.
626
kIOEthernetControllerClass
kIOEthernetControllerClass is the name of the IOEthernetController class. Available in OS X v10.0 and later. Declared in IOEthernetController.h.
kIOEthernetCRCSize
The size in bytes of the 32-bit CRC value appended to the end of each Ethernet frame. Available in OS X v10.0 and later. Declared in IOEthernetController.h.
kIOEthernetDisabledWakeOnLANFilterGroup
kIOEthernetDisabledWakeOnLANFilterGroup describes the name assigned to the disabled Ethernet Wake-On-LAN filter group. This group represents wake filters that are currently disabled. Membership in this group is dynamic. Available in OS X v10.6 and later. Declared in IOEthernetController.h.
kIOEthernetMaxPacketSize
The maximum size of an Ethernet packet, including the FCS bytes. Available in OS X v10.0 and later. Declared in IOEthernetController.h.
kIOEthernetMinPacketSize
The minimum size of an Ethernet packet, including the FCS bytes. Available in OS X v10.0 and later. Declared in IOEthernetController.h.
kIOEthernetWakeOnLANFilterGroup
kIOEthernetWakeOnLANFilterGroup describes the name assigned to the Ethernet Wake-On-LAN filter group. This group represents wake filters that are supported by the controller. Available in OS X v10.0 and later. Declared in IOEthernetController.h.
627
Constants
kIOEthernetWakeOnMagicPacket
Reception of a packet which passes through any of the address filtering mechanisms based on its destination Ethernet address. This may include unicast, broadcast, or multicast addresses depending on the current state and setting of the corresponding packet filters. Available in OS X v10.1 and later. Declared in IOEthernetController.h. Discussion Each filter listed will respond to a network event that will trigger a system wake-up.
628
Declared in
IOEthernetInterface.h
Overview Constants
See the Overview for header-level documentation.
Defines
Constants
kIOActivePacketFilters
A property of IOEthernetInterface objects. The kIOActivePacketFilters property has an OSDictionary value that describes the current set of packet filters that have been successfully activated. Each entry in the dictionary is a key/value pair consisting of the filter group name, and an OSNumber describing the set of active filters for that group. Entries in this dictionary will mirror those in kIORequiredPacketFilters if the controller has reported success for all filter change requests from the IOEthernetInterface object. Available in OS X v10.0 and later. Declared in IOEthernetInterface.h.
kIOEthernetInterfaceClass
The name of the IOEthernetInterface class. Available in OS X v10.0 and later. Declared in IOEthernetInterface.h.
629
kIOMulticastAddressList
A property of IOEthernetInterface objects. The kIOMulticastAddressList property is an OSData object that describes the list of multicast addresses that are being used by the controller to match against the destination address of an incoming frame. Available in OS X v10.0 and later. Declared in IOEthernetInterface.h.
kIORequiredPacketFilters
A property of IOEthernetInterface objects. The kIORequiredPacketFilters property has an OSDictionary value that describes the current set of required packet filters. Each entry in the dictionary is a key/value pair consisting of the filter group name, and an OSNumber describing the set of required filters for that group. Available in OS X v10.0 and later. Declared in IOEthernetInterface.h.
630
Declared in
IOEthernetStats.h
Overview
Ethernet statistics.
Data Types
See the Overview for header-level documentation.
IODot3CollEntry
Discussion Collision statistics structure. Availability Available in OS X v10.0 and later. Declared in
IOEthernetStats.h
IODot3RxExtraEntry
631
UInt32 collisionErrors; UInt32 phyErrors; UInt32 timeouts; UInt32 interrupts; UInt32 resets; UInt32 resourceErrors; UInt32 reserved[4]; } IODot3RxExtraEntry;
Discussion Extra receiver statistics not defined by RFC1650. Availability Available in OS X v10.0 and later. Declared in
IOEthernetStats.h
IODot3StatsEntry
typedef struct { UInt32 alignmentErrors; UInt32 fcsErrors; UInt32 singleCollisionFrames; UInt32 multipleCollisionFrames; UInt32 sqeTestErrors; UInt32 deferredTransmissions; UInt32 lateCollisions; UInt32 excessiveCollisions; UInt32 internalMacTransmitErrors; UInt32 carrierSenseErrors; UInt32 frameTooLongs; UInt32 internalMacReceiveErrors; UInt32 etherChipSet; UInt32 missedFrames; } IODot3StatsEntry;
Discussion Ethernet MIB statistics structure. Availability Available in OS X v10.0 and later. Declared in
IOEthernetStats.h
632
IODot3TxExtraEntry
typedef struct { UInt32 underruns; UInt32 jabbers; UInt32 phyErrors; UInt32 timeouts; UInt32 interrupts; UInt32 resets; UInt32 resourceErrors; UInt32 reserved[4]; } IODot3TxExtraEntry;
Discussion Extra transmitter statistics not defined by RFC1650. Availability Available in OS X v10.0 and later. Declared in
IOEthernetStats.h
IOEthernetStats
typedef struct { IODot3StatsEntry dot3StatsEntry; IODot3CollEntry dot3CollEntry; IODot3RxExtraEntry dot3RxExtraEntry; IODot3TxExtraEntry dot3TxExtraEntry; } IOEthernetStats;
Discussion Aggregate Ethernet statistics structure. Availability Available in OS X v10.0 and later. Declared in
IOEthernetStats.h
633
Constants
See the Overview for header-level documentation.
Defines
Constants
kIOEthernetStatsKey
Defines the name of an IONetworkData that contains an IOEthernetStats. Available in OS X v10.0 and later. Declared in IOEthernetStats.h.
634
Declared in
IOFilterScheme.h
Overview
This header contains the IOFilterScheme class definition.
Constants
See the Overview for header-level documentation.
Defines
Constants
kIOFilterSchemeClass
The name of the IOFilterScheme class. kIOFilterSchemeClass is the name of the IOFilterScheme class. Available in OS X v10.3 and later. Declared in IOFilterScheme.h.
635
IOFireWireAVCLib.h Reference
Declared in
IOFireWireAVCLib.h
Overview
Included Headers
Callbacks
See the Overview for header-level documentation.
IOFWAVCCommandHandlerCallback
Callback called when a incoming AVC command matching a registered command handler is received.
typedef IOReturn ( *IOFWAVCCommandHandlerCallback)( void *refCon, UInt32 generation, UInt16 srcNodeID, IOFWSpeed speed, const UInt8 *command, UInt32 cmdLen);
Parameters
refCon
The FireWire bus generation value at the time the command was received
636
srcNodeID
The length of the AVC command bytes buffer in bytes Return Value The callback handler should return success if it will send the AVC response, or an error if it doesn't want to handle the command Availability Available in OS X v10.3 and later. Declared in
IOFireWireAVCLib.h
IOFWAVCPCRCallback
Callback called after a successful lock transaction to a CMP plug.
typedef void ( *IOFWAVCPCRCallback)( void *refcon, UInt32 generation, UInt16 nodeID, UInt32 plug, UInt32 oldVal, UInt32 newVal);
Parameters
refcon
637
oldVal
is the quad written into the plug Availability Available in OS X v10.2 and later. Declared in
IOFireWireAVCLib.h
IOFWAVCRequestCallback
This Callback has been deprecated. Use installAVCCommandHandler instead.
typedef IOReturn ( *IOFWAVCRequestCallback)( void *refCon, UInt32 generation, UInt16 srcNodeID, const UInt8 *command, UInt32 cmdLen, UInt8 *response, UInt32 *responseLen);
IOFWAVCSubunitPlugHandlerCallback
Callback called when a incoming AVC command matching a registered command handler is received.
typedef IOReturn ( *IOFWAVCSubunitPlugHandlerCallback)( void *refCon, UInt32 subunitTypeAndID, IOFWAVCPlugTypes plugType, UInt32 plugNum,
638
Parameters
refCon
The parameters associated with the plug message Return Value The return value is only pertinent for the kIOFWAVCSubunitPlugMsgSignalFormatModified message. Return an error if not accepting the sig format change. Availability Available in OS X v10.3 and later. Declared in
IOFireWireAVCLib.h
639
Declared in
IOFireWireFamilyCommon.h
Overview
This file contains useful definitions for working with FireWire in the kernel and in user space
Included Headers
<IOKit/IOTypes.h> <IOKit/IOKitLib.h>
Constants
See the Overview for header-level documentation.
NodeFlags
Flags that specify characteristics of the FireWire device node.
enum { kIOFWDisablePhysicalAccess = ( 1 << 0), kIOFWDisableAllPhysicalAccess = ( 1 << 1), kIOFWEnableRetryOnAckD = ( 1 << 2), kIOFWLimitAsyncPacketSize = ( 1 << 3), kIOFWDisablePhyOnSleep = ( 1 << 4), kIOFWMustBeRoot = ( 1 << 5), kIOFWMustNotBeRoot = (
640
Constants
kIOFWDisablePhysicalAccess
Disable physical memory access Available in OS X v10.1 and later. Declared in IOFireWireFamilyCommon.h.
kIOFWDisableAllPhysicalAccess
Disable all physical memory access Available in OS X v10.1 and later. Declared in IOFireWireFamilyCommon.h.
kIOFWEnableRetryOnAckD
Limit async packet size Available in OS X v10.3 and later. Declared in IOFireWireFamilyCommon.h.
kIOFWDisablePhyOnSleep
Disable Phy, when machine is in Sleep mode Available in OS X v10.3 and later. Declared in IOFireWireFamilyCommon.h.
kIOFWMustBeRoot
Attempt to make this device root, There is no guarentee Mac OS will succeed in making the device root. Available in OS X v10.5 and later. Declared in IOFireWireFamilyCommon.h.
kIOFWMustNotBeRoot
Attempt to prevent this device from being root, There is no guarentee Mac OS will succeed in preventing the device from being root. Available in OS X v10.5 and later. Declared in IOFireWireFamilyCommon.h.
641
kIOFWMustHaveGap63
Attempt to ensure the gap count is 63, when this device is on the bus. Gap 63 reduces bus performance significantly, so this flag should be used only when absolutely necessary. There is no guarentee Mac OS will succeed in forcing the gap count to 63. Available in OS X v10.5 and later. Declared in IOFireWireFamilyCommon.h.
642
IOFireWireLib.h Reference
Declared in
IOFireWireLib.h
Overview
IOFireWireLib is the software used by user space software to communicate with FireWire devices and control the FireWire bus. IOFireWireLib is the lowest-level FireWire interface available in user space. To communicate with a device on the FireWire bus, an instance of IOFireWireDeviceInterface (a struct which is defined below) is created. The methods of IOFireWireDeviceInterface allow you to communicate with the device and create instances of other interfaces which provide extended functionality (for example, creation of unit directories on the local machine). References to interfaces should be kept using the interface reference typedefs defined herein. For example, you should use IOFireWireLibDeviceRef to refer to instances of IOFireWireDeviceInterface, IOFireWireLibCommandRef to refer to instances of IOFireWireCommandInterface, and so on. To obtain an IOFireWireDeviceInterface for a device on the FireWire bus, use the function IOCreatePlugInInterfaceForService() defined in IOKit/IOCFPlugIn.h. (Note the "i" in "PlugIn" is always upper-case.) Quick usage reference:
'service' is a reference to the IOKit registry entry of the kernel object (usually of type IOFireWireDevice) representing the device of interest. This reference can be obtained using the functions defined in IOKit/IOKitLib.h. 'plugInType' should be CFUUIDGetUUIDBytes(kIOCFPlugInInterfaceID) 'interfaceType' should be CFUUIDGetUUIDBytes(kIOFireWireLibTypeID) when using IOFireWireLib
The interface returned by IOCreatePlugInInterfaceForService() should be deallocated using IODestroyPlugInInterface(). Do not call Release() on it.
Included Headers
<CoreFoundation/CoreFoundation.h> <IOKit/IOCFPlugIn.h>
643
<IOKit/firewire/IOFireWireFamilyCommon.h>
Functions
See the Overview for header-level documentation.
IOVirtualRangeMake
Callbacks
See the Overview for header-level documentation.
IOFireWireBusResetDoneHandler
Called when a bus reset has occured and FireWire has completed configuring the bus.
typedef void ( *IOFireWireBusResetDoneHandler)( IOFireWireLibDeviceRef interface, FWClientCommandID commandID ); // parameters may change
Parameters
interface
644
IOFireWireBusResetHandler
Called when a bus reset has occured, but before FireWire has completed configuring the bus.
typedef void ( *IOFireWireBusResetHandler)( IOFireWireLibDeviceRef interface, FWClientCommandID commandID ); // parameters may change
Parameters
interface
IOFireWireLibCommandCallback
Callback called when an asynchronous command has completed executing
Parameters
refCon
A user specified reference value set before command object was submitted Availability Available in OS X v10.0 and later.
645
Declared in
IOFireWireLib.h
IOFireWireLibIRMAllocationLostNotificationProc
Callback called when an IOFireWireLibIRMAllocationRef fails to reclaim IRM resources after a bus-reset
IOFireWireLibPHYPacketCallback
Callback called to handle incoming PHY packets
typedef void ( *IOFireWireLibPHYPacketCallback)( IOFireWireLibPHYPacketListenerRef listener, FWClientCommandID commandID, UInt32 data1, UInt32 data2, void *refCon );
Parameters
listener
646
IOFireWireLibPHYPacketSkippedCallback
Callback called when incoming packets have been dropped from the internal queue
typedef void ( *IOFireWireLibPHYPacketSkippedCallback)( IOFireWireLibPHYPacketListenerRef listener, FWClientCommandID commandID, UInt32 skippedPacketCount, void *refCon );
Parameters
listener
user specified reference value specified on the listener Availability Available in OS X v10.5 and later. Declared in
IOFireWireLib.h
IOFireWirePseudoAddressSpaceReadHandler
This callback is called to handle read requests to pseudo address spaces. This function should fill in the specified area in the pseudo address space backing store and call ClientCommandIsComplete with the specified command ID
647
FWClientCommandID commandID, UInt32 packetLen, UInt32 packetOffset, UInt16 srcNodeID, // nodeID of requester UInt32 destAddressHi, // destination on this node UInt32 destAddressLo, void *refCon);
Parameters
addressSpace
An FWClientCommandID which should be passed to ClientCommandIsComplete when the buffer has been filled in
packetLen
user specified reference number passed in when the address space was created Availability Available in OS X v10.0 and later. Declared in
IOFireWireLib.h
IOFireWirePseudoAddressSpaceSkippedPacketHandler
Callback called when incoming packets have been dropped from the internal queue
648
Parameters
addressSpace
The number of skipped packets Availability Available in OS X v10.0 and later. Declared in
IOFireWireLib.h
IOFireWirePseudoAddressSpaceWriteHandler
Callback called to handle write requests to a pseudo address space.
typedef UInt32 ( *IOFireWirePseudoAddressSpaceWriteHandler)( IOFireWireLibPseudoAddressSpaceRef addressSpace, FWClientCommandID commandID, UInt32 packetLen, void *packet, UInt16 srcNodeID, // nodeID of sender UInt32 destAddressHi, // destination on this node UInt32 destAddressLo, void *refCon);
Parameters
addressSpace
649
srcNodeID
user specified reference number passed in when the address space was created Availability Available in OS X v10.0 and later. Declared in
IOFireWireLib.h
IOFWAsyncStreamListenerHandler
Callback called to handle Async Stream packets.
typedef UInt32 ( *IOFWAsyncStreamListenerHandler)( IOFWAsyncStreamListenerInterfaceRef listener, FWClientCommandID commandID, UInt32 size, void *packet, void *refCon);
Parameters
listener
user specified reference number passed in when async stream interface is created Availability Available in OS X v10.5 and later.
650
Declared in
IOFireWireLib.h
IOFWAsyncStreamListenerSkippedPacketHandler
Callback called when incoming packets have been dropped from the internal queue
Parameters
listener
The number of skipped packets Availability Available in OS X v10.5 and later. Declared in
IOFireWireLib.h
Data Types
See the Overview for header-level documentation.
FWAddressSpaceFlags
typedef enum { kFWAddressSpaceNoFlags = 0, kFWAddressSpaceNoWriteAccess = ( 1 << 0), kFWAddressSpaceNoReadAccess = ( 1 << 1), kFWAddressSpaceAutoWriteReply = ( 1 << 2),
651
kFWAddressSpaceAutoReadReply = ( 1 << 3), kFWAddressSpaceAutoCopyOnWrite = ( 1 << 4), kFWAddressSpaceShareIfExists = ( 1 << 5), kFWAddressSpaceExclusive = ( 1 << 6) } FWAddressSpaceFlags;
Discussion FireWire address space creation flags Availability Available in OS X v10.0 and later. Declared in
IOFireWireLib.h
Constants
See the Overview for header-level documentation.
enum {
652
kFWCommandNoFlags = 0, kFWCommandInterfaceForceNoCopy = ( 1 << 0), kFWCommandInterfaceForceCopyAlways = ( 1 << 1), kFWCommandInterfaceSyncExecute = ( 1 << 2), kFWCommandInterfaceAbsolute = ( 1 << 3), kFWVectorCommandInterfaceOrdered = ( 1 << 4), kFWCommandInterfaceForceBlockRequest = ( 1 << 5) };
653
IOFireWireSBP2Lib.h Reference
Declared in
IOFireWireSBP2Lib.h
Overview
Included Headers
<IOKit/firewire/IOFireWireFamilyCommon.h> <IOKit/IOMessage.h>
Callbacks
See the Overview for header-level documentation.
IOFWSBP2FetchAgentWriteCallback
Parameters
refCon
refCon from last orb in chain. Availability Available in OS X v10.0 and later.
654
Declared in
IOFireWireSBP2Lib.h
IOFWSBP2LoginCallback
Parameters
refCon
Structure containing additional information about the status of the login. Availability Available in OS X v10.0 and later. Declared in
IOFireWireSBP2Lib.h
IOFWSBP2LogoutCallback
Parameters
refCon
Structure containing additional information about the status of the logout. Availability Available in OS X v10.0 and later. Declared in
IOFireWireSBP2Lib.h
655
IOFWSBP2NotifyCallback
Parameters
refCon
FWSBP2NotifyParams containing notification information. Availability Available in OS X v10.0 and later. Declared in
IOFireWireSBP2Lib.h
IOFWSBP2ORBAppendCallback
Parameters
refCon
refCon set on management orb. Availability Available in OS X v10.0 and later. Declared in
IOFireWireSBP2Lib.h
656
IOFWSBP2ORBCompleteCallback
Parameters
refCon
refCon set on management orb. Availability Available in OS X v10.0 and later. Declared in
IOFireWireSBP2Lib.h
IOFWSBP2StatusCallback
Parameters
refCon
Indicates success or failure of operation. Availability Available in OS X v10.0 and later. Declared in
IOFireWireSBP2Lib.h
657
Data Types
See the Overview for header-level documentation.
FWSBP2LoginCompleteParams
typedef struct { void *refCon; // refCon from login object UInt32 generation; // generation this login was attempted in IOReturn status; // status of login attempt FWSBP2LoginResponse *loginResponse; // pointer to loginResponse buffer FWSBP2StatusBlock *statusBlock; // pointer to statusBlock buffer UInt32 statusBlockLength; // size of statusBlock buffer } FWSBP2LoginCompleteParams;
FWSBP2LoginResponse
typedef struct { UInt16 length; UInt16 loginID; UInt32 commandBlockAgentAddressHi; UInt32 commandBlockAgentAddressLo; UInt16 reserved; UInt16 reconnectHold; } FWSBP2LoginResponse;
FWSBP2LogoutCompleteParams
typedef struct {
658
void *refCon; // refCon from login object UInt32 generation; // generation this login was attempted in IOReturn status; // status of login attempt FWSBP2StatusBlock *statusBlock; // pointer to statusBlock buffer UInt32 statusBlockLength; // size of statusBlock buffer } FWSBP2LogoutCompleteParams;
FWSBP2NotifyParams
typedef struct { void *refCon; // refCon from ORB object UInt32 notificationEvent; const void *message; UInt32 length; UInt32 generation; } FWSBP2NotifyParams;
FWSBP2ReconnectParams
typedef struct { void *refCon; // refCon from lun object UInt32 generation; // generation this login was attempted in IOReturn status; // status of reconnect attempt FWSBP2StatusBlock *reconnectStatusBlock; // pointer to statusBlock buffer UInt32 reconnectStatusBlockLength; // size of statusBlock buffer } FWSBP2ReconnectParams;
659
Declared in
IOFireWireSBP2Login.h
FWSBP2StatusBlock
typedef struct { UInt8 details; UInt8 sbpStatus; UInt16 orbOffsetHi; UInt32 orbOffsetLo; UInt32 status[6]; } FWSBP2StatusBlock;
FWSBP2VirtualRange
Discussion Virtual address range for SBP2. Availability Available in OS X v10.0 and later. Declared in
IOFireWireSBP2Lib.h
Constants
See the Overview for header-level documentation.
660
IODirection
enum IODirection { kIODirectionNone = 0, kIODirectionIn = 1, // User land 'read' kIODirectionOut = 2, // User land 'write' kIODirectionOutIn = 3 };
enum { kFWSBP2CommandCompleteNotify = ( 1 << 0), kFWSBP2CommandTransferDataFromTarget = ( 1 << 1), kFWSBP2CommandImmediate = ( 1 << 2), kFWSBP2CommandNormalORB = ( 1 << 5), kFWSBP2CommandReservedORB = ( 1 << 6), kFWSBP2CommandVendorORB = ( 1 << 7), kFWSBP2CommandDummyORB = ( 1 << 8), kFWSBP2CommandCheckGeneration = (
661
1 << 9), kFWSBP2CommandFixedSize = ( 1 << 10), kFWSBP2CommandVirtualORBs = ( 1 << 11) // handy for debugging };
enum { kFWSBP2QueryLogins = 1, kFWSBP2AbortTask = 0xb, kFWSBP2AbortTaskSet = 0xc, kFWSBP2LogicalUnitReset = 0xe, kFWSBP2TargetReset = 0xf };
662
Overview Constants
See the Overview for header-level documentation.
Defines
663
Constants
kIOPropertyBridgeCharacteristicsKey
This key is used to define Bridge Characteristics for a particular devices's bridge chipset. It has an associated dictionary which lists the bridge characteristics. Requirement: Optional Example:
<dict> <key>Bridge Characteristics</key> <dict> <key>Bridge Vendor Name</key> <string>Oxford Semiconductor</string> <key>Bridge Model Name</key> <string>FW911</string> <key>Bridge Revision Level</key> <string>3.7</string> </dict> </dict>
664
Declared in
IOFramebufferShared.h
Overview
The IOFramebufferShared.h header contains definitions of objects and types shared between a kernel level IOFrameBuffer service and a non-kernel window server. In OS X this structure is used by the CoreGraphics server and IOGraphics Family, and is not available to other clients. IOFramebuffer subclasses and IOFramebuffer clients within the kernel should also not rely on this structure definition and constants. It is public only for use on Darwin based window servers. Cursor and window server state data is exchanged by kernel and non-kernel tasks through a slice of shared memory containing a StdFBShmem_t structure. For a non-kernel task to get access to this slice of shared memory, a connection to an IOFramebuffer service must be made. A connection is made with the IOServiceOpen() function described in IOKitLib.h. A connection type of kIOFBServerConnectType or kIOFBSharedConnectType (for read-only access) should be specified. An io_connect_t handle is returned by IOServiceOpen(). This handle must be passed to IOFBCreateSharedCursor() to create the slice of shared memory. Then IOConnectMapMemory() may be called with a memory type of kIOFBCursorMemory to map the shared memory into the non-kernel task.
Included Headers
Data Types
See the Overview for header-level documentation.
bm12Cursor
Cursor image for 1-bit cursor.
665
struct bm12Cursor { unsigned int image[4][16]; unsigned int mask[4][16]; unsigned int save[16]; };
Fields
image
This array stores the pixel values of the region underneath the cursor in its last drawn position. Discussion This structure stores 16 pixel x 16 pixel cursors to be used with 1-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
bm18Cursor
Cursor image for 8-bit cursor.
struct bm18Cursor { unsigned char image[4][256]; unsigned char mask[4][256]; unsigned char save[256]; };
Fields
image
This array contains cursor color values, which are converted to displayed colors through the color table. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel.
mask
This array contains the cursor alpha mask. The array is two dimensional with the same indexing as the image. If an alpha mask pixel is 0 and the corresponding image pixel is set to white for the display, then this cursor pixel will invert pixels on the display.
save
This array stores the color values of the region underneath the cursor in its last drawn position.
666
Discussion This structure stores 16 pixel x 16 pixel cursors to be used with 8-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
bm34Cursor
Cursor image for 15-bit cursor.
Fields
image
This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. A value of 0 means the pixel is transparent. Non-zero values are stored with the red, green, blue, and alpha values encoded with the following masks: red mask = 0xF000 blue mask 0x0F00 green mask 0x00F0 alpha mask = 0x000F Note, only 4 bits are allocated for each color component.
save
This array stores the color values of the region underneath the cursor in its last drawn position. Discussion This structure stores 16 pixel x 16 pixel cursors to be used with 15-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
bm38Cursor
Cursor image for 24-bit cursor.
667
Fields
image
This array defines the cursor color values and transparency. The array is two dimensional and its first index is the cursor frame and the second index is the cursor pixel. The lower 24 bits of a pixel's value contain the RGB color, while the upper 8 bits contain the alpha value.
save
This array stores the color values of the region underneath the cursor in its last drawn position. Discussion This structure stores 16 pixel x 16 pixel cursors to be used with 24-bit color depth. This structure is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined.
StdFBShmem_t
struct StdFBShmem_t { OSSpinLock cursorSema; int frame; char cursorShow; char cursorObscured; char shieldFlag; char shielded; IOGBounds saveRect; IOGBounds shieldRect; IOGPoint cursorLoc; IOGBounds cursorRect; IOGBounds oldCursorRect; IOGBounds screenBounds; int version; int structSize; AbsoluteTime vblTime; AbsoluteTime vblDelta; unsigned long long int vblCount; #if IOFB_ARBITRARY_FRAMES_CURSOR unsigned long long int vblDrift; unsigned long long int vblDeltaMeasured; unsigned int reservedC[24]; #else unsigned int reservedC[27]; unsigned char hardwareCursorFlags[kIOFBNumCursorFrames]; #endif unsigned char hardwareCursorCapable;
668
unsigned char hardwareCursorActive; unsigned char hardwareCursorShields; unsigned char reservedB[1]; #if IOFB_ARBITRARY_FRAMES_CURSOR IOGSize cursorSize[kIOFBNumCursorIndex]; IOGPoint hotSpot[kIOFBNumCursorIndex]; #else IOGSize cursorSize[kIOFBNumCursorFrames]; IOGPoint hotSpot[kIOFBNumCursorFrames]; #endif #ifndef IOFB_ARBITRARY_SIZE_CURSOR union { struct bm12Cursor bw; struct bm18Cursor bw8; struct bm34Cursor rgb; struct bm38Cursor rgb24; } cursor; #else /* IOFB_ARBITRARY_SIZE_CURSOR */ unsigned char cursor[0]; #endif /* IOFB_ARBITRARY_SIZE_CURSOR */ };
Fields
cursorSema
Semaphore lock for write access to the shared data in this structure.
frame
If this is true, the cursor has been obscured and cursorShow should not be 0. The cursor will be shown again the next time it is moved.
shieldFlag
When this is set to true the cursor will not be displayed in the region specified by shieldRect.
shielded
True if the cursor has been hidden because it entered the shielded region.
saveRect
The region that is saved underneath the cursor in software cursor mode.
shieldRect
The region that the cursor will not be displayed in if shieldFlag is true.
669
cursorLoc
The region that the cursor image currently occupies in software cursor mode.
oldCursorRect
The region that the cursor image occupied the last time the cursor was drawn in software cursor mode.
screenBounds
Contains kIOFBCurrentShmemVersion so that a user client can ensure it is using the same version of this structure as the kernel.
structSize
This array contains the location of the cursor hot spots indexed by frame. The hot spots coordinates are given relative to the top left corner of the cursor image.
670
cursor
A union of structures that define the cursor images. The structure used depends on the framebuffer's bit depth. These structures are defined above. Discussion This structure contains cursor and window server state data and occupies a slice of shared memory between the kernel and window server. Several elements of this structure are only used in software cursor mode. Unless otherwise indicated, the coordinates in this structure are given in display space. Display space is the coordinate space that encompasses all the screens. The positions of the screens within display space indicate their location relative to each other as the cursor moves between them. If there is only one screen, the screen coordinates and display space coordinates will be the same.
Constants
See the Overview for header-level documentation.
Defines
Constants
CURSORHEIGHT
The maximum height of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
CURSORWIDTH
The maximum width of the cursor image in pixels. This is only defined if IOFB_ARBITRARY_SIZE_CURSOR is not defined. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
671
IOFB_ARBITRARY_SIZE_CURSOR
When IOFB_ARBITRARY_SIZE_CURSOR is not defined, the maximum cursor size is assumed to be CURSORWIDTH x CURSORHEIGHT and this header file will define a number of structures for storing cursor images accordingly. A non-kernel task may define IOFB_ARBITRARY_SIZE_CURSOR and use cursors up to the size specified when IOFBCreateSharedCursor() was called. In this case appropriate structures for storing cursor images must be defined elsewhere. In the kernel, IOFB_ARBITRARY_SIZE_CURSOR is always defined. Available in OS X v10.7 through OS X v10.7. Declared in IOFramebufferShared.h.
IOFRAMEBUFFER_CONFORMSTO
The class name of the framebuffer service. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
CursorParameters
enum { #if IOFB_ARBITRARY_FRAMES_CURSOR kIOFBMainCursorIndex = 0, kIOFBWaitCursorIndex = 1, kIOFBNumCursorIndex = 4, #else kIOFBNumCursorFrames = 4, kIOFBNumCursorFramesShift = 2, #endif kIOFBMaxCursorDepth = 32 };
Constants
kIOFBNumCursorFrames
The number of cursor images stored in the StdFBShmem_t structure. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
kIOFBNumCursorFramesShift
Used with waiting cursors. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
672
kIOFBMaxCursorDepth
The maximum cursor pixel depth. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
FramebufferConstants
enum { // version for IOFBCreateSharedCursor kIOFBShmemVersionMask = 0x000000ff, kIOFBTenPtOneShmemVersion = 2, kIOFBTenPtTwoShmemVersion = 3, kIOFBCurrentShmemVersion = 2, // number of frames in animating cursor (if > kIOFBTenPtTwoShmemVersion) kIOFBShmemCursorNumFramesMask = 0x00ff0000, kIOFBShmemCursorNumFramesShift = 16, // memory types for IOConnectMapMemory. kIOFBCursorMemory = 100 };
Constants
kIOFBCurrentShmemVersion
The current version of the slice of shared memory that contains the cursor and window server state data in the StdFBShmem_t structure. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
kIOFBCursorMemory
The memory type for IOConnectMapMemory() to get a slice of shared memory that contains the StdFBShmem_t structure. Available in OS X v10.0 and later. Declared in IOFramebufferShared.h.
673
IOGraphicsLib.h Reference
Declared in
IOGraphicsLib.h
Overview
IOGraphicsLib implements non-kernel task access to IOGraphics family object types - IOFramebuffer and IOAccelerator. These functions implement a graphics family specific API. A connection to a graphics IOService must be made before these functions are called. A connection is made with the IOServiceOpen() function described in IOKitLib.h. An io_connect_t handle is returned by IOServiceOpen(), which must be passed to the IOGraphicsLib functions. The appropriate connection type from IOGraphicsTypes.h must be specified in the call to IOServiceOpen(). All of the IOFramebuffer functions can only be called from a kIOFBServerConnectType connection. Except as specified below, functions whose names begin with IOFB are IOFramebuffer functions. Functions whose names begin with IOPS are IOAccelerator functions and must be called from connections of type kIOFBEngineControllerConnectType or kIOFBEngineConnectType. The functions in IOGraphicsLib use a number of special types. The display mode is the screen's resolution and refresh rate. The known display modes are referred to by an index of type IODisplayModeID. The display depth is the number of significant color bits used in representing each pixel. Depths are also referred to by an index value that is 0 for 8 bits, 1 for 15 bits, and 2 for 24 bits. A combination of display mode and depth may have a number of supported pixel formats. The pixel aperture is an index of supported pixel formats for a display mode and depth. This index is of type IOPixelAperture. All of these graphics specific types are defined in IOGraphicsTypes.h.
Included Headers
674
Functions
See the Overview for header-level documentation.
IOCreateDisplayInfoDictionary
Discussion IOCreateDisplayInfoDictionary() was renamed IODisplayCreateInfoDictionary(). IOCreateDisplayInfoDictionary() is now a macro for IODisplayCreateInfoDictionary() for compatibility with older code. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IODisplayCreateInfoDictionary
Create a CFDictionary with information about display hardware.
Parameters
framebuffer
Use IODisplayDictionaryOptions to specify which keys to include. Return Value The returned CFDictionary that should be released by the caller with CFRelease(). Discussion The CFDictionary created by this function contains information about the display hardware associated with a framebuffer. The keys for the dictionary are listed in IOGraphicsTypes.h. Availability Available in OS X v10.0 and later.
675
Declared in
IOGraphicsLib.h
IODisplayMatchDictionaries
Match two display information dictionaries to see if they are for the same display.
Parameters
matching1
No options are currently defined. Return Value Returns FALSE if the two displays are not equivalent or TRUE if they are. Discussion By comparing two CFDictionaries returned from IODisplayCreateInfoDictionary(), this function determines if the displays are the same. The information compared is what is returned by calling IODisplayCreateInfoDictionary() with an option of kIODisplayMatchingInfo. This includes information such as the vendor, product, and serial number. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
676
IOFBCreateDisplayModeDictionary
Create a CFDictionary with information about a display mode.
Parameters
framebuffer
A display mode index. Return Value The returned CFDictionary that should be released by the caller with CFRelease(). Discussion This function creates a dictionary containing information about a display mode. The display mode properties that are represented by the kernel as OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, or OSBoolean are converted to their CF counterparts and put in the dictionary. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBCreateSharedCursor
Create shared cursor memory.
extern kern_return_t IOFBCreateSharedCursor( io_connect_t connect, unsigned int version, unsigned int maxWidth, unsigned int maxHeight );
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
677
version
The version of cursor shared memory to use. For the current version, pass kIOFBCurrentShmemVersion.
maxWidth
The maximum height of the cursor. Return Value A kern_return_t error code. Discussion This function allocates memory, containing details about the cursor, that can be shared with a calling non-kernel task. The memory contains a StdFBShmem_t structure, which is defined in IOFrameBufferShared.h. This structure contains information on the cursor image, whether it is current shown, its location, etc. The allocated memory can be mapped to the non-kernel task's memory space by calling IOConnectMapMemory() and passing kIOFBCursorMemory for memoryType. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetCurrentDisplayModeAndDepth
Get the current display mode and depth.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
displayMode
678
depth
The current display depth is returned (0 = 8 bits, 1 = 15 bits, 2 = 24 bits) Return Value A kern_return_t error code. Discussion The display mode index returned by this function can be used to determine information about the current display mode and its supported pixel formats through calls to IOFBGetDisplayModeInformation(), IOFBGetPixelFormats(), and IOFBGetPixelInformation(). Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetDisplayModeCount
Get the number of display modes.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
count
The display mode count is returned. Return Value A kern_return_t error code. Discussion IOFBGetDisplayModeCount returns the number of display modes that the IOFramebuffer service is aware of. Availability Available in OS X v10.0 and later.
679
Declared in
IOGraphicsLib.h
IOFBGetDisplayModeInformation
Get information about a display mode.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
displayMode
A pointer to an IODisplayModeInformation structure where the display mode information will be returned. Return Value A kern_return_t error code. Discussion Display modes are referred to by their index of type IODisplayModeID. This function returns a structure containing the width, height, refresh rate, maximum depth, etc. of a display mode. The IODisplayModeInformation structure is defined in IOGraphicsTypes.h. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetDisplayModes
Get an array of known display modes.
kern_return_t IOFBGetDisplayModes(
680
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
count
An array of IODisplayModeID's with enough space for all entries. The array is filled in upon return. Return Value A kern_return_t error code. Discussion This function returns an array containing the display modes that the framebuffer service is aware of. To get all display modes, pass the count from IOFBGetDisplayModeCount(). Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetFramebufferInformationForAperture
Get framebuffer information for a pixel format.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
681
aperture
The pixel aperture to retrieve information on. The pixel aperture is an index into supported pixel formats for a display mode and depth. To get information for the current aperture, use kIOFBSystemAperture.
info
A pointer to an IOFramebufferInformation structure where the information will be returned. Return Value A kern_return_t error code. Discussion This function returns framebuffer information for a pixel format that is supported for the current display mode and depth. The returned IOFrameBufferInformation structure contains details on the physical address of the framebuffer, height, width, etc. This structure is defined in IOGraphicsTypes.h. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetFramebufferOffsetForAperture
Get the byte offset for a framebuffer's VRAM.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
aperture
The pixel aperture to retrieve information on. The pixel aperture is an index into supported pixel formats. To get information for the current aperture, use kIOFBSystemAperture.
offset
682
Return Value A kern_return_t error code. Discussion [place holder] Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetPixelFormat
Get pixel format information.
extern kern_return_t IOFBGetPixelFormat( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth, IOPixelAperture aperture, IOPixelEncoding *pixelFormat );
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
displayMode
The pixel aperture to retrieve the pixel format for. The pixel aperture is an index into supported pixel formats. To get information on the current aperture, use kIOFBSystemAperture.
pixelFormat
683
Discussion Displayed colors are encoded in framebuffer memory in a variety of ways. IOFBGetPixelFormat returns a pixel encoding array specifying how each bit of a particular pixel should be interpreted. The definition of the IOPixelEncoding array returned and common Apple pixel formats are described in IOGraphicsTypes.h. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetPixelFormats
Get pixel formats that are supported for a display mode and depth.
kern_return_t IOFBGetPixelFormats( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth, UInt32 *mask );
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
displayMode
The returned mask of pixel formats. Return Value A kern_return_t error code. Discussion This function returns a mask of all supported pixel formats for a particular display mode and depth. [How should the mask be interpreted?]
684
IOFBGetPixelInfoDictionary
Get a CFDictionary with information about a pixel format.
Parameters
modeDictionary
A depth index.
aperture
The pixel aperture to information about. The pixel aperture is an index into supported pixel formats. To get information on the current aperture, use kIOFBSystemAperture. Return Value The returned CFDictionary that should be released by the caller with CFRelease(). Discussion This function extracts a CFDictionary containing information about a supported pixel format from a larger CFDictionary describing a display mode. IOFBCreateDisplayModeDictionary() must be called first to generate the CFDictionary for a display mode. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBGetPixelInformation
Get information about a pixel format.
685
kern_return_t IOFBGetPixelInformation( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth, IOPixelAperture aperture, IOPixelInformation *pixelInfo );
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
displayMode
A pixel aperture. The pixel aperture is an index into supported pixel formats for a display mode and depth. To get information on the current aperture, use kIOFBSystemAperture.
pixelInfo
A pointer to an IOPixelInformation structure where the pixel information will be returned. Return Value A kern_return_t error code. Discussion IOFBGetPixelInformation returns a structure containing information about a pixel format such as the bits per pixel, pixel format, etc. The IOPixelInformation structure is defined in IOGraphicsTypes.h. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSet256To888Table
[place holder]
686
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
table
Return Value A kern_return_t error code. Discussion [place holder] Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSet444To555Table
[place holder]
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
table
687
IOFBSet555To444Table
[place holder]
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
table
Return Value A kern_return_t error code. Discussion [place holder] Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSet888To256Table
[place holder]
688
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
table
Return Value A kern_return_t error code. Discussion [place holder] Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSetBounds
Set the location of the framebuffer within display space.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
rect
An IOGBounds structure specifying a rectangular region of the framebuffer. Return Value A kern_return_t error code. Discussion If there is more than one screen in use, the locations of the screens relative to each other must be specified. These locations are specified in a "display space" that encompasses all the screens. The bounding regions of the screens within display space indicate their location relative to each other as the cursor moves between
689
them. This function sets the bounding region for a framebuffer within display space. If there is only one screen, this does not need to specified, because by default the screen coordinates and display space coordinates will be the same. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSetCLUT
Set the color table.
extern kern_return_t IOFBSetCLUT( io_connect_t connect, UInt32 startIndex, UInt32 numEntries, IOOptionBits options, IOColorEntry *colors );
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
startIndex
kSetCLUTByValue may be set to use the index member of the IOColorEntry structure to determine where the entry should be written to the color table. Otherwise the index is taken from the location in the IOColorEntry array. kSetClutImmediately may be set to change the color table immediately instead of waiting for vertical blanking interval. kSetClubWithLuminance may be set to use luminance rather than RGB entries.
colors
The array of color table entries to set. The IOColorEntry structure is defined in IOGraphicsTypes.h. Return Value A kern_return_t error code.
690
Discussion Indexed pixel formats require a color table to convert from the index stored in a pixel memory location to a displayed color. IOFBSetCLUT sets one or more entries of the color table. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSetCursorPosition
Set the hardware cursor position.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
x
The x coordinate.
y
The y coordinate. Return Value A kern_return_t error code. Discussion This function only works with the hardware cursor and will fail if a hardware cursor is not supported. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
691
IOFBSetCursorVisible
Set the hardware cursor visible or invisible.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
visible
TRUE to make the cursor visible and FALSE to make it invisible. Return Value A kern_return_t error code. Discussion The hardware cursor can only be set visible or invisible when it is active. Use IOFBSetNewCursor() to activate the hardware cursor. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSetDisplayModeAndDepth
Set the current display mode and depth.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
692
displayMode
The index of the new depth. Return Value A kern_return_t error code. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSetGamma
Set the gamma data.
extern kern_return_t IOFBSetGamma( io_connect_t connect, UInt32 channelCount, UInt32 dataCount, UInt32 dataWidth, void *data );
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
channelCount dataCount dataWidth data
Return Value A kern_return_t error code. Discussion [place holder] Availability Available in OS X v10.0 and later.
693
Declared in
IOGraphicsLib.h
IOFBSetNewCursor
Set a new hardware cursor.
kern_return_t IOFBSetNewCursor( io_connect_t connect, void *cursor, IOIndex frame, IOOptionBits options );
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
cursor
An index to the cursor image to use that must be less than kIOFBNumCursorFrames. Currently only frame 0 is supported.
options
No options are currently defined. Return Value A kern_return_t error code. Discussion A non-kernel task interacts with the IOFramebuffer service through a slice of shared memory that is created with the IOFBCreateSharedCursor function. The shared memory is a structure of type StdFBShmem_t. In this shared memory several cursor images, or frames may be defined. The maximum number of frames is kIOFBNumCursorFrames. StdFBShmem_t and kIOFBNumCursorFrames are defined in IOFramebufferShared.h. This function sets a new frame to be used as the current cursor image and activates the hardware cursor. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
694
IOFBSetStartupDisplayModeAndDepth
Set the display mode and depth to use on startup.
Parameters
connect
The connect handle from IOServiceOpen() to an IOFramebuffer service with a kIOFBServerConnectType connection.
displayMode
The index of the new depth. Return Value A kern_return_t error code. Availability Available in OS X v10.0 and later. Declared in
IOGraphicsLib.h
IOFBSetVirtualBounds
Set the location of the framebuffer within display space and within desktop space.
Parameters
connect
The connect handle from IOServiceOpen to an IOFramebuffer service with a kIOFBServerConnectType connection.
695
screenBounds
An IOGBounds structure specifying a rectangular region of the framebuffer in desktop space. Return Value A kern_return_t error code. Discussion If there is more than one screen in use, the locations of the screens relative to each other must be specified. Each physical screen will have a rectangular region of "display space" that it is responsible for showing. When the "display space" does not have a 1:1 mapping to the "desktop space" (e.g when using zooming, or HiDPI), this function is used to define how "desktop space" maps into "display space". Note that "desktop space" and "display space" should be contiguous, and the mapping between them should be functional (i.e. 1-to-1, though not necessarily contiguous). Availability Available in OS X v10.7 and later. Declared in
IOGraphicsLib.h
Constants
See the Overview for header-level documentation.
IODisplayDictionaryOptions
Constants
kIODisplayMatchingInfo
Include only the keys necessary to match two displays with IODisplayMatchDictionaries(). Available in OS X v10.0 and later. Declared in IOGraphicsLib.h.
696
kIODisplayOnlyPreferredName
The kDisplayProductName property includes only the localized names returned by CFBundleCopyPreferredLocalizationsFromArray(). Available in OS X v10.4 and later. Declared in IOGraphicsLib.h.
kIODisplayNoProductName
The kDisplayProductName property is not included in the returned dictionary. Available in OS X v10.4 and later. Declared in IOGraphicsLib.h.
697
Declared in
IOGraphicsTypes.h
Overview
Included Headers
<IOKit/IOTypes.h> <IOKit/IOKitKeys.h>
Data Types
See the Overview for header-level documentation.
IOColorEntry
A structure defining one entry of a color lookup table.
Fields
index
698
blue
Value of blue component 0-65535. Discussion This structure is used by IOFramebuffer to define an entry of a color lookup table.
IODetailedTimingInformationV2
A structure defining the detailed timing information of a display mode.
struct IODetailedTimingInformationV2 { UInt32 __reservedA[3]; // Init to 0 UInt32 horizontalScaledInset; // pixels UInt32 verticalScaledInset; // lines UInt32 scalerFlags; UInt32 horizontalScaled; UInt32 verticalScaled; UInt32 signalConfig; UInt32 signalLevels; UInt64 pixelClock; // Hz UInt64 minPixelClock; // Hz - With error what is slowest actual clock UInt64 maxPixelClock; // Hz - With error what is fasted actual clock UInt32 horizontalActive; // pixels UInt32 horizontalBlanking; // pixels UInt32 horizontalSyncOffset; // pixels UInt32 horizontalSyncPulseWidth; // pixels UInt32 verticalActive; // lines UInt32 verticalBlanking; // lines UInt32 verticalSyncOffset; // lines UInt32 verticalSyncPulseWidth; // lines UInt32 horizontalBorderLeft; // pixels UInt32 horizontalBorderRight; // pixels UInt32 verticalBorderTop; // lines UInt32 verticalBorderBottom; // lines UInt32 horizontalSyncConfig; UInt32 horizontalSyncLevel; // Future use (init to 0) UInt32 verticalSyncConfig; UInt32 verticalSyncLevel; // Future use (init to 0) UInt32 numLinks; UInt32 __reservedB[7]; // Init to 0 };
Fields
__reservedA
Set to zero.
699
horizontalScaledInset
If the mode is scaled, sets the number of active pixels to remove the left and right edges in order to display an underscanned image.
verticalScaledInset
If the mode is scaled, sets the number of active lines to remove the top and bottom edges in order to display an underscanned image.
scalerFlags
If the mode is scaled, kIOScaleStretchToFit may be set to allow stretching. kIOScaleRotateFlags is mask which may have the value given by kIOScaleRotate90, kIOScaleRotate180, kIOScaleRotate270 to display a rotated framebuffer.
horizontalScaled
If the mode is scaled, sets the size of the image before scaling or rotation.
verticalScaled
If the mode is scaled, sets the size of the image before scaling or rotation.
signalConfig
kIOAnalogSetupExpected set if display expects a blank-to-black setup or pedestal. See VESA signal standards. kIOInterlacedCEATiming set for a CEA style interlaced timing: Field 1 vertical blanking = half specified vertical blanking lines. Field 2 vertical blanking = (half vertical blanking lines) + 1 line. Field 1 vertical offset = half specified vertical sync offset. Field 2 vertical offset = (half specified vertical sync offset) + 0.5 lines.
signalLevels
One of: kIOAnalogSignalLevel_0700_0300 0.700 - 0.300 V p-p. kIOAnalogSignalLevel_0714_0286 0.714 - 0.286 V p-p. kIOAnalogSignalLevel_1000_0400 1.000 - 0.400 V p-p. kIOAnalogSignalLevel_0700_0000 0.700 - 0.000 V p-p.
pixelClock
700
horizontalActive
Zero.
verticalSyncConfig
Zero.
numLinks
number of links to be used by a dual link timing, if zero, assume one link.
701
__reservedB
Reserved set to zero. Discussion This structure is used by IOFramebuffer to define detailed timing information for a display mode. The VESA EDID document has more information.
IODisplayModeInformation
A structure defining the format of a framebuffer.
struct IODisplayModeInformation { UInt32 nominalWidth; UInt32 nominalHeight; IOFixed1616 refreshRate; IOIndex maxDepthIndex; UInt32 flags; UInt16 imageWidth; UInt16 imageHeight; UInt32 reserved[ 3 ]; };
Fields
nominalWidth
Flags for the mode, including: kDisplayModeInterlacedFlag mode is interlaced. kDisplayModeSimulscanFlag mode is available on multiple display connections. kDisplayModeNotPresetFlag mode is not a factory preset for the display (geometry may need correction). kDisplayModeStretchedFlag mode is stretched/distorted to match the display aspect ratio.
702
imageWidth
Set to zero. Discussion This structure is used by IOFramebuffer to define the format of the pixels.
IODisplayScalerInformation
A structure defining the scaling capabilities of a framebuffer.
struct IODisplayScalerInformation UInt32 __reservedA[1]; // Init UInt32 version; // Init to 0 UInt32 __reservedB[2]; // Init IOOptionBits scalerFeatures; UInt32 maxHorizontalPixels; UInt32 maxVerticalPixels; UInt32 __reservedC[5]; // Init };
{ to 0 to 0
to 0
Fields
__reservedA
Set to zero.
version
Set to zero.
__reservedB
Set to zero.
703
scalerFeatures
Mask of scaling features. The following are defined: kIOScaleStretchOnly If set the framebuffer can only provide stretched scaling with non-square pixels, without borders. kIOScaleCanUpSamplePixels If set framebuffer can scale up from a smaller number of source pixels to a larger native timing (eg. 640x480 pixels on a 1600x1200 timing). kIOScaleCanDownSamplePixels If set framebuffer can scale down from a larger number of source pixels to a smaller native timing (eg. 1600x1200 pixels on a 640x480 timing). kIOScaleCanScaleInterlaced If set framebuffer can scale an interlaced detailed timing. kIOScaleCanSupportInset If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields. kIOScaleCanRotate If set framebuffer can support some of the flags in the kIOScaleRotateFlags mask. kIOScaleCanBorderInsetOnly If set framebuffer can support scaled modes with non-zero horizontalScaledInset, verticalScaledInset fields, but requires the active pixels to be equal in size to the inset area, ie. can do insets with a border versus scaling an image.
maxHorizontalPixels
Set to zero. Discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. A data property with this structure under the key kIOFBScalerInfoKey in a framebuffer will allow the OS to program detailed timings that are scaled to a displays native resolution.
IODisplayTimingRange
A structure defining the limits and attributes of a display or framebuffer.
struct IODisplayTimingRange { UInt32 __reservedA[2]; // Init to 0 UInt32 version; // Init to 0 UInt32 __reservedB[5]; // Init to 0 UInt64 minPixelClock; // Min dot clock in Hz UInt64 maxPixelClock; // Max dot clock in Hz
704
UInt32 maxPixelError; // Max dot clock error UInt32 supportedSyncFlags; UInt32 supportedSignalLevels; UInt32 supportedSignalConfigs; UInt32 minFrameRate; // Hz UInt32 maxFrameRate; // Hz UInt32 minLineRate; // Hz UInt32 maxLineRate; // Hz UInt32 maxHorizontalTotal; // Clocks - Maximum total (active + blanking) UInt32 maxVerticalTotal; // Clocks - Maximum total (active + blanking) UInt32 __reservedD[2]; // Init to 0 UInt8 charSizeHorizontalActive; UInt8 charSizeHorizontalBlanking; UInt8 charSizeHorizontalSyncOffset; UInt8 charSizeHorizontalSyncPulse; UInt8 charSizeVerticalActive; UInt8 charSizeVerticalBlanking; UInt8 charSizeVerticalSyncOffset; UInt8 charSizeVerticalSyncPulse; UInt8 charSizeHorizontalBorderLeft; UInt8 charSizeHorizontalBorderRight; UInt8 charSizeVerticalBorderTop; UInt8 charSizeVerticalBorderBottom; UInt8 charSizeHorizontalTotal; // Character size for active + blanking UInt8 charSizeVerticalTotal; // Character size for active + blanking UInt16 __reservedE; // Reserved (Init to 0) UInt32 minHorizontalActiveClocks; UInt32 maxHorizontalActiveClocks; UInt32 minHorizontalBlankingClocks; UInt32 maxHorizontalBlankingClocks; UInt32 minHorizontalSyncOffsetClocks; UInt32 maxHorizontalSyncOffsetClocks; UInt32 minHorizontalPulseWidthClocks; UInt32 maxHorizontalPulseWidthClocks; UInt32 minVerticalActiveClocks; UInt32 maxVerticalActiveClocks; UInt32 minVerticalBlankingClocks; UInt32 maxVerticalBlankingClocks; UInt32 minVerticalSyncOffsetClocks; UInt32 maxVerticalSyncOffsetClocks; UInt32 minVerticalPulseWidthClocks; UInt32 maxVerticalPulseWidthClocks; UInt32 minHorizontalBorderLeft; UInt32 maxHorizontalBorderLeft; UInt32 minHorizontalBorderRight; UInt32 maxHorizontalBorderRight; UInt32 minVerticalBorderTop; UInt32 maxVerticalBorderTop; UInt32 minVerticalBorderBottom;
705
maxVerticalBorderBottom; maxNumLinks; // number of links, minLink0PixelClock; // min pixel maxLink0PixelClock; // max pixel minLink1PixelClock; // min pixel maxLink1PixelClock; // max pixel __reservedF[3]; // Init to 0
if zero, assume link 1 clock for link (kHz) clock for link (kHz) clock for link 1 (kHz) clock for link 1 (kHz)
Fields
__reservedA
Set to zero.
version
Set to zero.
__reservedB
Set to zero.
minPixelClock
minimum pixel clock frequency in range, in Hz. maximum pixel clock frequency in range, in Hz.
maxPixelError
largest variation between specified and actual pixel clock frequency, in Hz.
supportedSyncFlags
mask of supported sync attributes. The following are defined: kIORangeSupportsSeparateSyncs - digital separate syncs. kIORangeSupportsSyncOnGreen - sync on green. kIORangeSupportsCompositeSync - composite sync. kIORangeSupportsVSyncSerration - vertical sync has serration and equalization pulses.
supportedSignalLevels
mask of possible signal levels. The following are defined: kIORangeSupportsSignal_0700_0300 0.700 - 0.300 V p-p. kIORangeSupportsSignal_0714_0286 0.714 - 0.286 V p-p. kIORangeSupportsSignal_1000_0400 1.000 - 0.400 V p-p. kIORangeSupportsSignal_0700_0000 0.700 - 0.000 V p-p.
706
supportedSignalConfigs
mask of possible signal configurations. The following are defined: kIORangeSupportsInterlacedCEATiming Supports CEA style interlaced timing: Field 1 vertical blanking = specified vertical blanking lines. Field 2 vertical blanking = vertical blanking lines + 1 line. Field 1 vertical offset = specified vertical sync offset. Field 2 vertical offset = specified vertical sync offset + 0.5 lines. kIORangeSupportsInterlacedCEATimingWithConfirm Supports CEA style interlaced timing, but require a confirm.
minFrameRate
Set to zero.
charSizeHorizontalActive
707
charSizeVerticalBlanking
Set to zero.
minHorizontalActiveClocks
708
maxHorizontalPulseWidthClocks
709
maxNumLinks
Set to zero. Discussion This structure is used to define the limits for modes programmed as detailed timings by the OS. The VESA EDID is useful background information for many of these fields. A data property with this structure under the key kIOFBTimingRangeKey in a framebuffer will allow the OS to program detailed timings that fall within its range.
IOHardwareCursorDescriptor
A structure defining the format of a hardware cursor.
struct IOHardwareCursorDescriptor { UInt16 majorVersion; UInt16 minorVersion; UInt32 height; UInt32 width; UInt32 bitDepth; // bits per pixel, or a QD/QT pixel type UInt32 maskBitDepth; // unused UInt32 numColors; // number of colors in the colorMap. ie. UInt32 *colorEncodings; UInt32 flags; UInt32 supportedSpecialEncodings; UInt32 specialEncodings[16]; };
Fields
majorVersion
Set to kHardwareCursorDescriptorMajorVersion.
710
minorVersion
Set to kHardwareCursorDescriptorMinorVersion.
height
Number bits per pixel, or a QD/QT pixel type, for example kIO8IndexedPixelFormat, kIO32ARGBPixelFormat.
maskBitDepth
Unused.
numColors
An array pointer specifying the pixel values corresponding to the indices into the color table, for indexed pixel types.
flags
Array of pixel values for each supported special encoding. Discussion This structure is used by IOFramebuffer to define the format of a hardware cursor.
IOHardwareCursorInfo
A structure defining the converted data of a hardware cursor.
struct IOHardwareCursorInfo { UInt16 majorVersion; UInt16 minorVersion; UInt32 cursorHeight; UInt32 cursorWidth; // nil or big enough for hardware's max colors IOColorEntry *colorMap; UInt8 *hardwareCursorData; UInt16 cursorHotSpotX;
711
Fields
majorVersion
Set to kHardwareCursorInfoMajorVersion.
minorVersion
Set to kHardwareCursorInfoMinorVersion.
cursorHeight
Pointer to array of IOColorEntry structures, with the number of elements set by the numColors field of the IOHardwareCursorDescriptor. Zero should be passed for direct pixel formats.
hardwareCursorData
Cursor's hotspot.
cursorHotSpotY
Cursor's hotspot.
reserved
Reserved, set to zero. Discussion This structure is used by IOFramebuffer to return the data of a hardware cursor by convertCursorImage() after conversion based on the IOHardwareCursorDescriptor passed to that routine.
IOPixelInformation
A structure defining the format of a framebuffer.
struct IOPixelInformation { UInt32 bytesPerRow; UInt32 bytesPerPlane; UInt32 bitsPerPixel; UInt32 pixelType;
712
UInt32 componentCount; UInt32 bitsPerComponent; UInt32 componentMasks[ 8 * 2 ]; IOPixelEncoding pixelFormat; UInt32 flags; UInt32 activeWidth; UInt32 activeHeight; UInt32 reserved[ 2 ]; };
Fields
bytesPerRow
Not used.
bitsPerPixel
The number of bits per pixel, including unused bits and alpha.
pixelType
One of kIOCLUTPixels (indexed pixels with changeable CLUT), kIORGBDirectPixels (direct pixels).
componentCount
Mask of the bits valid for each component of the pixel - in R, G, B order for direct pixels.
pixelFormat
Set to zero. Discussion This structure is used by IOFramebuffer to define the format of the pixels.
713
IOHIDBase.h Reference
Declared in
IOHIDBase.h
Overview
Included Headers
<IOKit/hid/IOHIDKeys.h>
Callbacks
See the Overview for header-level documentation.
IOHIDCallback
Parameters
context
714
Discussion Type and arguments of callout C function that is used when a completion routine is called. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
IOHIDDeviceCallback
typedef void ( *IOHIDDeviceCallback) ( void *context, IOReturn result, void *sender, IOHIDDeviceRef device);
Parameters
context
IOHIDDeviceRef containing the sending device. Discussion Type and arguments of callout C function that is used when a device routine is called. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
IOHIDReportCallback
715
Parameters
context
Size of the buffer received upon completion. Discussion Type and arguments of callout C function that is used when a HID report completion routine is called. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
IOHIDValueCallback
716
Parameters
context
IOHIDValueRef containing the returned element value. Discussion Type and arguments of callout C function that is used when an element value completion routine is called. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
IOHIDValueMultipleCallback
typedef void ( *IOHIDValueMultipleCallback) ( void *context, IOReturn result, void *sender, CFDictionaryRef multiple);
Parameters
context
717
Discussion Type and arguments of callout C function that is used when an element value completion routine is called. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
Data Types
See the Overview for header-level documentation.
IOHIDDeviceRef
Discussion This is the type of a reference to the IOHIDDevice. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
IOHIDElementRef
Discussion This is the type of a reference to the IOHIDElement. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
718
IOHIDValueRef
Discussion This is the type of a reference to the IOHIDValue. Availability Available in OS X v10.5 and later. Declared in
IOHIDBase.h
Constants
See the Overview for header-level documentation.
IOHIDTransactionDirectionType
Direction for an IOHIDDeviceTransactionInterface.
Constants
kIOHIDTransactionDirectionTypeInput
Transaction direction used for requesting element values from a device. Available in OS X v10.5 and later. Declared in IOHIDBase.h.
kIOHIDTransactionDirectionTypeOutput
Transaction direction used for dispatching element values to a device. Available in OS X v10.5 and later. Declared in IOHIDBase.h. See Also
IOHIDTransactionDirectionType (page 719)
719
IOHIDTransactionOption
Options to be used in conjuntion with an IOHIDDeviceTransactionInterface.
Constants
kIOHIDTransactionOptionDefaultOutputValue
Option to set the default element value to be used with an IOHIDDeviceTransactionInterface of direction kIOHIDTransactionDirectionTypeOutput. Available in OS X v10.5 and later. Declared in IOHIDBase.h.
IOHIDValueScaleType
Describes different types of scaling that can be performed on element values.
Constants
kIOHIDValueScaleTypeCalibrated
Type for value that is scaled with respect to the calibration properties. Available in OS X v10.5 and later. Declared in IOHIDBase.h.
kIOHIDValueScaleTypePhysical
Type for value that is scaled with respect to the physical min and physical max of the element. Available in OS X v10.5 and later. Declared in IOHIDBase.h. See Also
IOHIDValueScaleType (page 720)
720
Declared in
IOHIDDevice.h
Overview
IOHIDDevice defines a Human Interface Device (HID) object, which interacts with an IOHIDDevicePlugIn object that typically maps to an object in the kernel. IOHIDDevice is used to communicate with a single HID device in order to obtain or set device properties, element values, and reports. IOHIDDevice is also a CFType object and as such conforms to all the conventions expected such object. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts n the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Human Interface Device & Force Feedback . Please review documentation before using this reference. All of the information described in this document is contained in the header file IOHIDDevice.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDDevice.h.
Included Headers
<CoreFoundation/CoreFoundation.h> <IOKit/hid/IOHIDBase.h>
Functions
See the Overview for header-level documentation.
IOHIDDeviceClose
Closes communication with a HID device.
721
Parameters
device
Reference to an IOHIDDevice.
options
Option bits to be sent down to the device. Return Value Returns kIOReturnSuccess if successful. Discussion This closes a link between the client's task and the actual device. Availability Available in OS X v10.5 and later.
Related Sample Code HID Dumper
Declared in
IOHIDDevice.h
IOHIDDeviceConformsTo
Convenience function that scans the Application Collection elements to see if it conforms to the provided usagePage and usage.
CF_EXPORT Boolean IOHIDDeviceConformsTo( IOHIDDeviceRef device, uint32_t usagePage, uint32_t usage) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
usagePage
722
usage
Device usage Return Value Returns TRUE if device conforms to provided usage. Discussion Examples of Application Collection usages pairs are: usagePage = kHIDPage_GenericDesktop usage = kHIDUsage_GD_Mouse
or
Declared in
IOHIDDevice.h
IOHIDDeviceCopyMatchingElements
Obtains HID elements that match the criteria contained in the matching dictionary.
CF_EXPORT CFArrayRef IOHIDDeviceCopyMatchingElements( IOHIDDeviceRef device, CFDictionaryRef matching, IOOptionBits options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
matching
723
options
Reserved for future use. Return Value Returns CFArrayRef containing multiple IOHIDElement object. Discussion Matching keys are prefixed by kIOHIDElement and declared in <IOKit/hid/IOHIDKeys.h>. Passing a NULL dictionary will result in all device elements being returned. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID LED test tool HID Utilities
Declared in
IOHIDDevice.h
IOHIDDeviceCopyValueMultiple
Copies a values for multiple elements.
CF_EXPORT IOReturn IOHIDDeviceCopyValueMultiple( IOHIDDeviceRef device, CFArrayRef elements, CFDictionaryRef *pMultiple) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
elements
Pointer to CFDictionaryRef where the keys are the provided elements and the values are the requested values.
724
Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves synchronously and return back immediately for input type element. If requesting a value for a feature element, this will block until the report has been issued to the device. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceCopyValueMultipleWithCallback
Copies a values for multiple elements and returns status via a completion callback.
CF_EXPORT IOReturn IOHIDDeviceCopyValueMultipleWithCallback( IOHIDDeviceRef device, CFArrayRef elements, CFDictionaryRef *pMultiple, CFTimeInterval timeout, IOHIDValueMultipleCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
elements
Pointer to CFDictionaryRef where the keys are the provided elements and the values are the requested values.
timeout
725
Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves asynchronusly and is only relevent for either output or feature type elements. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceCreate
Creates an element from an io_service_t.
Parameters
allocator
Reference to service object in the kernel. Return Value Returns a new IOHIDDeviceRef. Discussion The io_service_t passed in this method must reference an object in the kernel of type IOHIDDevice. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceGetProperty
Obtains a property from an IOHIDDevice.
726
Parameters
device
Reference to an IOHIDDevice.
key
CFStringRef containing key to be used when querying the device. Return Value Returns CFTypeRef containing the property. Discussion Property keys are prefixed by kIOHIDDevice and declared in <IOKit/hid/IOHIDKeys.h>. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDDevice.h
IOHIDDeviceGetReport
Obtains a report from the device.
CF_EXPORT IOReturn IOHIDDeviceGetReport( IOHIDDeviceRef device, IOHIDReportType reportType, CFIndex reportID, uint8_t *report, CFIndex *pReportLength) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
727
reportType
Pointer to length of preallocated buffer. This value will be modified to refect the length of the returned report. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves synchronously and will block until the report has been received from the device. This is only intended for feature reports because of sporadic devicesupport for polling input reports. Please defer to using IOHIDDeviceRegisterInputReportCallback for obtaining input reports. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceGetReportWithCallback
Obtains a report from the device.
CF_EXPORT IOReturn IOHIDDeviceGetReportWithCallback( IOHIDDeviceRef device, IOHIDReportType reportType, CFIndex reportID, uint8_t *report, CFIndex *pReportLength, CFTimeInterval timeout, IOHIDReportCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
728
reportType
Pointer to length of preallocated buffer. Pointer to length of preallocated buffer. This value will be modified to refect the length of the returned report.
callback
Pointer to data to be passed to the callback. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves asynchronously and will block until the report has been received from the device. This is only intended for feature reports because of sporadic devicesupport for polling input reports. Please defer to using IOHIDDeviceRegisterInputReportCallback for obtaining input reports. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceGetService
Returns the io_service_t for an IOHIDDevice, if it has one.
Parameters
device
Reference to an IOHIDDevice.
729
Return Value Returns the io_service_t if the IOHIDDevice has one, or MACH_PORT_NULL if it does not. Discussion If the IOHIDDevice references an object in the kernel, this is used to get the io_service_t for that object. Availability Available in OS X v10.6 and later. Declared in
IOHIDDevice.h
IOHIDDeviceGetTypeID
Returns the type identifier of all IOHIDDevice instances.
Declared in
IOHIDDevice.h
IOHIDDeviceGetValue
Gets a value for an element.
CF_EXPORT IOReturn IOHIDDeviceGetValue( IOHIDDeviceRef device, IOHIDElementRef element, IOHIDValueRef *pValue) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
730
element
Pointer to IOHIDValueRef to be obtained. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves synchronously and return back immediately for input type element. If requesting a value for a feature element, this will block until the report has been issued to the device. If obtaining values for multiple elements you may want to consider using IOHIDDeviceCopyValueMultiple or IOHIDTransaction. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDDevice.h
IOHIDDeviceGetValueWithCallback
Gets a value for an element and returns status via a completion callback.
CF_EXPORT IOReturn IOHIDDeviceGetValueWithCallback( IOHIDDeviceRef device, IOHIDElementRef element, IOHIDValueRef *pValue, CFTimeInterval timeout, IOHIDValueCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
element
731
pValue
Pointer to data to be passed to the callback. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves asynchronusly and is only relevent for either output or feature type elements. If obtaining values for multiple elements you may want to consider using IOHIDDeviceCopyValueMultipleWithCallback or IOHIDTransaction. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceOpen
Opens a HID device for communication.
Parameters
device
Reference to an IOHIDDevice.
options
Option bits to be sent down to the device. Return Value Returns kIOReturnSuccess if successful.
732
Discussion Before the client can issue commands that change the state of the device, it must have succeeded in opening the device. This establishes a link between the client's task and the actual device. To establish an exclusive link use the kIOHIDOptionsTypeSeizeDevice option. Availability Available in OS X v10.5 and later.
Related Sample Code HID Dumper
Declared in
IOHIDDevice.h
IOHIDDeviceRegisterInputReportCallback
Registers a callback to be used when an input report is issued by the device.
CF_EXPORT void IOHIDDeviceRegisterInputReportCallback( IOHIDDeviceRef device, uint8_t *report, CFIndex reportLength, IOHIDReportCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
report
Pointer to data to be passed to the callback. Discussion An input report is an interrupt driver report issued by the device.
733
IOHIDDeviceRegisterInputValueCallback
Registers a callback to be used when an input value is issued by the device.
CF_EXPORT void IOHIDDeviceRegisterInputValueCallback( IOHIDDeviceRef device, IOHIDValueCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
callback
Pointer to data to be passed to the callback. Discussion An input element refers to any element of type kIOHIDElementTypeInput and is usually issued by interrupt driven reports. If more specific element values are desired, you can specify matching criteria via IOHIDDeviceSetInputValueMatching and IOHIDDeviceSetInputValueMatchingMultiple. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDDevice.h
IOHIDDeviceRegisterRemovalCallback
Registers a callback to be used when a IOHIDDevice is removed.
734
CF_EXPORT void IOHIDDeviceRegisterRemovalCallback( IOHIDDeviceRef device, IOHIDCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
callback
Pointer to data to be passed to the callback. Discussion In most cases this occurs when a device is unplugged. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceScheduleWithRunLoop
Schedules HID device with run loop.
CF_EXPORT void IOHIDDeviceScheduleWithRunLoop( IOHIDDeviceRef device, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
runLoop
735
Discussion Formally associates device with client's run loop. Scheduling this device with the run loop is necessary before making use of any asynchronous APIs. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceSetInputValueMatching
Sets matching criteria for input values received via IOHIDDeviceRegisterInputValueCallback.
Parameters
manager
Reference to an IOHIDDevice.
matching
CFDictionaryRef containg device matching criteria. Discussion Matching keys are prefixed by kIOHIDElement and declared in <IOKit/hid/IOHIDKeys.h>. Passing a NULL dictionary will result in all devices being enumerated. Any subsequent calls will cause the hid manager to release previously matched input elements and restart the matching process using the revised criteria. If interested in multiple, specific device elements, please defer to using IOHIDDeviceSetInputValueMatchingMultiple. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceSetInputValueMatchingMultiple
Sets multiple matching criteria for input values received via IOHIDDeviceRegisterInputValueCallback.
736
Parameters
manager
Reference to an IOHIDDevice.
multiple
CFArrayRef containing multiple CFDictionaryRef objects containg input element matching criteria. Discussion Matching keys are prefixed by kIOHIDElement and declared in <IOKit/hid/IOHIDKeys.h>. This method is useful if interested in multiple, specific elements . Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDDevice.h
IOHIDDeviceSetProperty
Sets a property for an IOHIDDevice.
CF_EXPORT Boolean IOHIDDeviceSetProperty( IOHIDDeviceRef device, CFStringRef key, CFTypeRef property) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
key
737
Return Value Returns TRUE if successful. Discussion Property keys are prefixed by kIOHIDDevice and declared in <IOKit/hid/IOHIDKeys.h>. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDDevice.h
IOHIDDeviceSetReport
Sends a report to the device.
CF_EXPORT IOReturn IOHIDDeviceSetReport( IOHIDDeviceRef device, IOHIDReportType reportType, CFIndex reportID, const uint8_t *report, CFIndex reportLength) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
reportType
ID of the report being sent. If the device supports multiple reports, this should also be set in the first byte of the report.
report
738
Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves synchronously and will block until the report has been issued to the device. It is only relevent for either output or feature type reports. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceSetReportWithCallback
Sends a report to the device.
CF_EXPORT IOReturn IOHIDDeviceSetReportWithCallback( IOHIDDeviceRef device, IOHIDReportType reportType, CFIndex reportID, const uint8_t *report, CFIndex reportLength, CFTimeInterval timeout, IOHIDReportCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
reportType
ID of the report being sent. If the device supports multiple reports, this should also be set in the first byte of the report.
report
739
callback
Pointer to data to be passed to the callback. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves asynchronously and will block until the report has been issued to the device. It is only relevent for either output or feature type reports. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceSetValue
Sets a value for an element.
CF_EXPORT IOReturn IOHIDDeviceSetValue( IOHIDDeviceRef device, IOHIDElementRef element, IOHIDValueRef value) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
element
740
Discussion This method behaves synchronously and will block until the report has been issued to the device. It is only relevent for either output or feature type elements. If setting values for multiple elements you may want to consider using IOHIDDeviceSetValueMultiple or IOHIDTransaction. Availability Available in OS X v10.5 and later.
Related Sample Code HID LED test tool
Declared in
IOHIDDevice.h
IOHIDDeviceSetValueMultiple
Sets multiple values for multiple elements.
Parameters
device
Reference to an IOHIDDevice.
muliple
CFDictionaryRef where key is IOHIDElementRef and value is IOHIDValueRef. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves synchronously and will block until the report has been issued to the device. It is only relevent for either output or feature type elements. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
741
IOHIDDeviceSetValueMultipleWithCallback
Sets multiple values for multiple elements and returns status via a completion callback.
CF_EXPORT IOReturn IOHIDDeviceSetValueMultipleWithCallback( IOHIDDeviceRef device, CFDictionaryRef multiple, CFTimeInterval timeout, IOHIDValueMultipleCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
muliple
Pointer to data to be passed to the callback. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves asynchronously and will invoke the callback once the report has been issued to the device. It is only relevent for either output or feature type elements. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceSetValueWithCallback
Sets a value for an element and returns status via a completion callback.
742
CF_EXPORT IOReturn IOHIDDeviceSetValueWithCallback( IOHIDDeviceRef device, IOHIDElementRef element, IOHIDValueRef value, CFTimeInterval timeout, IOHIDValueCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
element
Pointer to data to be passed to the callback. Return Value Returns kIOReturnSuccess if successful. Discussion This method behaves asynchronously and will invoke the callback once the report has been issued to the device. It is only relevent for either output or feature type elements. If setting values for multiple elements you may want to consider using IOHIDDeviceSetValueWithCallback or IOHIDTransaction. Availability Available in OS X v10.5 and later. Declared in
IOHIDDevice.h
IOHIDDeviceUnscheduleFromRunLoop
Unschedules HID device with run loop.
743
CF_EXPORT void IOHIDDeviceUnscheduleFromRunLoop( IOHIDDeviceRef device, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
device
Reference to an IOHIDDevice.
runLoop
Run loop mode to be used when unscheduling any asynchronous activity. Discussion Formally disassociates device with client's run loop. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDDevice.h
744
IOHIDDevicePlugIn.h Reference
Declared in
IOHIDDevicePlugIn.h
Overview
This documentation describes the details of the programming interface for accessing Human Interface Devices and interfaces from code running in user space. It is intended that user mode HID drivers properly inplement all interfaces described here in order to be visible via the HID Manager. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Human Interface Device & Force Feedback . Please review documentation before using this reference. All of the information described in this document is contained in the header file IOHIDLib.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDDevicePlugIn.h.
Included Headers
745
Constants
See the Overview for header-level documentation.
Defines
#define kIOHIDDeviceDeviceInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x47, 0x4b, 0xdc, 0x8e, 0x9f, 0x4a, 0x11, 0xda, \ 0xb3, 0x66, 0x00, 0x0d, 0x93, 0x6d, 0x06, 0xd2 ) #define kIOHIDDeviceFactoryID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x13, 0xAA, 0x9C, 0x44, 0x6F, 0x1B, 0x11, 0xD4, \ 0x90, 0x7C, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5) #define kIOHIDDeviceQueueInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \
746
0x2e, 0xc7, 0x8b, 0xdb, 0x9f, 0x4e, 0x11, 0xda, \ 0xb6, 0x5c, 0x00, 0x0d, 0x93, 0x6d, 0x06, 0xd2) #define kIOHIDDeviceTransactionInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x1f, 0x2e, 0x78, 0xfa, 0x9f, 0xfa, 0x11, 0xda, \ 0x90, 0xb4, 0x00, 0x0d, 0x93, 0x6d, 0x06, 0xd2) #define kIOHIDDeviceTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x7d, 0xde, 0xec, 0xa8, 0xa7, 0xb4, 0x11, 0xda, \ 0x8a, 0x0e,
747
Constants
kIOHIDDeviceDeviceInterfaceID
This UUID constant is used to obtain a device interface corresponding to an IOHIDDevice service in the kernel. The type of this device interface is IOHIDDeviceDeviceInterface. This device interface is obtained after the IOCFPlugInInterface for the service itself has been obtained. Note: Please note that subsequent calls to QueryInterface with the UUID kIOHIDDeviceTransactionInterfaceID, will return a retained instance of an existing IOHIDDeviceTransactionInterface. Example:
This UUID constant is used internally by the system, and should not have to be used by any driver code to access the device interfaces. Available in OS X v10.0 and later. Declared in IOHIDDevicePlugIn.h.
748
kIOHIDDeviceQueueInterfaceID
This UUID constant is used to obtain a queue interface corresponding to an IOHIDDevice service in the kernel. The type of this queue interface is IOHIDDeviceQueueInterface. This device interface is obtained after the device interface for the service itself has been obtained. Note: Please note that subsequent calls to QueryInterface with the UUID kIOHIDDeviceQueueInterfaceID, will return a retained instance of a new IOHIDDeviceQueueInterface. Example:
This UUID constant is used to obtain a transaction interface corresponding to an IOHIDDevice service in the kernel. The type of this queue interface is IOHIDDeviceTransactionInterface. This device interface is obtained after the device interface for the service itself has been obtained. Note: Please note that subsequent calls to QueryInterface with the UUID kIOHIDDeviceTransactionInterfaceID, will return a retained instance of a new IOHIDDeviceTransactionInterface. Example:
749
kIOHIDDeviceTypeID
This UUID constant is used to obtain a device interface corresponding to an io_service_t corresponding to an IOHIDDevice in the kernel. Once you have obtained the IOCFPlugInInterface for the service, you must use the QueryInterface function to obtain the device interface for the user client itself. Example:
750
IOHIDElement.h Reference
Declared in
IOHIDElement.h
Overview
IOHIDElement defines a parsed item contained within a Human Interface Device (HID) object. It is used to obtain properties of the parsed. It can also be used to set properties such as calibration settings. IOHIDElement is a CFType object and as such conforms to all the conventions expected such object. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Human Interface Device & Force Feedback . Please review documentation before using this reference. All of the information described in this document is contained in the header file IOHIDElement.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDElement.h.
Included Headers
Functions
See the Overview for header-level documentation.
IOHIDElementAttach
Establish a relationship between one or more elements.
751
Parameters
element
The element to be modified. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
toAttach
The element to be attached. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Discussion This is useful for grouping HID elements with related functionality. Availability Available in OS X v10.5 and later. Declared in
IOHIDElement.h
IOHIDElementCollectionType
Retrieves the collection type for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the IOHIDElementCollectionType for the element. Discussion The value returned by this method only makes sense if the element type is kIOHIDElementTypeCollection.
IOHIDElementCopyAttached
Obtain attached elements.
752
Parameters
element
The element to be modified. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns a copy of the current attached elements. Discussion Attached elements are those that have been grouped via IOHIDElementAttach. Availability Available in OS X v10.5 and later. Declared in
IOHIDElement.h
IOHIDElementCreateWithDictionary
Creates an element from a dictionary.
Parameters
allocator
dictionary containing values in which to create element. Return Value Returns a new IOHIDElementRef. Discussion The dictionary should contain keys defined in IOHIDKeys.h and start with kIOHIDElement. This call is meant be used by a IOHIDDeviceDeviceInterface object. Availability Available in OS X v10.5 and later.
753
Declared in
IOHIDElement.h
IOHIDElementDetach
Remove a relationship between one or more elements.
Parameters
element
The element to be modified. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
toDetach
The element to be detached. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Discussion This is useful for grouping HID elements with related functionality. Availability Available in OS X v10.5 and later. Declared in
IOHIDElement.h
IOHIDElementGetChildren
Returns the children for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns an CFArrayRef containing element objects of type IOHIDElementRef.
754
Discussion An element of type kIOHIDElementTypeCollection usually contains children. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetCollectionType
Retrieves the collection type for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the IOHIDElementCollectionType for the element. Discussion The value returned by this method only makes sense if the element type is kIOHIDElementTypeCollection. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
755
IOHIDElementGetCookie
Retrieves the cookie for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the IOHIDElementCookie for the element. Discussion The IOHIDElementCookie represent a unique identifier for an element within a device. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetDevice
Obtain the device associated with the element.
Parameters
element
756
Declared in
IOHIDElement.h
IOHIDElementGetLogicalMax
Returns the maximum value possible for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the logical maximum. Discussion This corresponds to the logical maximum, which indicates the upper bounds of a variable element. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID LED test tool HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetLogicalMin
Returns the minimum value possible for the element.
757
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the logical minimum. Discussion This corresponds to the logical minimun, which indicates the lower bounds of a variable element. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID LED test tool HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetMax
Returns the maximum value possible for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the logical maximum. Discussion This corresponds to the logical maximum, which indicates the upper bounds of a variable element.
758
IOHIDElementGetName
Returns the name for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns CFStringRef containing the element name. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetParent
Returns the parent for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns an IOHIDElementRef referencing the parent element. Discussion The parent element can be an element of type kIOHIDElementTypeCollection.
759
Declared in
IOHIDElement.h
IOHIDElementGetPhysicalMax
Returns the scaled maximum value possible for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the physical maximum. Discussion Maximum value for the physical extent of a variable element. This represents the value for the logical maximum with units applied to it. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
760
IOHIDElementGetPhysicalMin
Returns the scaled minimum value possible for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the physical minimum. Discussion Minimum value for the physical extent of a variable element. This represents the value for the logical minimum with units applied to it. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetProperty
Returns the an element property.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
key
761
Return Value Returns the property. Discussion Property keys are prefixed by kIOHIDElement and declared in IOHIDKeys.h. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetReportCount
Returns the report count for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the report count. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
762
IOHIDElementGetReportID
Returns the report ID for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the report ID. Discussion The report ID represents what report this particular element belongs to. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetReportSize
Returns the report size in bits for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the report size.
763
Declared in
IOHIDElement.h
IOHIDElementGetType
Retrieves the type for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the IOHIDElementType for the element. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID LED test tool HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetTypeID
Returns the type identifier of all IOHIDElement instances.
764
Declared in
IOHIDElement.h
IOHIDElementGetUnit
Returns the unit property for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the unit. Discussion The unit property is described in more detail in Section 6.2.2.7 of the "Device Class Definition for Human Interface Devices(HID)" Specification, Version 1.11. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
765
IOHIDElementGetUnitExponent
Returns the unit exponenet in base 10 for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the unit exponent. Discussion The unit exponent property is described in more detail in Section 6.2.2.7 of the "Device Class Definition for Human Interface Devices(HID)" Specification, Version 1.11. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementGetUsage
Retrieves the usage for an element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the usage for the element.
766
Declared in
IOHIDElement.h
IOHIDElementGetUsagePage
Retrieves the usage page for an element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the usage page for the element. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID LED test tool HID Utilities
Declared in
IOHIDElement.h
IOHIDElementHasNullState
Returns the null state property for the element.
767
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns TRUE if null state or FALSE if no null state. Discussion Indicates whether the element has a state in which it is not sending meaningful data. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementHasPreferredState
Returns the preferred state property for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns TRUE if preferred state or FALSE if no preferred state. Discussion Indicates whether the element has a preferred state to which it will return when the user is not physically interacting with the control.
768
Declared in
IOHIDElement.h
IOHIDElementIsArray
Returns the array property for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns TRUE if array or FALSE if variable. Discussion Indicates whether the element represents variable or array data values. Variable values represent data from a physical control. An array returns an index in each field that corresponds to the pressed button (like keyboard scan codes).
Note:
The HID Manager will represent most elements as "variable" including the possible usages of an array.
Array indices will remain as "array" elements with a usage of 0xffffffff. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
769
IOHIDElementIsNonLinear
Returns the linear property for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns TRUE if non linear or FALSE if linear. Discussion Indicates whether the value for the element has been processed in some way, and no longer represents a linear relationship between what is measured and the value that is reported. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementIsRelative
Returns the relative property for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns TRUE if relative or FALSE if absolute.
770
Discussion Indicates whether the data is relative (indicating the change in value from the last report) or absolute (based on a fixed origin). Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementIsVirtual
Returns the virtual property for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns the TRUE if virtual or FALSE if not. Discussion Indicates whether the element is a virtual element. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
771
IOHIDElementIsWrapping
Returns the wrap property for the element.
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined. Return Value Returns TRUE if wrapping or FALSE if non-wrapping. Discussion Wrap indicates whether the data "rolls over" when reaching either the extreme high or low value. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
IOHIDElementSetProperty
Sets an element property.
CF_EXPORT Boolean IOHIDElementSetProperty( IOHIDElementRef element, CFStringRef key, CFTypeRef property) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
element
The element to be queried. If this parameter is not a valid IOHIDElementRef, the behavior is undefined.
key
772
Return Value Returns TRUE if successful. Discussion This method can be used to set arbitrary element properties, such as application specific references. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDElement.h
773
Declared in
IOHIDKeys.h
Overview
Included Headers
<sys/cdefs.h> <IOKit/hidsystem/IOHIDParameter.h>
Data Types
See the Overview for header-level documentation.
IOHIDElementCookie
Abstract data type used as a unique identifier for an element.
#ifdef __LP64__ typedef uint32_t IOHIDElementCookie; #else typedef void * IOHIDElementCookie; #endif
774
Constants
See the Overview for header-level documentation.
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOHIDCountryCodeKey "CountryCode" kIOHIDDeviceKeyboardLanguageKey "DeviceKeyboardLanguage" kIOHIDDeviceKeyboardStandardTypeKey "DeviceKeyboardStandardType" kIOHIDDeviceUsageKey "DeviceUsage" kIOHIDDeviceUsagePageKey "DeviceUsagePage" kIOHIDDeviceUsagePairsKey "DeviceUsagePairs" kIOHIDLocationIDKey "LocationID" kIOHIDManufacturerKey "Manufacturer" kIOHIDMaxFeatureReportSizeKey "MaxFeatureReportSize" kIOHIDMaxInputReportSizeKey "MaxInputReportSize" kIOHIDMaxOutputReportSizeKey "MaxOutputReportSize" kIOHIDPrimaryUsageKey "PrimaryUsage" kIOHIDPrimaryUsagePageKey "PrimaryUsagePage" kIOHIDProductIDKey "ProductID" kIOHIDProductKey "Product" kIOHIDReportDescriptorKey "ReportDescriptor" kIOHIDReportIntervalKey "ReportInterval" kIOHIDResetKey "Reset" kIOHIDSerialNumberKey "SerialNumber" kIOHIDStandardTypeKey "StandardType" kIOHIDTransportKey "Transport" kIOHIDVendorIDKey "VendorID" kIOHIDVendorIDSourceKey "VendorIDSource" kIOHIDVersionNumberKey "VersionNumber"
775
Constants
kIOHIDCountryCodeKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
776
kIOHIDDeviceKeyboardLanguageKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.8 and later. Declared in IOHIDKeys.h.
777
kIOHIDDeviceKeyboardStandardTypeKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.8 and later. Declared in IOHIDKeys.h.
778
kIOHIDDeviceUsageKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
779
kIOHIDDeviceUsagePageKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
780
kIOHIDDeviceUsagePairsKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
781
kIOHIDLocationIDKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
782
kIOHIDManufacturerKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
783
kIOHIDMaxFeatureReportSizeKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.2 and later. Declared in IOHIDKeys.h.
784
kIOHIDMaxInputReportSizeKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.2 and later. Declared in IOHIDKeys.h.
785
kIOHIDMaxOutputReportSizeKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.2 and later. Declared in IOHIDKeys.h.
786
kIOHIDPrimaryUsageKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
787
kIOHIDPrimaryUsagePageKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
788
kIOHIDProductIDKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
789
kIOHIDProductKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
790
kIOHIDReportDescriptorKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.6 and later. Declared in IOHIDKeys.h.
791
kIOHIDReportIntervalKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
792
kIOHIDResetKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.7 and later. Declared in IOHIDKeys.h.
793
kIOHIDSerialNumberKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
794
kIOHIDStandardTypeKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.7 and later. Declared in IOHIDKeys.h.
795
kIOHIDTransportKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
796
kIOHIDVendorIDKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
797
kIOHIDVendorIDSourceKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.2 and later. Declared in IOHIDKeys.h.
798
kIOHIDVersionNumberKey
Keys that represent properties of a paticular device. Keys that represent properties of a paticular device. Can be added to your matching dictionary when refining searches for HID devices. Please note: kIOHIDPrimaryUsageKey and kIOHIDPrimaryUsagePageKey are no longer rich enough to describe a device's capabilities. Take, for example, a device that describes both a keyboard and a mouse in the same descriptor. The previous behavior was to only describe the keyboard behavior with the primary usage and usage page. Needless to say, this would sometimes cause a program interested in mice to skip this device when matching. Thus we have added 3 additional keys:
kIOHIDDeviceUsagePairsKey is used to represent an array of dictionaries containing key/value pairs referenced by kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey. These usage pairs describe all application type collections (behaviors) defined by the device. An application intersted in only matching on one criteria would only add the kIOHIDDeviceUsageKey and kIOHIDDeviceUsagePageKey keys to the matching dictionary. If it is interested in a device that has multiple behaviors, the application would instead add an array or dictionaries referenced by kIOHIDDeviceUsagePairsKey to his matching dictionary. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
#define #define #define #define #define #define #define #define #define #define #define #define
kIOHIDElementCollectionTypeKey "CollectionType" kIOHIDElementCookieKey "ElementCookie" kIOHIDElementDuplicateIndexKey "DuplicateIndex" kIOHIDElementFlagsKey "Flags" kIOHIDElementHasNullStateKey "HasNullState" kIOHIDElementHasPreferredStateKey "HasPreferredState" kIOHIDElementIsArrayKey "IsArray" kIOHIDElementIsNonLinearKey "IsNonLinear" kIOHIDElementIsRelativeKey "IsRelative" kIOHIDElementIsWrappingKey "IsWrapping" kIOHIDElementMaxKey "Max" kIOHIDElementMinKey "Min"
799
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOHIDElementNameKey "Name" kIOHIDElementParentCollectionKey "ParentCollection" kIOHIDElementReportCountKey "ReportCount" kIOHIDElementReportIDKey "ReportID" kIOHIDElementReportSizeKey "ReportSize" kIOHIDElementScaledMaxKey "ScaledMax" kIOHIDElementScaledMinKey "ScaledMin" kIOHIDElementSizeKey "Size" kIOHIDElementTypeKey "Type" kIOHIDElementUnitExponentKey "UnitExponent" kIOHIDElementUnitKey "Unit" kIOHIDElementUsageKey "Usage" kIOHIDElementUsagePageKey "UsagePage" kIOHIDElementValueLocationKey "ValueLocation" kIOHIDElementVendorSpecificKey "VendorSpecific"
Constants
kIOHIDElementCollectionTypeKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementCookieKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementDuplicateIndexKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
kIOHIDElementFlagsKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
800
kIOHIDElementHasNullStateKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementHasPreferredStateKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.1 and later. Declared in IOHIDKeys.h.
kIOHIDElementIsArrayKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.2 and later. Declared in IOHIDKeys.h.
kIOHIDElementIsNonLinearKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementIsRelativeKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementIsWrappingKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
801
kIOHIDElementMaxKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementMinKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementNameKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementParentCollectionKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
kIOHIDElementReportCountKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.2 and later. Declared in IOHIDKeys.h.
kIOHIDElementReportIDKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.4 and later. Declared in IOHIDKeys.h.
802
kIOHIDElementReportSizeKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.2 and later. Declared in IOHIDKeys.h.
kIOHIDElementScaledMaxKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementScaledMinKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementSizeKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementTypeKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementUnitExponentKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
803
kIOHIDElementUnitKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementUsageKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementUsagePageKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementValueLocationKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementVendorSpecificKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
804
Constants
kIOHIDElementCookieMaxKey
Keys used for matching particular elements. These keys should only be used with a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementCookieMinKey
Keys used for matching particular elements. These keys should only be used with a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementUsageMaxKey
Keys used for matching particular elements. These keys should only be used with a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementUsageMinKey
Keys used for matching particular elements. These keys should only be used with a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
Miscellaneous Defines
kIOHIDElementCalibrationDeadZoneMaxKey "CalibrationDeadZoneMax" kIOHIDElementCalibrationDeadZoneMinKey "CalibrationDeadZoneMin" kIOHIDElementCalibrationGranularityKey "CalibrationGranularity" kIOHIDElementCalibrationMaxKey "CalibrationMax" kIOHIDElementCalibrationMinKey "CalibrationMin" kIOHIDElementCalibrationSaturationMaxKey "CalibrationSaturationMax" kIOHIDElementCalibrationSaturationMinKey "CalibrationSaturationMin"
805
Constants
kIOHIDElementCalibrationDeadZoneMaxKey
The maximum bounds near the midpoint of a logical value in which the value is ignored. The dead zone property is used to allow for slight differences in the idle value returned by an element. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementCalibrationDeadZoneMinKey
The minimum bounds near the midpoint of a logical value in which the value is ignored. The dead zone property is used to allow for slight differences in the idle value returned by an element. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementCalibrationGranularityKey
The scale or level of detail returned in a calibrated element value. Values are rounded off such that if granularity=0.1, values after calibration are 0, 0.1, 0.2, 0.3, etc. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementCalibrationMaxKey
The maximum bounds for a calibrated value. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementCalibrationMinKey
The minimum bounds for a calibrated value. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementCalibrationSaturationMaxKey
The maximum tolerance to be used when calibrating a logical element value. The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
806
kIOHIDElementCalibrationSaturationMinKey
The mininum tolerance to be used when calibrating a logical element value. The saturation property is used to allow for slight differences in the minimum and maximum value returned by an element. Available in OS X v10.5 and later. Declared in IOHIDKeys.h.
kIOHIDElementKey
Keys that represents an element property. Property for a HID Device or element dictionary. Elements can be heirarchical, so they can contain other elements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementVendorSpecificKey
Keys that represent properties of a particular elements. These keys can also be added to a matching dictionary when searching for elements via copyMatchingElements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
IOHIDElementCollectionType
Describes different types of HID collections.
enum IOHIDElementCollectionType{ kIOHIDElementCollectionTypePhysical = 0x00, kIOHIDElementCollectionTypeApplication, kIOHIDElementCollectionTypeLogical, kIOHIDElementCollectionTypeReport, kIOHIDElementCollectionTypeNamedArray, kIOHIDElementCollectionTypeUsageSwitch, kIOHIDElementCollectionTypeUsageModifier }; typedef enum IOHIDElementCollectionType IOHIDElementCollectionType;
Constants
kIOHIDElementCollectionTypePhysical
Used for a set of data items that represent data points collected at one geometric point. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
807
kIOHIDElementCollectionTypeApplication
Identifies item groups serving different purposes in a single device. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
kIOHIDElementCollectionTypeLogical
Used when a set of data items form a composite data structure. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
kIOHIDElementCollectionTypeReport
Wraps all the fields in a report. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
kIOHIDElementCollectionTypeNamedArray
Contains an array of selector usages. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
kIOHIDElementCollectionTypeUsageSwitch
Modifies the meaning of the usage it contains. Available in OS X v10.3 and later. Declared in IOHIDKeys.h.
kIOHIDElementCollectionTypeUsageModifier
Modifies the meaning of the usage attached to the encompassing collection. Available in OS X v10.3 and later. Declared in IOHIDKeys.h. Discussion Collections identify a relationship between two or more elements. See Also
IOHIDElementCollectionType (page 807)
IOHIDElementType
Describes different types of HID elements.
808
kIOHIDElementTypeInput_Button = 2, kIOHIDElementTypeInput_Axis = 3, kIOHIDElementTypeInput_ScanCodes = 4, kIOHIDElementTypeOutput = 129, kIOHIDElementTypeFeature = 257, kIOHIDElementTypeCollection = 513 }; typedef enum IOHIDElementType IOHIDElementType;
Constants
kIOHIDElementTypeInput_Misc
Misc input data field or varying size. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementTypeInput_Button
One bit input data field. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementTypeInput_Axis
Input data field used to represent an axis. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementTypeInput_ScanCodes
Input data field used to represent a scan code or usage selector. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementTypeOutput
Used to represent an output data field in a report. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementTypeFeature
Describes input and output elements not intended for consumption by the end user. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
kIOHIDElementTypeCollection
Element used to identify a relationship between two or more elements. Available in OS X v10.0 and later. Declared in IOHIDKeys.h.
809
Discussion Used by the IOHIDFamily to identify the type of element processed. Represented by the key kIOHIDElementTypeKey in the dictionary describing the element. See Also
IOHIDElementType (page 808)
IOHIDOptionsType
Options for opening a device via IOHIDLib.
Constants
kIOHIDOptionsTypeNone
Used to open exclusive communication with the device. This will prevent the system and other clients from receiving events from the device. Available in OS X v10.3 and later. Declared in IOHIDKeys.h. See Also
IOHIDOptionsType (page 810)
IOHIDQueueOptionsType
Options for creating a queue via IOHIDLib.
810
Constants
kIOHIDQueueOptionsTypeNone
Force the IOHIDQueue to enqueue all events, relative or absolute, regardless of change. Available in OS X v10.5 and later. Declared in IOHIDKeys.h. See Also
IOHIDQueueOptionsType (page 810)
IOHIDReportType
Describes different type of HID reports.
enum IOHIDReportType{ kIOHIDReportTypeInput = 0, kIOHIDReportTypeOutput, kIOHIDReportTypeFeature, kIOHIDReportTypeCount }; typedef enum IOHIDReportType IOHIDReportType;
Constants
kIOHIDReportTypeInput
811
kIOHIDReportTypeFeature
Feature report. Available in OS X v10.0 and later. Declared in IOHIDKeys.h. Discussion Used by the IOHIDFamily to identify the type of report being processed. See Also
IOHIDReportType (page 811)
IOHIDStandardType
Type to define what industrial standard the device is referencing.
Constants
kIOHIDStandardTypeANSI
812
IOHIDLibObsolete.h Reference
Declared in
IOHIDLibObsolete.h
Overview
Included Headers
Callbacks
See the Overview for header-level documentation.
IOHIDCallbackFunction
typedef void ( *IOHIDCallbackFunction)( void *target, IOReturn result, void *refcon, void *sender);
Parameters
target
813
result
Interface instance sending the completion routine. Discussion Type and arguments of callout C function that is used when a completion routine is called, see IOHIDLib.h:setRemovalCallback(). Availability Available in OS X v10.0 and later. Declared in
IOHIDLibObsolete.h
IOHIDElementCallbackFunction
typedef void ( *IOHIDElementCallbackFunction) ( void *target, IOReturn result, void *refcon, void *sender, IOHIDElementCookie elementCookie);
Parameters
target
814
Discussion Type and arguments of callout C function that is used when a completion routine is called, see IOHIDLib.h:setElementValue(). Availability Available in OS X v10.0 and later. Declared in
IOHIDLibObsolete.h
IOHIDReportCallbackFunction
typedef void ( *IOHIDReportCallbackFunction) ( void *target, IOReturn result, void *refcon, void *sender, uint32_t bufferSize);
Parameters
target
Size of the buffer received upon completion. Discussion Type and arguments of callout C function that is used when a completion routine is called, see IOHIDLib.h:setReport(). Availability Available in OS X v10.2 and later. Declared in
IOHIDLibObsolete.h
815
Constants
See the Overview for header-level documentation.
Defines
#define kIOHIDDeviceInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x78, 0xBD, 0x42, 0x0C, 0x6F, 0x14, 0x11, 0xD4, \ 0x94, 0x74, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5) #define kIOHIDDeviceInterfaceID121 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x7d, 0xb, 0x51, 0xe, 0x16, 0xd5, 0x11, 0xd7, \ 0x9e, 0x9b, 0x0, 0x3, 0x93, 0x99, 0x2e, 0x38) #define kIOHIDDeviceInterfaceID122 CFUUIDGetConstantUUIDWithBytes(NULL, \
816
0xb7, 0xa, 0xbf, 0x31, 0x16, 0xd5, 0x11, 0xd7, \ 0xab, 0x35, 0x0, 0x3, 0x93, 0x99, 0x2e, 0x38) #define kIOHIDOutputTransactionInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x80, 0xCD, 0xCC, 0x00, 0x75, 0x5D, 0x11, 0xD4, \ 0x80, 0xEF, 0x00, 0x05, 0x02, 0x8F, 0x18, 0xD5) #define kIOHIDQueueInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x81, 0x38, 0x62, 0x9E, 0x6F, 0x14, 0x11, 0xD4, \ 0x97, 0x0E,
817
Constants
kIOHIDDeviceInterfaceID
Interface ID for the IOHIDDeviceInterface. Corresponds to an available HID device. Available in OS X v10.0 and later. Declared in IOHIDLibObsolete.h.
kIOHIDDeviceInterfaceID121
Interface ID for the IOHIDDeviceInterface121. Corresponds to an available HID device that includes methods from IOHIDDeviceInterface. This interface is available on IOHIDLib 1.2.1 and OS X v10.2.3 or later. Available in OS X v10.3 and later. Declared in IOHIDLibObsolete.h.
kIOHIDDeviceInterfaceID122
Interface ID for the IOHIDDeviceInterface122. Corresponds to an available HID device that includes methods from IOHIDDeviceInterface and IOHIDDeviceInterface121. This interface is available on IOHIDLib 1.2.2 and OS X v10.3 or later. Available in OS X v10.3 and later. Declared in IOHIDLibObsolete.h.
kIOHIDOutputTransactionInterfaceID
Interface ID for the kIOHIDOutputTransactionInterfaceID. Corresponds to an output transaction for one or more report IDs on a specific device. Available in OS X v10.0 and later. Declared in IOHIDLibObsolete.h.
kIOHIDQueueInterfaceID
Interface ID for the kIOHIDQueueInterfaceID. Corresponds to a queue for a specific HID device. Available in OS X v10.0 and later. Declared in IOHIDLibObsolete.h.
818
IOHIDManager.h Reference
Declared in
IOHIDManager.h
Overview
IOHIDManager defines an Human Interface Device (HID) managment object. It provides global interaction with managed HID devices such as discovery/removal and receiving input events. IOHIDManager is also a CFType object and as such conforms to all the conventions expected such object. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts n the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Human Interface Device & Force Feedback . Please review documentation before using this reference. All of the information described in this document is contained in the header file IOHIDManager.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDManager.h.
Included Headers
Functions
See the Overview for header-level documentation.
819
IOHIDManagerClose
Closes the IOHIDManager.
Parameters
manager
Reference to an IOHIDManager.
options
Option bits to be sent down to the manager and device. Return Value Returns kIOReturnSuccess if successful. Discussion This will also close all devices that are currently enumerated. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDManager.h
IOHIDManagerCopyDevices
Obtains currently enumerated devices.
Parameters
manager
820
Declared in
IOHIDManager.h
IOHIDManagerCreate
Creates an IOHIDManager object.
Parameters
allocator
Supply kIOHIDManagerOptionUsePersistentProperties to load properties from the default persistent property store. Otherwise supply kIOHIDManagerOptionNone (or 0). Return Value Returns a new IOHIDManagerRef. Discussion The IOHIDManager object is meant as a global management system for communicating with HID devices. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID LED test tool HID Utilities
821
Declared in
IOHIDManager.h
IOHIDManagerGetProperty
Obtains a property of an IOHIDManager.
Parameters
manager
Reference to an IOHIDManager.
key
CFStringRef containing key to be used when querying the manager. Return Value Returns CFTypeRef containing the property. Discussion Property keys are prefixed by kIOHIDDevice and declared in <IOKit/hid/IOHIDKeys.h>. Availability Available in OS X v10.5 and later. Declared in
IOHIDManager.h
IOHIDManagerGetTypeID
Returns the type identifier of all IOHIDManager instances.
822
IOHIDManagerOpen
Opens the IOHIDManager.
Parameters
manager
Reference to an IOHIDManager.
options
Option bits to be sent down to the manager and device. Return Value Returns kIOReturnSuccess if successful. Discussion This will open both current and future devices that are enumerated. To establish an exclusive link use the kIOHIDOptionsTypeSeizeDevice option. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID LED test tool HID Utilities
Declared in
IOHIDManager.h
IOHIDManagerRegisterDeviceMatchingCallback
Registers a callback to be used a device is enumerated.
CF_EXPORT void IOHIDManagerRegisterDeviceMatchingCallback( IOHIDManagerRef manager, IOHIDDeviceCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
823
Parameters
manager
Reference to an IOHIDManagerRef.
callback
Pointer to data to be passed to the callback. Discussion Only device matching the set criteria will be enumerated. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDManager.h
IOHIDManagerRegisterDeviceRemovalCallback
Registers a callback to be used when any enumerated device is removed.
CF_EXPORT void IOHIDManagerRegisterDeviceRemovalCallback( IOHIDManagerRef manager, IOHIDDeviceCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
manager
Reference to an IOHIDManagerRef.
callback
Pointer to data to be passed to the callback. Discussion In most cases this occurs when a device is unplugged.
824
Declared in
IOHIDManager.h
IOHIDManagerRegisterInputReportCallback
Registers a callback to be used when an input report is issued by any enumerated device.
CF_EXPORT void IOHIDManagerRegisterInputReportCallback( IOHIDManagerRef manager, IOHIDReportCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
manager
Reference to an IOHIDManagerRef.
callback
Pointer to data to be passed to the callback. Discussion An input report is an interrupt driver report issued by a device. Availability Available in OS X v10.5 and later. Declared in
IOHIDManager.h
IOHIDManagerRegisterInputValueCallback
Registers a callback to be used when an input value is issued by any enumerated device.
825
Parameters
manager
Reference to an IOHIDManagerRef.
callback
Pointer to data to be passed to the callback. Discussion An input element refers to any element of type kIOHIDElementTypeInput and is usually issued by interrupt driven reports. Availability Available in OS X v10.5 and later. Declared in
IOHIDManager.h
IOHIDManagerSaveToPropertyDomain
Used to write out the current properties to a specific domain.
CF_EXPORT void IOHIDManagerSaveToPropertyDomain( IOHIDManagerRef manager, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName, IOOptionBits options) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;
Parameters
manager
Reference to an IOHIDManager.
applicationID
826
hostName
Reserved for future use. Discussion Using this function will cause the persistent properties to be saved out replacing any properties that already existed in the specified domain. All arguments must be non-NULL except options. Availability Available in OS X v10.7 and later. Declared in
IOHIDManager.h
IOHIDManagerScheduleWithRunLoop
Schedules HID manager with run loop.
CF_EXPORT void IOHIDManagerScheduleWithRunLoop( IOHIDManagerRef manager, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
manager
Reference to an IOHIDManager.
runLoop
Run loop mode to be used when scheduling any asynchronous activity. Discussion Formally associates manager with client's run loop. Scheduling this device with the run loop is necessary before making use of any asynchronous APIs. This will propagate to current and future devices that are enumerated. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
827
Declared in
IOHIDManager.h
IOHIDManagerSetDeviceMatching
Sets matching criteria for device enumeration.
Parameters
manager
Reference to an IOHIDManager.
matching
CFDictionaryRef containg device matching criteria. Discussion Matching keys are prefixed by kIOHIDDevice and declared in <IOKit/hid/IOHIDKeys.h>. Passing a NULL dictionary will result in all devices being enumerated. Any subsequent calls will cause the hid manager to release previously enumerated devices and restart the enuerate process using the revised criteria. If interested in multiple, specific device classes, please defer to using IOHIDManagerSetDeviceMatchingMultiple. Availability Available in OS X v10.5 and later.
Related Sample Code HID Dumper HID LED test tool
Declared in
IOHIDManager.h
IOHIDManagerSetDeviceMatchingMultiple
Sets multiple matching criteria for device enumeration.
828
Parameters
manager
Reference to an IOHIDManager.
multiple
CFArrayRef containing multiple CFDictionaryRef objects containg device matching criteria. Discussion Matching keys are prefixed by kIOHIDDevice and declared in <IOKit/hid/IOHIDKeys.h>. This method is useful if interested in multiple, specific device classes. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDManager.h
IOHIDManagerSetInputValueMatching
Sets matching criteria for input values received via IOHIDManagerRegisterInputValueCallback.
Parameters
manager
Reference to an IOHIDManager.
matching
CFDictionaryRef containg device matching criteria. Discussion Matching keys are prefixed by kIOHIDElement and declared in <IOKit/hid/IOHIDKeys.h>. Passing a NULL dictionary will result in all devices being enumerated. Any subsequent calls will cause the hid manager to release previously matched input elements and restart the matching process using the revised criteria. If interested in multiple, specific device elements, please defer to using IOHIDManagerSetInputValueMatchingMultiple.
829
IOHIDManagerSetInputValueMatchingMultiple
Sets multiple matching criteria for input values received via IOHIDManagerRegisterInputValueCallback.
Parameters
manager
Reference to an IOHIDManager.
multiple
CFArrayRef containing multiple CFDictionaryRef objects containing input element matching criteria. Discussion Matching keys are prefixed by kIOHIDElement and declared in <IOKit/hid/IOHIDKeys.h>. This method is useful if interested in multiple, specific elements . Availability Available in OS X v10.5 and later. Declared in
IOHIDManager.h
IOHIDManagerSetProperty
Sets a property for an IOHIDManager.
CF_EXPORT Boolean IOHIDManagerSetProperty( IOHIDManagerRef manager, CFStringRef key, CFTypeRef value) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
830
Parameters
manager
Reference to an IOHIDManager.
key
CFTypeRef containing the property value to be set. Return Value Returns TRUE if successful. Discussion Property keys are prefixed by kIOHIDDevice and kIOHIDManager and declared in <IOKit/hid/IOHIDKeys.h>. This method will propagate any relevent properties to current and future devices that are enumerated. Availability Available in OS X v10.5 and later. Declared in
IOHIDManager.h
IOHIDManagerUnscheduleFromRunLoop
Unschedules HID manager with run loop.
CF_EXPORT void IOHIDManagerUnscheduleFromRunLoop( IOHIDManagerRef manager, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
manager
Reference to an IOHIDManager.
runLoop
Run loop mode to be used when unscheduling any asynchronous activity. Discussion Formally disassociates device with client's run loop. This will propagate to current devices that are enumerated.
831
Declared in
IOHIDManager.h
Data Types
See the Overview for header-level documentation.
IOHIDManagerOptions
Various options that can be supplied to IOHIDManager functions.
typedef enum { kIOHIDManagerOptionNone = 0x0, kIOHIDManagerOptionUsePersistentProperties = 0x1, kIOHIDManagerOptionDoNotLoadProperties = 0x2, kIOHIDManagerOptionDoNotSaveProperties = 0x4, } IOHIDManagerOptions;
Constants
kIOHIDManagerOptionNone
For those times when supplying 0 just isn't explicit enough. Available in OS X v10.7 and later. Declared in IOHIDManager.h.
kIOHIDManagerOptionUsePersistentProperties
This constant can be supplied to IOHIDManagerCreate (page 821) to create and/or use a persistent properties store. Available in OS X v10.7 and later. Declared in IOHIDManager.h.
832
kIOHIDManagerOptionDoNotLoadProperties
This constant can be supplied to when you wish to overwrite the persistent properties store without loading it first. const kIOHIDManagerOptionDoNotSaveProperties This constant can be supplied to IOHIDManagerCreate (page 821) when you want to use the persistent property store but do not want to add to it. (page 821) Available in OS X v10.7 and later. Declared in IOHIDManager.h. Availability Available in OS X v10.7 and later. Declared in
IOHIDManager.h
IOHIDManagerRef
This is the type of a reference to the IOHIDManager.
833
IOHIDQueue.h Reference
Declared in
IOHIDQueue.h
Overview
IOHIDQueue defines an object used to queue values from input parsed items (IOHIDElement) contained within a Human Interface Device (HID) object. This object is useful when you need to keep track of all values of an input element, rather than just the most recent one. IOHIDQueue is a CFType object and as such conforms to all the conventions expected such object. IOHIDQueue should be considered optional and is only useful for working with complex input elements. These elements include those whose length are greater than sizeof(CFIndex) or elements that are duplicate items. Whenever possible please defer to using IOHIDManagerRegisterInputValueCallback or IOHIDDeviceRegisterInputValueCallback. Note:Absolute element values (based on a fixed origin) will only be placed on a queue if there is a change in value. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Human Interface Device & Force Feedback . Please review documentation before using this reference. All of the information described in this document is contained in the header file IOHIDQueue.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDQueue.h.
Included Headers
<CoreFoundation/CoreFoundation.h> <IOKit/hid/IOHIDBase.h>
834
Functions
See the Overview for header-level documentation.
IOHIDQueueAddElement
Adds an element to the queue
Parameters
queue
Declared in
IOHIDQueue.h
IOHIDQueueContainsElement
Queries the queue to determine if elemement has been added.
Parameters
queue
Element to be queried.
835
Return Value Returns true or false depending if element is present. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDQueue.h
IOHIDQueueCopyNextValue
Dequeues a retained copy of an element value from the head of an IOHIDQueue.
Parameters
queue
IOHIDQueue object to be queried. Return Value Returns valid IOHIDValueRef if data is available. Discussion Because the value is a retained copy, it is up to the caller to release the value using CFRelease. Use with setValueCallback to avoid polling the queue for data. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDQueue.h
836
IOHIDQueueCopyNextValueWithTimeout
Dequeues a retained copy of an element value from the head of an IOHIDQueue. This method will block until either a value is available or it times out.
Parameters
queue
Timeout before aborting an attempt to dequeue a value from the head of a queue. Return Value Returns valid IOHIDValueRef if data is available. Discussion Because the value is a retained copy, it is up to the caller to release the value using CFRelease. Use with setValueCallback to avoid polling the queue for data. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDQueue.h
IOHIDQueueCreate
Creates an IOHIDQueue object for the specified device.
CF_EXPORT IOHIDQueueRef IOHIDQueueCreate( CFAllocatorRef allocator, IOHIDDeviceRef device, CFIndex depth, IOOptionBits options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
837
Parameters
allocator
IOHIDDevice object
depth
Reserved for future use. Return Value Returns a new IOHIDQueueRef. Discussion Take care in specifying an appropriate depth to prevent dropping events. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDQueue.h
IOHIDQueueGetDepth
Obtain the depth of the queue.
Parameters
queue
838
IOHIDQueueGetDevice
Obtain the device associated with the queue.
Parameters
queue
IOHIDQueue to be queried. Return Value Returns the a reference to the device. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDQueue.h
IOHIDQueueGetTypeID
Returns the type identifier of all IOHIDQueue instances.
839
Declared in
IOHIDQueue.h
IOHIDQueueRegisterValueAvailableCallback
Sets callback to be used when the queue transitions to non-empty.
CF_EXPORT void IOHIDQueueRegisterValueAvailableCallback( IOHIDQueueRef queue, IOHIDCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
queue
Pointer to data to be passed to the callback. Discussion In order to make use of asynchronous behavior, the queue needs to be scheduled with the run loop. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDQueue.h
IOHIDQueueRemoveElement
Removes an element from the queue
840
Parameters
queue
Element to be removed from the queue. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDQueue.h
IOHIDQueueScheduleWithRunLoop
Schedules queue with run loop.
CF_EXPORT void IOHIDQueueScheduleWithRunLoop( IOHIDQueueRef queue, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
queue
Run loop mode to be used when scheduling any asynchronous activity. Discussion Formally associates queue with client's run loop. Scheduling this queue with the run loop is necessary before making use of any asynchronous APIs. Availability Available in OS X v10.5 and later.
841
Declared in
IOHIDQueue.h
IOHIDQueueSetDepth
Sets the depth of the queue. @disussion Set the appropriate depth value based on the number of elements contained in a queue.
Parameters
queue
The new queue depth. Availability Available in OS X v10.5 and later. Declared in
IOHIDQueue.h
IOHIDQueueStart
Starts element value delivery to the queue.
Parameters
queue
842
Related Sample Code HID Config Save HID Dumper HID Utilities
Declared in
IOHIDQueue.h
IOHIDQueueStop
Stops element value delivery to the queue.
Parameters
queue
Declared in
IOHIDQueue.h
IOHIDQueueUnscheduleFromRunLoop
Unschedules queue with run loop.
CF_EXPORT void IOHIDQueueUnscheduleFromRunLoop( IOHIDQueueRef queue, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
queue
843
runLoop
Run loop mode to be used when scheduling any asynchronous activity. Discussion Formally disassociates queue with client's run loop. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDQueue.h
Data Types
See the Overview for header-level documentation.
IOHIDQueueRef
Discussion This is the type of a reference to the IOHIDQueue. Availability Available in OS X v10.5 and later. Declared in
IOHIDQueue.h
844
IOHIDTransaction.h Reference
Declared in
IOHIDTransaction.h
Overview
IOHIDTransaction defines an object used to manipulate multiple parsed items (IOHIDElement) contained within a Human Interface Device (HID) object. It is used to minimize device communication when interacting with feature and output type elements that are grouped by their report IDs. IOHIDTransaction is a CFType object and as such conforms to all the conventions expected such object. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Human Interface Device & Force Feedback . Please review documentation before using this reference. All of the information described in this document is contained in the header file IOHIDTransaction.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDTransaction.h.
Included Headers
<CoreFoundation/CoreFoundation.h> <IOKit/hid/IOHIDBase.h>
Functions
See the Overview for header-level documentation.
845
IOHIDTransactionAddElement
Adds an element to the transaction @disussion To minimize device traffic it is important to add elements that share a common report type and report id.
Parameters
transaction
Element to be added to the transaction. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionClear
Clears element transaction values.
Parameters
transaction
IOHIDTransaction object to be modified. Discussion In regards to kIOHIDTransactionDirectionTypeOutput direction, default element values will be preserved. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
846
IOHIDTransactionCommit
Synchronously commits element transaction to the device.
Parameters
transaction
IOHIDTransaction object to be modified. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion In regards to kIOHIDTransactionDirectionTypeOutput direction, default element values will be used if element values are not set. If neither are set, that element will be omitted from the commit. After a transaction is committed, transaction element values will be cleared and default values preserved. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionCommitWithCallback
Commits element transaction to the device.
CF_EXPORT IOReturn IOHIDTransactionCommitWithCallback( IOHIDTransactionRef transaction, CFTimeInterval timeout, IOHIDCallback callback, void *context) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
transaction
847
callback
Callback of type IOHIDCallback to be used when transaction has been completed. If null, this method will behave synchronously.
context
Pointer to data to be passed to the callback. Return Value Returns kIOReturnSuccess if successful or a kern_return_t if unsuccessful. Discussion In regards to kIOHIDTransactionDirectionTypeOutput direction, default element values will be used if element values are not set. If neither are set, that element will be omitted from the commit. After a transaction is committed, transaction element values will be cleared and default values preserved.
Note: It is possible for elements from different reports to be present in a given transaction causing a commit to
transcend multiple reports. Keep this in mind when setting a appropriate timeout. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionContainsElement
Queries the transaction to determine if elemement has been added.
Parameters
transaction
Element to be queried. Return Value Returns true or false depending if element is present.
848
IOHIDTransactionCreate
Creates an IOHIDTransaction object for the specified device.
CF_EXPORT IOHIDTransactionRef IOHIDTransactionCreate( CFAllocatorRef allocator, IOHIDDeviceRef device, IOHIDTransactionDirectionType direction, IOOptionBits options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
allocator
IOHIDDevice object
direction
Reserved for future use. Return Value Returns a new IOHIDTransactionRef. Discussion IOHIDTransaction objects can be used to either send or receive multiple element values. As such the direction used should represent they type of objects added to the transaction. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
849
IOHIDTransactionGetDevice
Obtain the device associated with the transaction.
Parameters
transaction
IOHIDTransaction to be queried. Return Value Returns the a reference to the device. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionGetDirection
Obtain the direction of the transaction.
Parameters
transaction
IOHIDTransaction to be queried. Return Value Returns the transaction direction. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
850
IOHIDTransactionGetTypeID
Returns the type identifier of all IOHIDTransaction instances.
IOHIDTransactionGetValue
Obtains the value for a transaction element.
CF_EXPORT IOHIDValueRef IOHIDTransactionGetValue( IOHIDTransactionRef transaction, IOHIDElementRef element, IOOptionBits options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
transaction
Element to be queried.
options
See IOHIDTransactionOption. Return Value Returns IOHIDValueRef for the given element. Discussion If the transaction direction is kIOHIDTransactionDirectionTypeInput the value represents what was obtained from the device from the transaction. Otherwise, if the transaction direction is kIOHIDTransactionDirectionTypeOutput the value represents the pending value to be sent to the device. Use the kIOHIDTransactionOptionDefaultOutputValue option to get the default element value. Availability Available in OS X v10.5 and later.
851
Declared in
IOHIDTransaction.h
IOHIDTransactionRemoveElement
Removes an element to the transaction
Parameters
transaction
Element to be removed to the transaction. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionScheduleWithRunLoop
Schedules transaction with run loop.
CF_EXPORT void IOHIDTransactionScheduleWithRunLoop( IOHIDTransactionRef transaction, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
transaction
852
Discussion Formally associates transaction with client's run loop. Scheduling this transaction with the run loop is necessary before making use of any asynchronous APIs. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionSetDirection
Sets the direction of the transaction @disussion This method is useful for manipulating bi-direction (feature) elements such that you can set or get element values without creating an additional transaction object.
Parameters
transaction
The new transaction direction. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionSetValue
Sets the value for a transaction element.
CF_EXPORT void IOHIDTransactionSetValue( IOHIDTransactionRef transaction, IOHIDElementRef element, IOHIDValueRef value, IOOptionBits options) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
853
Parameters
transaction
See IOHIDTransactionOption. Discussion The value set is pended until the transaction is committed and is only used if the transaction direction is kIOHIDTransactionDirectionTypeOutput. Use the kIOHIDTransactionOptionDefaultOutputValue option to set the default element value. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
IOHIDTransactionUnscheduleFromRunLoop
Unschedules transaction with run loop.
CF_EXPORT void IOHIDTransactionUnscheduleFromRunLoop( IOHIDTransactionRef transaction, CFRunLoopRef runLoop, CFStringRef runLoopMode) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
transaction
854
Discussion Formally disassociates transaction with client's run loop. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
Data Types
See the Overview for header-level documentation.
IOHIDTransactionRef
Discussion This is the type of a reference to the IOHIDTransaction. Availability Available in OS X v10.5 and later. Declared in
IOHIDTransaction.h
855
IOHIDValue.h Reference
Declared in
IOHIDValue.h
Overview
IOHIDValue defines a value at a given time from an parsed item (IOHIDElement) contained within a Human Interface Device (HID) object. It is used to obtain either integer or data element values along with scaled values based on physical or calibrated settings. IOHIDValue is a CFType object and as such conforms to all the conventions expected such object. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Human Interface Device & Force Feedback . Please review documentation before using this reference. All of the information described in this document is contained in the header file IOHIDValue.h found at /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDValue.h.
Included Headers
Functions
See the Overview for header-level documentation.
856
IOHIDValueCreateWithBytes
Creates a new element value using byte data.
CF_EXPORT IOHIDValueRef IOHIDValueCreateWithBytes( CFAllocatorRef allocator, IOHIDElementRef element, uint64_t timeStamp, const uint8_t *bytes, CFIndex length) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
allocator
The CFAllocator which should be used to allocate memory for the value. This parameter may be NULL in which case the current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.
element
Number of bytes in the passed buffer. Return Value Returns a reference to a new IOHIDValueRef. Discussion IOHIDValueGetTimeStamp should represent OS AbsoluteTime, not CFAbsoluteTime. To obtain the OS AbsoluteTime, please reference the APIs declared in <mach/mach_time.h> Availability Available in OS X v10.5 and later. Declared in
IOHIDValue.h
IOHIDValueCreateWithBytesNoCopy
Creates a new element value using byte data without performing a copy.
857
CF_EXPORT IOHIDValueRef IOHIDValueCreateWithBytesNoCopy( CFAllocatorRef allocator, IOHIDElementRef element, uint64_t timeStamp, const uint8_t *bytes, CFIndex length) AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER;
Parameters
allocator
The CFAllocator which should be used to allocate memory for the value. This parameter may be NULL in which case the current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.
element
Number of bytes in the passed buffer. Return Value Returns a reference to a new IOHIDValueRef. Discussion The timestamp value passed should represent OS AbsoluteTime, not CFAbsoluteTime. To obtain the OS AbsoluteTime, please reference the APIs declared in <mach/mach_time.h> Availability Available in OS X v10.5 and later. Declared in
IOHIDValue.h
IOHIDValueCreateWithIntegerValue
Creates a new element value using an integer value.
858
Parameters
allocator
The CFAllocator which should be used to allocate memory for the value. This parameter may be NULL in which case the current default CFAllocator is used. If this reference is not a valid CFAllocator, the behavior is undefined.
element
Integer value to be copied to this object. Return Value Returns a reference to a new IOHIDValueRef. Discussion IOHIDValueGetTimeStamp should represent OS AbsoluteTime, not CFAbsoluteTime. To obtain the OS AbsoluteTime, please reference the APIs declared in <mach/mach_time.h> Availability Available in OS X v10.5 and later.
Related Sample Code HID LED test tool
Declared in
IOHIDValue.h
IOHIDValueGetBytePtr
Returns a byte pointer to the value contained in this IOHIDValueRef.
859
Parameters
value
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Return Value Returns a pointer to the value. Availability Available in OS X v10.5 and later. Declared in
IOHIDValue.h
IOHIDValueGetElement
Returns the element value associated with this IOHIDValueRef.
Parameters
value
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Return Value Returns a IOHIDElementRef referenced by this value. Availability Available in OS X v10.5 and later.
Related Sample Code HID Config Save
Declared in
IOHIDValue.h
IOHIDValueGetIntegerValue
Returns an integer representaion of the value contained in this IOHIDValueRef.
860
Parameters
value
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Return Value Returns an integer representation of the value. Discussion The value is based on the logical element value contained in the report returned by the device. Availability Available in OS X v10.5 and later. Declared in
IOHIDValue.h
IOHIDValueGetLength
Returns the size, in bytes, of the value contained in this IOHIDValueRef.
Parameters
value
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Return Value Returns length of the value. Availability Available in OS X v10.5 and later. Declared in
IOHIDValue.h
861
IOHIDValueGetScaledValue
Returns an scaled representaion of the value contained in this IOHIDValueRef based on the scale type.
Parameters
value
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined.
type
The type of scaling to be performed. Return Value Returns an scaled floating point representation of the value. Discussion The scaled value is based on the range described by the scale type's min and max, such that: scaledValue = ((value - min) * (scaledMax - scaledMin) / (max - min)) + scaledMin
Note:
kIOHIDValueScaleTypePhysical: Scales element value using the physical bounds of the device such that scaledMin = physicalMin and scaledMax = physicalMax. kIOHIDValueScaleTypeCalibrated: Scales element value such that scaledMin = -1 and scaledMax = 1. This value will also take into account the calibration properties associated with this element.
Declared in
IOHIDValue.h
862
IOHIDValueGetTimeStamp
Returns the timestamp value contained in this IOHIDValueRef.
Parameters
value
The value to be queried. If this parameter is not a valid IOHIDValueRef, the behavior is undefined. Return Value Returns a uint64_t representing the timestamp of this value. Discussion The timestamp value returned represents OS AbsoluteTime, not CFAbsoluteTime. Availability Available in OS X v10.5 and later. Declared in
IOHIDValue.h
IOHIDValueGetTypeID
Returns the type identifier of all IOHIDValue instances.
863
Declared in
IOI2CInterface.h
Overview Functions
See the Overview for header-level documentation.
IOFBCopyI2CInterfaceForBus
Returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair.
Parameters
bus
The interface instance is returned. The caller should release this instance with IOObjectRelease(). Return Value An IOReturn code.
864
Discussion Some graphics devices will allow access to an I2C bus routed through a display connector in order to control external devices on that bus. This function returns an instance of an I2C bus interface, associated with an IOFramebuffer instance / bus index pair. The number of I2C buses is available from the IOFBGetI2CInterfaceCount() call. The interface may be used with the IOI2CInterfaceOpen/Close/SendRequest() calls to carry out I2C transactions on that bus. Not all graphics devices support this functionality. Availability Available in OS X v10.3 and later. Declared in
IOI2CInterface.h
IOFBGetI2CInterfaceCount
Returns a count of I2C interfaces available associated with an IOFramebuffer instance.
Parameters
framebuffer
The io_service_t of an IOFramebuffer instance. CoreGraphics will provide this for a CGDisplay with the CGDisplayIOServicePort() call.
count
Interface count is returned. Return Value An IOReturn code. Discussion Returns a count of I2C interfaces available associated with an IOFramebuffer instance. Availability Available in OS X v10.3 and later. Declared in
IOI2CInterface.h
865
IOI2CInterfaceClose
Closes an IOI2CConnectRef.
Parameters
connect
Pass kNilOptions. Return Value An IOReturn code. Discussion Frees the resources associated with an IOI2CConnectRef. Availability Available in OS X v10.3 and later. Declared in
IOI2CInterface.h
IOI2CInterfaceOpen
Opens an instance of an I2C bus interface, allowing I2C requests to be made.
Parameters
interface
An I2C bus interface (see IOFBCopyI2CInterfaceForBus). The interface may be released after this call is made.
options
Pass kNilOptions.
866
connect
The opaque IOI2CConnectRef is returned, for use with IOI2CSendRequest() and IOI2CInterfaceClose(). Return Value An IOReturn code. Discussion An instance of an I2C bus interface, obtained by IOFBCopyI2CInterfaceForBus, is opened with this function allowing I2C requests to be made. Availability Available in OS X v10.3 and later. Declared in
IOI2CInterface.h
IOI2CSendRequest
Carries out the I2C transaction specified by an IOI2CRequest structure.
Parameters
connect
Pass kNilOptions.
request
Pass a pointer to a IOI2CRequest structure describing the request. If an asynchronous request (with a non-NULL completion routine) the request structure must be valid for the life of the request. Return Value An IOReturn code reflecting only the result of starting the transaction. If the result of IOI2CSendRequest() is kIOReturnSuccess, the I2C transaction result is returned in the result field of the request structure. Discussion Frees the resources associated with an IOI2CConnectRef.
867
Data Types
See the Overview for header-level documentation.
IOI2CBusTiming
A structure defining low level timing for an I2C bus.
struct IOI2CBusTiming { AbsoluteTime bitTimeout; AbsoluteTime byteTimeout; AbsoluteTime acknowledgeTimeout; AbsoluteTime startTimeout; AbsoluteTime holdTime; AbsoluteTime riseFallTime; UInt32 __reservedA[8]; };
Fields
bitTimeout
Maximum time a slave can delay (by pulling the clock line low) a single bit response.
byteTimeout
Maximum time a slave can delay (by pulling the clock line low) the first bit of a byte response.
acknowledgeTimeout
Maximum time to wait for a slave to respond with an ACK after writing a byte.
startTimeout
Set to zero.
868
Discussion This structure is used to specify timeouts and pulse widths for an I2C bus implementation.
IOI2CRequest
A structure defining an I2C bus transaction.
struct IOI2CRequest { IOOptionBits sendTransactionType; IOOptionBits replyTransactionType; uint32_t sendAddress; uint32_t replyAddress; uint8_t sendSubAddress; uint8_t replySubAddress; uint8_t __reservedA[2]; uint64_t minReplyDelay; IOReturn result; IOOptionBits commFlags; #if defined(__LP64__) uint32_t __padA; #else vm_address_t sendBuffer; #endif uint32_t sendBytes; uint32_t __reservedB[2]; #if defined(__LP64__) uint32_t __padB; #else vm_address_t replyBuffer; #endif uint32_t replyBytes; IOI2CRequestCompletion completion; #if !defined(__LP64__) uint32_t __padC[5]; #else vm_address_t sendBuffer; vm_address_t replyBuffer; #endif uint32_t __reservedC[10]; #ifdef __ppc__ uint32_t __reservedD; #endif };
869
Fields
__reservedA
Set to zero.
result
The result of the transaction. Common errors are kIOReturnNoDevice if there is no device responding at the given address, kIOReturnUnsupportedMode if the type of transaction is unsupported on the requested bus.
completion
A completion routine to be executed when the request completes. If NULL is passed, the request is synchronous, otherwise it may execute asynchronously.
commFlags
Flags that modify the I2C transaction type. The following flags are defined: kIOI2CUseSubAddressCommFlag Transaction includes a subaddress.
minReplyDelay
Set to zero.
sendTransactionType
The following types of transaction are defined for the send part of the request: kIOI2CNoTransactionType No send transaction to perform. kIOI2CSimpleTransactionType Simple I2C message. kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
sendBuffer
Number of bytes to send. Set to actual bytes sent on completion of the request.
replyAddress
870
__reservedC
Set to zero.
replyTransactionType
The following types of transaction are defined for the reply part of the request: kIOI2CNoTransactionType No reply transaction to perform. kIOI2CSimpleTransactionType Simple I2C message. kIOI2CDDCciReplyTransactionType DDC/ci message (with embedded length). See VESA DDC/ci specification. kIOI2CCombinedTransactionType Combined format I2C R/~W transaction.
replyBuffer
Max bytes to reply (size of replyBuffer). Set to actual bytes received on completion of the request.
__reservedD
Set to zero. Discussion This structure is used to request an I2C transaction consisting of a send (write) to and reply (read) from a device, either of which is optional, to be carried out atomically on an I2C bus.
871
IOKitLib.h Reference
Declared in
IOKitLib.h
Overview
IOKitLib implements non-kernel task access to common IOKit object types - IORegistryEntry, IOService, IOIterator etc. These functions are generic - families may provide API that is more specific. IOKitLib represents IOKit objects outside the kernel with the types io_object_t, io_registry_entry_t, io_service_t, & io_connect_t. Function names usually begin with the type of object they are compatible with - eg. IOObjectRelease can be used with any io_object_t. Inside the kernel, the c++ class hierarchy allows the subclasses of each object type to receive the same requests from user level clients, for example in the kernel, IOService is a subclass of IORegistryEntry, which means any of the IORegistryEntryXXX functions in IOKitLib may be used with io_service_t's as well as io_registry_t's. There are functions available to introspect the class of the kernel object which any io_object_t et al. represents. IOKit objects returned by all functions should be released with IOObjectRelease.
Included Headers
<sys/cdefs.h> types.h <mach/mach_types.h> <mach/mach_init.h> <CoreFoundation/CFBase.h> <CoreFoundation/CFDictionary.h> <CoreFoundation/CFRunLoop.h> <IOKit/IOTypes.h> <IOKit/IOKitKeys.h> <IOKit/OSMessageNotification.h> <AvailabilityMacros.h>
872
<dispatch/dispatch.h>
Functions
See the Overview for header-level documentation.
IOBSDNameMatching
Create a matching dictionary that specifies an IOService match based on BSD device name.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.
options
The BSD name, as a const char *. Return Value The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. Discussion IOServices that represent BSD devices have an associated BSD name. This function creates a matching dictionary that will match IOService's with a given BSD name. Availability Available in OS X v10.0 and later.
Related Sample Code VolumeToBSDNode
Declared in
IOLib.h
873
IOConnectAddClient
Inform a connection of a second connection.
Parameters
connect
Another connect handle created by IOServiceOpen. Return Value A kern_return_t error code returned by the family. Discussion This is a generic method to inform a family connection of a second connection, and is rarely used. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectAddRef
Adds a reference to the connect handle.
Parameters
connect
The connect handle created by IOServiceOpen. Return Value A kern_return_t error code.
874
Discussion Adds a reference to the connect handle. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectGetService
Returns the IOService a connect handle was opened on.
Parameters
connect
On succes, the service handle the connection was opened on, which should be released with IOObjectRelease. Return Value A kern_return_t error code. Discussion Finds the service object a connection was opened on. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectMapMemory
Map hardware or shared memory into the caller's task.
875
kern_return_t IOConnectMapMemory( io_connect_t connect, uint32_t memoryType, task_port_t intoTask, vm_address_t *atAddress, vm_size_t *ofSize, IOOptionBits options ); #else kern_return_t IOConnectMapMemory( io_connect_t connect, uint32_t memoryType, task_port_t intoTask, mach_vm_address_t *atAddress, mach_vm_size_t *ofSize, IOOptionBits options ); #endif /* !__LP64__ || defined(IOCONNECT_MAPMEMORY_10_6) */
Parameters
connect
What is being requested to be mapped, not interpreted by IOKit and family defined. The family may support physical hardware or shared memory mappings.
intoTask
The task port for the task in which to create the mapping. This may be different to the task which the opened the connection.
atAddress
An in/out parameter - if the kIOMapAnywhere option is not set, the caller should pass the address where it requests the mapping be created, otherwise nothing need to set on input. The address of the mapping created is passed back on sucess.
ofSize
The size of the mapping created is passed back on success. Return Value A kern_return_t error code. Discussion This is a generic method to create a mapping in the callers task. The family will interpret the type parameter to determine what sort of mapping is being requested. Cache modes and placed mappings may be requested by the caller.
876
Declared in
IOKitLib.h
IOConnectMapMemory64
Map hardware or shared memory into the caller's task.
kern_return_t IOConnectMapMemory64( io_connect_t connect, uint32_t memoryType, task_port_t intoTask, mach_vm_address_t *atAddress, mach_vm_size_t *ofSize, IOOptionBits options );
Parameters
connect
What is being requested to be mapped, not interpreted by IOKit and family defined. The family may support physical hardware or shared memory mappings.
intoTask
The task port for the task in which to create the mapping. This may be different to the task which the opened the connection.
atAddress
An in/out parameter - if the kIOMapAnywhere option is not set, the caller should pass the address where it requests the mapping be created, otherwise nothing need to set on input. The address of the mapping created is passed back on sucess.
ofSize
The size of the mapping created is passed back on success. Return Value A kern_return_t error code.
877
Discussion This is a generic method to create a mapping in the callers task. The family will interpret the type parameter to determine what sort of mapping is being requested. Cache modes and placed mappings may be requested by the caller. Availability Available in OS X v10.5 and later. Declared in
IOKitLib.h
IOConnectRelease
Remove a reference to the connect handle.
Parameters
connect
The connect handle created by IOServiceOpen. Return Value A kern_return_t error code. Discussion Removes a reference to the connect handle. If the last reference is removed an implicit IOServiceClose is performed. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectSetCFProperties
Set CF container based properties on a connection.
kern_return_t IOConnectSetCFProperties(
878
Parameters
connect
A CF container - commonly a CFDictionary but this is not enforced. The container should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects. Return Value A kern_return_t error code returned by the family. Discussion This is a generic method to pass a CF container of properties to the connection. The properties are interpreted by the family and commonly represent configuration settings, but may be interpreted as anything. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectSetCFProperty
Set a CF container based property on a connection.
Parameters
connect
879
property
A CF container - should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects. Return Value A kern_return_t error code returned by the object. Discussion This is a generic method to pass a CF property to the connection. The property is interpreted by the family and commonly represent configuration settings, but may be interpreted as anything. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectSetNotificationPort
Set a port to receive family specific notifications.
kern_return_t IOConnectSetNotificationPort( io_connect_t connect, uint32_t type, mach_port_t port, uintptr_t reference );
Parameters
connect
The type of notification requested, not interpreted by IOKit and family defined.
port
Some families may support passing a reference parameter for the callers use with the notification. Return Value A kern_return_t error code.
880
Discussion This is a generic method to pass a mach port send right to be be used by family specific notifications. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectUnmapMemory
Remove a mapping made with IOConnectMapMemory.
#if !__LP64__ || defined(IOCONNECT_MAPMEMORY_10_6) kern_return_t IOConnectUnmapMemory( io_connect_t connect, uint32_t memoryType, task_port_t fromTask, vm_address_t atAddress ); #else kern_return_t IOConnectUnmapMemory( io_connect_t connect, uint32_t memoryType, task_port_t fromTask, mach_vm_address_t atAddress ); #endif /* !__LP64__ || defined(IOCONNECT_MAPMEMORY_10_6) */
Parameters
connect
The task port for the task in which to remove the mapping. This may be different to the task which the opened the connection.
atAddress
The address of the mapping to be removed. Return Value A kern_return_t error code.
881
Discussion This is a generic method to remove a mapping in the callers task. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOConnectUnmapMemory64
Remove a mapping made with IOConnectMapMemory64.
kern_return_t IOConnectUnmapMemory64( io_connect_t connect, uint32_t memoryType, task_port_t fromTask, mach_vm_address_t atAddress );
Parameters
connect
The task port for the task in which to remove the mapping. This may be different to the task which the opened the connection.
atAddress
The address of the mapping to be removed. Return Value A kern_return_t error code. Discussion This is a generic method to remove a mapping in the callers task. Availability Available in OS X v10.5 and later. Declared in
IOKitLib.h
882
IOCreateReceivePort
Creates and returns a mach port suitable for receiving IOKit messages of the specified type.
Parameters
msgType
The created port is returned. Return Value A kern_return_t error code. Discussion In the future IOKit may use specialized messages and ports instead of the standard ports created by mach_port_allocate(). Use this function instead of mach_port_allocate() to ensure compatibility with future revisions of IOKit. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IODispatchCalloutFromMessage
Dispatches callback notifications from a mach message.
Parameters
unused
883
reference
Pass the IONotificationPortRef for the object. Discussion A notification object may deliver notifications to a mach messaging client, which should call this function to generate the callbacks associated with the notifications arriving on the port. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOIteratorIsValid
Checks an iterator is still valid.
Parameters
iterator
An IOKit iterator handle. Return Value True if the iterator handle is valid, otherwise false is returned. Discussion Some iterators will be made invalid if changes are made to the structure they are iterating over. This function checks the iterator is still valid and should be called when IOIteratorNext returns zero. An invalid iterator can be reset and the iteration restarted. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOIteratorNext
Returns the next object in an iteration.
884
Parameters
iterator
An IOKit iterator handle. Return Value If the iterator handle is valid, the next element in the iteration is returned, otherwise zero is returned. The element should be released by the caller when it is finished. Discussion This function returns the next object in an iteration, or zero if no more remain or the iterator is invalid. Availability Available in OS X v10.0 and later.
Related Sample Code AppleSamplePCI Deva_Example GLUT STUCAuthoringDeviceTool STUCOtherDeviceTool
Declared in
IOKitLib.h
IOIteratorReset
Resets an iteration back to the beginning.
Parameters
iterator
An IOKit iterator handle. Discussion If an iterator is invalid, or if the caller wants to start over, IOIteratorReset will set the iteration back to the beginning.
885
Declared in
IOKitLib.h
IOKitGetBusyState
Returns the busyState of all IOServices.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.
busyState
The busyState count is returned. Return Value A kern_return_t error code. Discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService, its busyState is increased by one. Change in busyState to or from zero also changes the IOService's provider's busyState by one, which means that an IOService is marked busy when any of the above activities is ocurring on it or any of its clients. IOKitGetBusyState returns the busy state of the root of the service plane which reflects the busy state of all IOServices. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
886
IOKitWaitQuiet
Wait for a all IOServices' busyState to be zero.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.
waitTime
Specifies a maximum time to wait. Return Value Returns an error code if mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. Discussion Blocks the caller until all IOServices are non busy, see IOKitGetBusyState. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOMasterPort
Returns the mach port used to initiate communication with IOKit.
Parameters
bootstrapPort
887
Return Value A kern_return_t error code. Discussion Functions that don't specify an existing object require the IOKit master port to be passed. This function obtains that port. Availability Available in OS X v10.0 and later.
Related Sample Code Deva_Example GLUT
Declared in
IOKitLib.h
IONotificationPortCreate
Creates and returns a notification object for receiving IOKit notifications of new devices or state changes.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. Return Value A reference to the notification object. Discussion Creates the notification object to receive notifications from IOKit of new device arrivals or state changes. The notification object can be supply a CFRunLoopSource, or mach_port_t to be used to listen for events. Availability Available in OS X v10.0 and later.
Related Sample Code STUCAuthoringDeviceTool STUCOtherDeviceTool USBPrivateDataSample
888
Declared in
IOKitLib.h
IONotificationPortDestroy
Destroys a notification object created with IONotificationPortCreate. Also destroys any mach_port's or CFRunLoopSources obatined from IONotificationPortGetRunLoopSource (page 890) or
IONotificationPortGetMachPort (page 889)
Parameters
notify
Declared in
IOKitLib.h
IONotificationPortGetMachPort
Returns a mach_port to be used to listen for notifications.
Parameters
notify
The notification object. Return Value A mach_port for the notification object.
889
Discussion A notification object may deliver notifications to a mach messaging client if they listen for messages on the port obtained from this function. Callbacks associated with the notifications may be delivered by calling IODispatchCalloutFromMessage with messages received. The caller should not release this mach_port_t. Just call IONotificationPortDestroy (page 889) to dispose of the mach_port_t and IONotificationPortRef when done. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IONotificationPortGetRunLoopSource
Returns a CFRunLoopSource to be used to listen for notifications.
Parameters
notify
The notification object. Return Value A CFRunLoopSourceRef for the notification object. Discussion A notification object may deliver notifications to a CFRunLoop by adding the run loop source returned by this function to the run loop. The caller should not release this CFRunLoopSource. Just call IONotificationPortDestroy (page 889) to dispose of the IONotificationPortRef and the CFRunLoopSource when done. Availability Available in OS X v10.0 and later.
Related Sample Code STUCAuthoringDeviceTool STUCOtherDeviceTool USBPrivateDataSample
890
Declared in
IOKitLib.h
IONotificationPortSetDispatchQueue
Sets a dispatch queue to be used to listen for notifications.
Parameters
notify
A dispatch queue. Discussion A notification object may deliver notifications to a dispatch client. Availability Available in OS X v10.7 and later. Declared in
IOKitLib.h
IOObjectConformsTo
Performs an OSDynamicCast operation on an IOKit object.
Parameters
object
An IOKit object.
className
891
Return Value If the object handle is valid, and represents an object in the kernel that dynamic casts to the class true is returned, otherwise false. Discussion This function uses the OSMetaClass system in the kernel to determine if the object will dynamic cast to a class, specified as a C-string. In other words, if the object is of that class or a subclass. Availability Available in OS X v10.0 and later.
Related Sample Code VolumeToBSDNode
Declared in
IOKitLib.h
IOObjectCopyBundleIdentifierForClass
Return the bundle identifier of the given class.
Parameters
classname
The name of the class as a CFString. Return Value The resulting CFStringRef. This should be released by the caller. If a valid class name is not passed in, then NULL is returned. Discussion This function uses the OSMetaClass system in the kernel to derive the name of the kmod, which is the same as the bundle identifier. Availability Available in OS X v10.4 and later. Declared in
IOKitLib.h
892
IOObjectCopyClass
Return the class name of an IOKit object.
Parameters
object
The IOKit object. Return Value The resulting CFStringRef. This should be released by the caller. If a valid object is not passed in, then NULL is returned. Discussion This function does the same thing as IOObjectGetClass, but returns the result as a CFStringRef. Availability Available in OS X v10.4 and later. Declared in
IOKitLib.h
IOObjectCopySuperclassForClass
Return the superclass name of the given class.
Parameters
classname
The name of the class as a CFString. Return Value The resulting CFStringRef. This should be released by the caller. If there is no superclass, or a valid class name is not passed in, then NULL is returned. Discussion This function uses the OSMetaClass system in the kernel to derive the name of the superclass of the class.
893
IOObjectGetClass
Return the class name of an IOKit object.
Parameters
object
Caller allocated buffer to receive the name string. Return Value A kern_return_t error code. Discussion This function uses the OSMetaClass system in the kernel to derive the name of the class the object is an instance of. Availability Available in OS X v10.0 and later.
Related Sample Code VolumeToBSDNode
Declared in
IOKitLib.h
IOObjectGetKernelRetainCount
Returns kernel retain count of an IOKit object.
894
Parameters
object
An IOKit object. Return Value If the object handle is valid, the kernel objects retain count is returned, otherwise zero is returned. Discussion This function may be used in diagnostics to determine the current retain count of the kernel object at the kernel level. Availability Available in OS X v10.6 and later. Declared in
IOKitLib.h
IOObjectGetRetainCount
Returns kernel retain count of an IOKit object. Identical to IOObjectGetKernelRetainCount() but available prior to Mac OS 10.6.
Parameters
object
An IOKit object. Return Value If the object handle is valid, the kernel objects retain count is returned, otherwise zero is returned. Discussion This function may be used in diagnostics to determine the current retain count of the kernel object at the kernel level. Availability Available in OS X v10.0 and later.
895
Declared in
IOKitLib.h
IOObjectGetUserRetainCount
Returns the retain count for the current process of an IOKit object.
Parameters
object
An IOKit object. Return Value If the object handle is valid, the objects user retain count is returned, otherwise zero is returned. Discussion This function may be used in diagnostics to determine the current retain count for the calling process of the kernel object. Availability Available in OS X v10.6 and later. Declared in
IOKitLib.h
IOObjectIsEqualTo
Checks two object handles to see if they represent the same kernel object.
Parameters
object
An IOKit object.
anObject
896
Return Value If both object handles are valid, and represent the same object in the kernel true is returned, otherwise false. Discussion If two object handles are returned by IOKitLib functions, this function will compare them to see if they represent the same kernel object. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOObjectRelease
Releases an object handle previously returned by IOKitLib.
Parameters
object
The IOKit object to release. Return Value A kern_return_t error code. Discussion All objects returned by IOKitLib should be released with this function when access to them is no longer needed. Using the object after it has been released may or may not return an error, depending on how many references the task has to the same object in the kernel. Availability Available in OS X v10.0 and later.
Related Sample Code AppleSamplePCI Deva_Example GLUT STUCAuthoringDeviceTool STUCOtherDeviceTool
897
Declared in
IOKitLib.h
IOObjectRetain
Retains an object handle previously returned by IOKitLib.
Parameters
object
The IOKit object to retain. Return Value A kern_return_t error code. Discussion Gives the caller an additional reference to an existing object handle previously returned by IOKitLib. Availability Available in OS X v10.1 and later.
Related Sample Code SMARTQuery VolumeToBSDNode
Declared in
IOKitLib.h
IORegistryCreateIterator
Create an iterator rooted at the registry root.
kern_return_t IORegistryCreateIterator( mach_port_t masterPort, const io_name_t plane, IOOptionBits options, io_iterator_t *iterator );
898
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.
plane
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
options
kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned from IOIteratorNext calls on the registry iterator.
iterator
A created iterator handle, to be released by the caller when it has finished with it. Return Value A kern_return_t error code. Discussion This method creates an IORegistryIterator in the kernel that is set up with options to iterate children of the registry root entry, and to recurse automatically into entries as they are returned, or only when instructed with calls to IORegistryIteratorEnterEntry. The iterator object keeps track of entries that have been recursed into previously to avoid loops. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IORegistryEntryCreateCFProperties
Create a CF dictionary representation of a registry entry's property table.
kern_return_t IORegistryEntryCreateCFProperties( io_registry_entry_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, IOOptionBits options );
Parameters
entry
899
properties
A CFDictionary is created and returned the caller on success. The caller should release with CFRelease.
allocator
No options are currently defined. Return Value A kern_return_t error code. Discussion This function creates an instantaneous snapshot of a registry entry's property table, creating a CFDictionary analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. Availability Available in OS X v10.0 and later.
Related Sample Code AppleSamplePCI GLUT STUCOtherDeviceTool VirtualScanner
Declared in
IOKitLib.h
IORegistryEntryCreateCFProperty
Create a CF representation of a registry entry's property.
CFTypeRef IORegistryEntryCreateCFProperty( io_registry_entry_t entry, CFStringRef key, CFAllocatorRef allocator, IOOptionBits options );
Parameters
entry
900
key
No options are currently defined. Return Value A CF container is created and returned the caller on success. The caller should release with CFRelease. Discussion This function creates an instantaneous snapshot of a registry entry property, creating a CF container analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. Availability Available in OS X v10.0 and later.
Related Sample Code CDROMSample GetPrimaryMACAddress GLUT VolumeToBSDNode
Declared in
IOKitLib.h
IORegistryEntryCreateIterator
Create an iterator rooted at a given registry entry.
kern_return_t IORegistryEntryCreateIterator( io_registry_entry_t entry, const io_name_t plane, IOOptionBits options, io_iterator_t *iterator );
Parameters
entry
901
plane
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
options
kIORegistryIterateRecursively may be set to recurse automatically into each entry as it is returned from IOIteratorNext calls on the registry iterator. kIORegistryIterateParents may be set to iterate the parents of each entry, by default the children are iterated.
iterator
A created iterator handle, to be released by the caller when it has finished with it. Return Value A kern_return_t error code. Discussion This method creates an IORegistryIterator in the kernel that is set up with options to iterate children or parents of a root entry, and to recurse automatically into entries as they are returned, or only when instructed with calls to IORegistryIteratorEnterEntry. The iterator object keeps track of entries that have been recursed into previously to avoid loops. Availability Available in OS X v10.0 and later.
Related Sample Code VolumeToBSDNode
Declared in
IOKitLib.h
IORegistryEntryFromPath
Looks up a registry entry by path.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.
902
path
A C-string path. Return Value A handle to the IORegistryEntry witch was found with the path, to be released with IOObjectRelease by the caller, or MACH_PORT_NULL on failure. Discussion This function parses paths to lookup registry entries. The path should begin with '<plane name>:' If there are characters remaining unparsed after an entry has been looked up, this is considered an invalid lookup. Paths are further documented in IORegistryEntry.h Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IORegistryEntryGetChildEntry
Returns the first child of a registry entry in a plane.
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
child
The first child of the registry entry, on success. The child must be released by the caller. Return Value A kern_return_t error code. Discussion This function will return the child which first attached to a registry entry in a plane.
903
IORegistryEntryGetChildIterator
Returns an iterator over an registry entry's child entries in a plane.
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
iterator
The created iterator over the children of the entry, on success. The iterator must be released when the iteration is finished. Return Value A kern_return_t error code. Discussion This method creates an iterator which will return each of a registry entry's child entries in a specified plane. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IORegistryEntryGetLocationInPlane
Returns a C-string location assigned to a registry entry, in a specified plane.
904
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
location
The caller's buffer to receive the location string. Return Value A kern_return_t error code. Discussion Registry entries can given a location string in a particular plane, or globally. If the entry has had a location set in the specified plane that location string will be returned, otherwise the global location string is returned. If no global location string has been set, an error is returned. Availability Available in OS X v10.1 and later. Declared in
IOKitLib.h
IORegistryEntryGetName
Returns a C-string name assigned to a registry entry.
Parameters
entry
905
Return Value A kern_return_t error code. Discussion Registry entries can be named in a particular plane, or globally. This function returns the entry's global name. The global name defaults to the entry's meta class name if it has not been named. Availability Available in OS X v10.0 and later.
Related Sample Code USBPrivateDataSample
Declared in
IOKitLib.h
IORegistryEntryGetNameInPlane
Returns a C-string name assigned to a registry entry, in a specified plane.
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
name
The caller's buffer to receive the name. Return Value A kern_return_t error code. Discussion Registry entries can be named in a particular plane, or globally. This function returns the entry's name in the specified plane or global name if it has not been named in that plane. The global name defaults to the entry's meta class name if it has not been named.
906
IORegistryEntryGetParentEntry
Returns the first parent of a registry entry in a plane.
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
parent
The first parent of the registry entry, on success. The parent must be released by the caller. Return Value A kern_return_t error code. Discussion This function will return the parent to which the registry entry was first attached in a plane. Availability Available in OS X v10.0 and later.
Related Sample Code GetPrimaryMACAddress GLUT SMARTQuery
Declared in
IOKitLib.h
907
IORegistryEntryGetParentIterator
Returns an iterator over an registry entry's parent entries in a plane.
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
iterator
The created iterator over the parents of the entry, on success. The iterator must be released when the iteration is finished. Return Value A kern_return_t error. Discussion This method creates an iterator which will return each of a registry entry's parent entries in a specified plane. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IORegistryEntryGetPath
Create a path for a registry entry.
908
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
path
A char buffer allocated by the caller. Return Value IORegistryEntryGetPath will fail if the entry is not attached in the plane, or if the buffer is not large enough to contain the path. Discussion The path for a registry entry is copied to the caller's buffer. The path describes the entry's attachment in a particular plane, which must be specified. The path begins with the plane name followed by a colon, and then followed by '/' separated path components for each of the entries between the root and the registry entry. An alias may also exist for the entry, and will be returned if available. Availability Available in OS X v10.0 and later.
Related Sample Code AppleSamplePCI
Declared in
IOKitLib.h
IORegistryEntryGetRegistryEntryID
Returns an ID for the registry entry that is global to all tasks.
Parameters
entry
909
Return Value A kern_return_t error code. Discussion The entry ID returned by IORegistryEntryGetRegistryEntryID can be used to identify a registry entry across all tasks. A registry entry may be looked up by its entryID by creating a matching dictionary with IORegistryEntryIDMatching() to be used with the IOKit matching functions. The ID is valid only until the machine reboots. Availability Available in OS X v10.6 and later. Declared in
IOKitLib.h
IORegistryEntryIDMatching
Create a matching dictionary that specifies an IOService match based on a registry entry ID.
Parameters
entryID
The registry entry ID to be found. Return Value The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. Discussion This function creates a matching dictionary that will match a registered, active IOService found with the given registry entry ID. The entry ID for a registry entry is returned by IORegistryEntryGetRegistryEntryID(). Availability Available in OS X v10.6 and later. Declared in
IOKitLib.h
910
IORegistryEntryInPlane
Determines if the registry entry is attached in a plane.
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane. Return Value If the entry has a parent in the plane, true is returned, otherwise false is returned. Discussion This method determines if the entry is attached in a plane to any other entry. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IORegistryEntrySearchCFProperty
Create a CF representation of a registry entry's property.
CFTypeRef IORegistryEntrySearchCFProperty( io_registry_entry_t entry, const io_name_t plane, CFStringRef key, CFAllocatorRef allocator, IOOptionBits options ) CF_RETURNS_RETAINED;
Parameters
entry
The name of an existing registry plane. Plane names are defined in IOKitKeys.h, eg. kIOServicePlane.
911
key
kIORegistryIterateRecursively may be set to recurse automatically into the registry hierarchy. Without this option, this method degenerates into the standard IORegistryEntryCreateCFProperty() call. kIORegistryIterateParents may be set to iterate the parents of the entry, in place of the children. Return Value A CF container is created and returned the caller on success. The caller should release with CFRelease. Discussion This function creates an instantaneous snapshot of a registry entry property, creating a CF container analogue in the caller's task. Not every object available in the kernel is represented as a CF container; currently OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, OSBoolean are created as their CF counterparts. This function will search for a property, starting first with specified registry entry's property table, then iterating recusively through either the parent registry entries or the child registry entries of this entry. Once the first occurrence is found, it will lookup and return the value of the property, using the same semantics as IORegistryEntryCreateCFProperty. The iteration keeps track of entries that have been recursed into previously to avoid loops. Availability Available in OS X v10.1 and later. Declared in
IOKitLib.h
IORegistryEntrySetCFProperties
Set CF container based properties in a registry entry.
Parameters
entry
912
properties
A CF container - commonly a CFDictionary but this is not enforced. The container should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects. Return Value A kern_return_t error code returned by the object. Discussion This is a generic method to pass a CF container of properties to an object in the registry. Setting properties in a registry entry is not generally supported, it is more common to support IOConnectSetCFProperties for connection based property setting. The properties are interpreted by the object. Availability Available in OS X v10.0 and later.
Related Sample Code AppleSamplePCI
Declared in
IOKitLib.h
IORegistryEntrySetCFProperty
Set a CF container based property in a registry entry.
Parameters
entry
A CF container - should consist of objects which are understood by IOKit - these are currently : CFDictionary, CFArray, CFSet, CFString, CFData, CFNumber, CFBoolean, and are passed in the kernel as the corresponding OSDictionary etc. objects.
913
Return Value A kern_return_t error code returned by the object. Discussion This is a generic method to pass a CF container as a property to an object in the registry. Setting properties in a registry entry is not generally supported, it is more common to support IOConnectSetCFProperty for connection based property setting. The property is interpreted by the object. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IORegistryGetRootEntry
Return a handle to the registry root.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port. Return Value A handle to the IORegistryEntry root instance, to be released with IOObjectRelease by the caller, or MACH_PORT_NULL on failure. Discussion This method provides an accessor to the root of the registry for the machine. The root may be passed to a registry iterator when iterating a plane, and contains properties that describe the available planes, and diagnostic information for IOKit. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
914
IORegistryIteratorEnterEntry
Recurse into the current entry in the registry iteration.
Return Value A kern_return_t error code. Discussion This method makes the current entry, ie. the last entry returned by IOIteratorNext, the root in a new level of recursion. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IORegistryIteratorExitEntry
Exits a level of recursion, restoring the current entry.
Return Value kIOReturnSuccess if a level of recursion was undone, kIOReturnNoDevice if no recursive levels are left in the iteration. Discussion This method undoes an IORegistryIteratorEnterEntry, restoring the current entry. If there are no more levels of recursion to exit false is returned, otherwise true is returned. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
915
IOServiceAddInterestNotification
Register for notification of state changes in an IOService.
kern_return_t IOServiceAddInterestNotification( IONotificationPortRef notifyPort, io_service_t service, const io_name_t interestType, IOServiceInterestCallback callback, void *refCon, io_object_t *notification );
Parameters
notifyPort
A IONotificationPortRef object that controls how messages will be sent when the notification is fired. See IONotificationPortCreate.
interestType
A notification type from IOKitKeys.h kIOGeneralInterest General state changes delivered via the IOService::message API. kIOBusyInterest Delivered when the IOService changes its busy state to or from zero. The message argument contains the new busy state causing the notification.
callback
A callback function called when the notification fires, with messageType and messageArgument for the state change.
refCon
An object handle is returned on success, and should be released by the caller when the notification is to be destroyed. Return Value A kern_return_t error code. Discussion IOService objects deliver notifications of their state changes to their clients via the IOService::message API, and to other interested parties including callers of this function. Message type s are defined IOKit/IOMessage.h. Availability Available in OS X v10.0 and later.
916
Declared in
IOKitLib.h
IOServiceAddMatchingNotification
Look up registered IOService objects that match a matching dictionary, and install a notification request of new IOServices that match.
kern_return_t IOServiceAddMatchingNotification( IONotificationPortRef notifyPort, const io_name_t notificationType, CFDictionaryRef matching, IOServiceMatchingCallback callback, void *refCon, io_iterator_t *notification );
Parameters
notifyPort
A IONotificationPortRef object that controls how messages will be sent when the armed notification is fired. When the notification is delivered, the io_iterator_t representing the notification should be iterated through to pick up all outstanding objects. When the iteration is finished the notification is rearmed. See IONotificationPortCreate.
notificationType
A notification type from IOKitKeys.h kIOPublishNotification Delivered when an IOService is registered. kIOFirstPublishNotification Delivered when an IOService is registered, but only once per IOService instance. Some IOService's may be reregistered when their state is changed. kIOMatchedNotification Delivered when an IOService has had all matching drivers in the kernel probed and started. kIOFirstMatchNotification Delivered when an IOService has had all matching drivers in the kernel probed and started, but only once per IOService instance. Some IOService's may be reregistered when their state is changed. kIOTerminatedNotification Delivered after an IOService has been terminated.
917
matching
A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching.
callback
An iterator handle is returned on success, and should be released by the caller when the notification is to be destroyed. The notification is armed when the iterator is emptied by calls to IOIteratorNext - when no more objects are returned, the notification is armed. Note the notification is not armed when first created. Return Value A kern_return_t error code. Discussion This is the preferred method of finding IOService objects that may arrive at any time. The type of notification specifies the state change the caller is interested in, on IOService's that match the match dictionary. Notification types are identified by name, and are defined in IOKitKeys.h. The matching information used in the matching dictionary may vary depending on the class of service being looked up. Availability Available in OS X v10.0 and later.
Related Sample Code STUCAuthoringDeviceTool STUCOtherDeviceTool USBPrivateDataSample
Declared in
IOKitLib.h
IOServiceClose
Close a connection to an IOService and destroy the connect handle.
918
Parameters
connect
The connect handle created by IOServiceOpen. It will be destroyed by this function, and should not be released with IOObjectRelease. Return Value A kern_return_t error code. Discussion A connection created with the IOServiceOpen should be closed when the connection is no longer to be used with IOServiceClose. Availability Available in OS X v10.0 and later.
Related Sample Code SimpleUserClient
Declared in
IOKitLib.h
IOServiceGetBusyState
Returns the busyState of an IOService.
Parameters
service
919
Discussion Many activities in IOService are asynchronous. When registration, matching, or termination is in progress on an IOService, its busyState is increased by one. Change in busyState to or from zero also changes the IOService's provider's busyState by one, which means that an IOService is marked busy when any of the above activities is ocurring on it or any of its clients. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOServiceGetMatchingService
Look up a registered IOService object that matches a matching dictionary.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.
matching
A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching. Return Value The first service matched is returned on success. The service must be released by the caller. Discussion This is the preferred method of finding IOService objects currently registered by IOKit (that is, objects that have had their registerService() methods invoked). To find IOService objects that aren't yet registered, use an iterator as created by IORegistryEntryCreateIterator(). IOServiceAddMatchingNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up.
920
Declared in
IOKitLib.h
IOServiceGetMatchingServices
Look up registered IOService objects that match a matching dictionary.
Parameters
masterPort
The master port obtained from IOMasterPort(). Pass kIOMasterPortDefault to look up the default master port.
matching
A CF dictionary containing matching information, of which one reference is always consumed by this function (Note prior to the Tiger release there was a small chance that the dictionary might not be released if there was an error attempting to serialize the dictionary). IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching.
existing
An iterator handle is returned on success, and should be released by the caller when the iteration is finished. Return Value A kern_return_t error code.
921
Discussion This is the preferred method of finding IOService objects currently registered by IOKit (that is, objects that have had their registerService() methods invoked). To find IOService objects that aren't yet registered, use an iterator as created by IORegistryEntryCreateIterator(). IOServiceAddMatchingNotification can also supply this information and install a notification of new IOServices. The matching information used in the matching dictionary may vary depending on the class of service being looked up. Availability Available in OS X v10.0 and later.
Related Sample Code AppleSamplePCI GetPrimaryMACAddress GLUT SimpleUserClient SMARTQuery
Declared in
IOKitLib.h
IOServiceMatching
Create a matching dictionary that specifies an IOService class match.
Parameters
name
The class name, as a const C-string. Class matching is successful on IOService's of this class or any subclass. Return Value The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. Discussion A very common matching criteria for IOService is based on its class. IOServiceMatching will create a matching dictionary that specifies any IOService of a class, or its subclasses. The class is specified by C-string name. Availability Available in OS X v10.0 and later.
922
Declared in
IOKitLib.h
IOServiceMatchPropertyTable
Match an IOService objects with matching dictionary.
Parameters
service
A CF dictionary containing matching information. IOKitLib can construct matching dictionaries for common criteria with helper functions such as IOServiceMatching, IOServiceNameMatching, IOBSDNameMatching.
matches
The boolean result is returned. Return Value A kern_return_t error code. Discussion This function calls the matching method of an IOService object and returns the boolean result. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
923
IOServiceNameMatching
Create a matching dictionary that specifies an IOService name match.
Parameters
name
The IOService name, as a const C-string. Return Value The matching dictionary created, is returned on success, or zero on failure. The dictionary is commonly passed to IOServiceGetMatchingServices or IOServiceAddNotification which will consume a reference, otherwise it should be released with CFRelease by the caller. Discussion A common matching criteria for IOService is based on its name. IOServiceNameMatching will create a matching dictionary that specifies an IOService with a given name. Some IOServices created from the device tree will perform name matching on the standard compatible, name, model properties. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOServiceOpen
A request to create a connection to an IOService.
kern_return_t IOServiceOpen( io_service_t service, task_port_t owningTask, uint32_t type, io_connect_t *connect );
Parameters
service
The IOService object to open a connection to, usually obtained via the IOServiceGetMatchingServices or IOServiceAddNotification APIs.
924
owningTask
A constant specifying the type of connection to be created, interpreted only by the IOService's family.
connect
An io_connect_t handle is returned on success, to be used with the IOConnectXXX APIs. It should be destroyed with IOServiceClose(). Return Value A return code generated by IOService::newUserClient. Discussion A non kernel client may request a connection be opened via the IOServiceOpen() library function, which will call IOService::newUserClient in the kernel. The rules & capabilities of user level clients are family dependent, the default IOService implementation returns kIOReturnUnsupported. Availability Available in OS X v10.0 and later.
Related Sample Code AppleSamplePCI SimpleUserClient
Declared in
IOKitLib.h
IOServiceRequestProbe
A request to rescan a bus for device changes.
Parameters
service
The IOService object to request a rescan, usually obtained via the IOServiceGetMatchingServices or IOServiceAddNotification APIs.
options
925
Return Value A return code generated by IOService::requestProbe. Discussion A non kernel client may request a bus or controller rescan for added or removed devices, if the bus family does automatically notice such changes. For example, SCSI bus controllers do not notice device changes. The implementation of this routine is family dependent, and the default IOService implementation returns kIOReturnUnsupported. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOServiceWaitQuiet
Wait for an IOService's busyState to be zero.
Parameters
service
Specifies a maximum time to wait. Return Value Returns an error code if mach synchronization primitives fail, kIOReturnTimeout, or kIOReturnSuccess. Discussion Blocks the caller until an IOService is non busy, see IOServiceGetBusyState. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
926
Callbacks
See the Overview for header-level documentation.
IOAsyncCallback
standard callback function for asynchronous I/O requests with lots of extra arguments beyond a refcon and result code.
typedef void ( *IOAsyncCallback)( void *refcon, IOReturn result, void **args, uint32_t numArgs);
Parameters
refcon
IOAsyncCallback0
standard callback function for asynchronous I/O requests with no extra arguments beyond a refcon and result code.
927
Parameters
refcon
The result of the I/O operation Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOAsyncCallback1
standard callback function for asynchronous I/O requests with one extra argument beyond a refcon and result code. This is often a count of the number of bytes transferred
Parameters
refcon
928
IOAsyncCallback2
standard callback function for asynchronous I/O requests with two extra arguments beyond a refcon and result code.
typedef void ( *IOAsyncCallback2)( void *refcon, IOReturn result, void *arg0, void *arg1);
Parameters
refcon
Extra argument
arg1
IOServiceInterestCallback
Callback function to be notified of changes in state of an IOService.
typedef void ( *IOServiceInterestCallback)( void *refcon, io_service_t service, uint32_t messageType, void *messageArgument );
Parameters
refcon
929
service
An argument for the message, dependent on the messageType. If the message data is larger than sizeof(void*), then messageArgument contains a pointer to the message data; otherwise, messageArgument contains the message data. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
IOServiceMatchingCallback
Callback function to be notified of IOService publication.
Parameters
refcon
The notification iterator which now has new objects. Availability Available in OS X v10.0 and later. Declared in
IOKitLib.h
Constants
See the Overview for header-level documentation.
930
Global Constants
Constants
kIOMasterPortDefault
The default mach port used to initiate communication with IOKit. When specifying a master port to IOKit functions, the NULL argument indicates "use the default". This is a synonym for NULL, if you'd rather use a named constant. Available in OS X v10.2 and later. Declared in IOKitLib.h.
931
Declared in
IOKitServer.h
Overview
Included Headers
Constants
See the Overview for header-level documentation.
IOCatalogueGetData
Constants
kIOCatalogGetContents
Returns a snapshot of the database to the caller. Available in OS X v10.0 and later. Declared in IOKitServer.h.
932
IOCatalogueReset
enum { kIOCatalogResetDefault = 1 };
Constants
kIOCatalogResetDefault
Removes all entries from IOCatalogue except those used for booting the system. Available in OS X v10.0 and later. Declared in IOKitServer.h. Discussion user-client flag
IOCatalogueSendData
enum { kIOCatalogAddDrivers = 1, kIOCatalogAddDriversNoMatch, kIOCatalogRemoveDrivers, kIOCatalogRemoveDriversNoMatch, kIOCatalogStartMatching, kIOCatalogRemoveKernelLinker, kIOCatalogKextdActive, kIOCatalogKextdFinishedLaunching, kIOCatalogResetDrivers, kIOCatalogResetDriversNoMatch };
Constants
kIOCatalogAddDrivers
Signals a call to the addDrivers function in IOCatalogue. Available in OS X v10.0 and later. Declared in IOKitServer.h.
933
kIOCatalogAddDriversNoMatch
Signals a call to the addDrivers function in IOCatalogue but does not start a matching thread. Available in OS X v10.0 and later. Declared in IOKitServer.h.
kIOCatalogRemoveDrivers
Signals a call to the removeDrivers function in IOCatalogue. Available in OS X v10.0 and later. Declared in IOKitServer.h.
kIOCatalogRemoveDriversNoMatch
Signals a call to the removedrivers function in IOCatalogue but does not start a matching thread. Available in OS X v10.0 and later. Declared in IOKitServer.h.
kIOCatalogStartMatching
Signals the IOCatalogue to start an IOService matching thread. Available in OS X v10.0 and later. Declared in IOKitServer.h.
kIOCatalogRemoveKernelLinker
Signals the kernel that kextd is running. Available in OS X v10.6 and later. Declared in IOKitServer.h.
kIOCatalogKextdFinishedLaunching
Signals the IOCatalogue that kextd has finished sending it information at startup. Available in OS X v10.5 and later. Declared in IOKitServer.h.
kIOCatalogResetDrivers
Resets the IOCatalogue with a new set of personalities. Available in OS X v10.7 and later. Declared in IOKitServer.h.
kIOCatalogResetDriversNoMatch
Resets the IOCatalogue with a new set of personalities but does not start a matching thread. Available in OS X v10.7 and later. Declared in IOKitServer.h.
934
IOCatalogueTerminate
Constants
kIOCatalogModuleUnload
Terminates all services which depend on a particular module and unloads the module. Available in OS X v10.0 and later. Declared in IOKitServer.h.
kIOCatalogModuleTerminate
Terminates all services which depend on a particular module but does not unload the module. Available in OS X v10.0 and later. Declared in IOKitServer.h.
kIOCatalogServiceTerminate
Terminates a particular service by name. Available in OS X v10.0 and later. Declared in IOKitServer.h. Discussion user-client flags.
935
Declared in
IOMedia.h
Overview
This header contains the IOMedia class definition.
Included Headers
<IOKit/IOTypes.h>
Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOMediaClass "IOMedia" kIOMediaContentHintKey "Content Hint" kIOMediaContentKey "Content" kIOMediaContentMaskKey "Content Mask" kIOMediaEjectableKey "Ejectable" kIOMediaIconKey "IOMediaIcon" kIOMediaLeafKey "Leaf" kIOMediaOpenKey "Open" kIOMediaPreferredBlockSizeKey "Preferred Block Size" kIOMediaRemovableKey "Removable" kIOMediaSizeKey "Size" kIOMediaUUIDKey "UUID" kIOMediaWholeKey "Whole" kIOMediaWritableKey "Writable"
936
Constants
kIOMediaClass
The name of the IOMedia class. Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaContentHintKey
A property of IOMedia objects. The kIOMediaContentHintKey property has an OSString value and contains a hint of the media's contents. The hint is set at the time of the object's creation, should the creator have a clue as to what it may contain. The hint string does not change for the lifetime of the object and is formed in the likeness of Apple's "Apple_HFS" strings or in the likeness of a UUID. Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaContentKey
A property of IOMedia objects. The kIOMediaContentKey property has an OSString value and contains a description of the media's contents. The description is the same as the hint at the time of the object's creation, but it is possible that the description has been overridden by a client (which has probed the media and identified the content correctly) of the media object. It is more accurate than the hint for this reason. The string is formed in the likeness of Apple's "Apple_HFS" strings or in the likeness of a UUID. Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaContentMaskKey
A property of IOMedia clients. The kIOMediaContentMaskKey property has an OSString value and must exist in all IOMedia clients that drive new content (that is, produce new media objects). When the client matches against the provider media, the value of the client's kIOMediaContentMaskKey property is used to replace the provider's kIOMediaContentKey property. Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaEjectableKey
A property of IOMedia objects. The kIOMediaEjectableKey property has an OSBoolean value and describes whether the media is ejectable from the drive mechanism under software control. Implies IOMediaRemovable is also true. Available in OS X v10.0 and later. Declared in IOMedia.h.
937
kIOMediaIconKey
A property of any object in the media stack. kIOMediaIconKey is a property of any object in the media stack that wishes to override the default icon shown for the media objects in the stack. It is usually defined in a provider object below the media object. It has an OSDictionary value, with properties identical to the kIOIconKey definition, that is, kCFBundleIdentifierKey and kIOBundleResourceFileKey. Available in OS X v10.2 and later. Declared in IOMedia.h.
kIOMediaLeafKey
A property of IOMedia objects. The kIOMediaLeafKey property has an OSBoolean value and describes whether the media is a leaf, that is, it is the deepest media object in this branch of the I/O Registry. Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaOpenKey
A property of IOMedia objects. The kIOMediaOpenKey property has an OSBoolean value and describes whether a client presently has an open on this media. Available in OS X v10.5 and later. Declared in IOMedia.h.
kIOMediaPreferredBlockSizeKey
A property of IOMedia objects. The kIOMediaPreferredBlockSizeKey property has an OSNumber value and describes the media's natural block size in bytes. This information is useful to clients that want to optimize access to the media. Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaRemovableKey
A property of IOMedia objects. The kIOMediaRemovableKey property has an OSBoolean value and describes whether the media is removable from the drive mechanism. Available in OS X v10.2 and later. Declared in IOMedia.h.
938
kIOMediaSizeKey
A property of IOMedia objects. The kIOMediaSizeKey property has an OSNumber value and describes the total length of the media in bytes. Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaUUIDKey
A property of IOMedia objects. The kIOMediaUUIDKey property has an OSString value and contains a persistent Universal Unique Identifier for the media if such an identifier is available. Available in OS X v10.4 and later. Declared in IOMedia.h.
kIOMediaWholeKey
A property of IOMedia objects. The kIOMediaWholeKey property has an OSBoolean value and describes whether the media is whole, that is, it represents the whole disk (the physical disk, or a virtual replica thereof ). Available in OS X v10.0 and later. Declared in IOMedia.h.
kIOMediaWritableKey
A property of IOMedia objects. The kIOMediaWritableKey property has an OSBoolean value and describes whether the media is writable. Available in OS X v10.0 and later. Declared in IOMedia.h.
IOMediaAttributeMask
939
Constants
kIOMediaAttributeEjectableMask
Indicates whether the media is ejectable from the drive mechanism under software control. Implies kIOMediaAttributeRemovableMask. Available in OS X v10.4 and later. Declared in IOMedia.h.
kIOMediaAttributeRemovableMask
Indicates whether the media is removable from the drive mechanism. Available in OS X v10.4 and later. Declared in IOMedia.h. Discussion The IOMediaAttributeMask bit mask describes various attributes of the media object, such as its ejectability and its removability.
940
Declared in
IOMessage.h
Overview
Defines message type constants for several IOKit messaging API's.
Included Headers
<IOKit/IOReturn.h> <IOKit/IOTypes.h>
Functions
See the Overview for header-level documentation.
iokit_vendor_specific_msg
Discussion iokit_vendor_specific_msg passes messages in the sub_iokit_vendor_specific subsystem. It can be used to generate messages that are used for private communication between vendor specific code with the IOService::message() etc. APIs. Availability Available in OS X v10.4 and later. Declared in
IOMessage.h
941
Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOMessageCanDevicePowerOff iokit_common_msg(0x200) kIOMessageCanSystemPowerOff iokit_common_msg(0x240) kIOMessageCanSystemSleep iokit_common_msg(0x270) kIOMessageDeviceHasPoweredOff iokit_common_msg(0x225) kIOMessageDeviceHasPoweredOn iokit_common_msg(0x230) kIOMessageDeviceWillNotPowerOff iokit_common_msg(0x220) kIOMessageDeviceWillPowerOff iokit_common_msg(0x210) kIOMessageDeviceWillPowerOn iokit_common_msg(0x215) kIOMessageSystemHasPoweredOn iokit_common_msg(0x300) kIOMessageSystemPagingOff iokit_common_msg(0x255) kIOMessageSystemWillNotPowerOff iokit_common_msg(0x260) kIOMessageSystemWillNotSleep iokit_common_msg(0x290) kIOMessageSystemWillPowerOff iokit_common_msg(0x250) kIOMessageSystemWillPowerOn iokit_common_msg(0x320) kIOMessageSystemWillRestart iokit_common_msg(0x310) kIOMessageSystemWillSleep iokit_common_msg(0x280)
Constants
kIOMessageCanDevicePowerOff
Delivered to kIOAppPowerStateInterest clients of devices that implement their own idle timeouts. This message type is almost never used. Available in OS X v10.0 and later. Declared in IOMessage.h.
kIOMessageCanSystemPowerOff
Announces/Requests permission to proceed to system sleep. Delivered to in-kernel IOKit drivers via kIOGeneralInterest and kIOPriorityPowerStateInterest. Delivered to user clients of IORegisterForSystemPower. Available in OS X v10.0 and later. Declared in IOMessage.h.
942
kIOMessageDeviceHasPoweredOff
IOService power mgt does not send kIOMessageDeviceHasPoweredOff. Available in OS X v10.7 and later. Declared in IOMessage.h.
kIOMessageDeviceHasPoweredOn
Indicates the device has just moved to a higher power state. Sent to IOKit interest notification clients of type kIOAppPowerStateInterest and kIOGeneralInterest. Available in OS X v10.0 and later. Declared in IOMessage.h.
kIOMessageDeviceWillNotPowerOff
This IOKit interest notification is largely unused; it's not very interesting. Available in OS X v10.0 and later. Declared in IOMessage.h.
kIOMessageDeviceWillPowerOff
Indicates the device is about to move to a lower power state. Sent to IOKit interest notification clients of type kIOAppPowerStateInterest and kIOGeneralInterest. Available in OS X v10.0 and later. Declared in IOMessage.h.
kIOMessageDeviceWillPowerOn
IOService power mgt does not send kIOMessageDeviceWillPowerOn. Available in OS X v10.7 and later. Declared in IOMessage.h.
kIOMessageSystemHasPoweredOn
Announces that the system and its devices have woken up. Delivered to in-kernel IOKit drivers via kIOGeneralInterest and kIOPriorityPowerStateInterest. Delivered to user clients of IORegisterForSystemPower. Available in OS X v10.0 and later. Declared in IOMessage.h.
kIOMessageSystemPagingOff
Indicates an imminent system shutdown, paging device now unavailable. Recipients have a limited amount of time to respond, otherwise the system will timeout and shutdown even without a response. Delivered to clients of registerPrioritySleepWakeInterest(). Never delivered to user space notification clients. Available in OS X v10.7 and later. Declared in IOMessage.h.
943
kIOMessageSystemWillNotPowerOff
Announces that the system has retracted a previous attempt to sleep; it follows kIOMessageCanSystemSleep. Delivered to in-kernel IOKit drivers via kIOGeneralInterest and kIOPriorityPowerStateInterest. Delivered to user clients of IORegisterForSystemPower. Available in OS X v10.0 and later. Declared in IOMessage.h.
kIOMessageSystemWillPowerOff
Indicates an imminent system shutdown. Recipients have a limited amount of time to respond, otherwise the system will timeout and shutdown even without a response. Delivered to in-kernel IOKit drivers via IOService::systemWillShutdown(), and to clients of registerPrioritySleepWakeInterest(). Never delivered to user space notification clients. Available in OS X v10.0 and later. Declared in IOMessage.h.
kIOMessageSystemWillPowerOn
Announces that the system is beginning to power the device tree; most devices are unavailable at this point.. Delivered to in-kernel IOKit drivers via kIOGeneralInterest and kIOPriorityPowerStateInterest. Delivered to user clients of IORegisterForSystemPower. Available in OS X v10.3 and later. Declared in IOMessage.h.
kIOMessageSystemWillRestart
Indicates an imminent system restart. Recipients have a limited amount of time to respond, otherwise the system will timeout and restart even without a response. Delivered to in-kernel IOKit drivers via IOService::systemWillShutdown(), and to clients of registerPrioritySleepWakeInterest(). Never delivered to user space notification clients. Available in OS X v10.1 and later. Declared in IOMessage.h.
kIOMessageSystemWillSleep
Announces that sleep is beginning. Delivered to in-kernel IOKit drivers via kIOGeneralInterest and kIOPriorityPowerStateInterest. Delivered to user clients of IORegisterForSystemPower. Available in OS X v10.0 and later. Declared in IOMessage.h.
944
Declared in
IONetworkController.h
Overview Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOActiveMedium "IOActiveMedium" kIODefaultMedium "IODefaultMedium" kIOFeatures "IOFeatures" kIOLinkData "IOLinkData" kIOLinkSpeed "IOLinkSpeed" kIOLinkStatus "IOLinkStatus" kIOMACAddress "IOMACAddress" kIOMaxPacketSize "IOMaxPacketSize" kIOMediumDictionary "IOMediumDictionary" kIOMinPacketSize "IOMinPacketSize" kIOModel "IOModel" kIONetworkControllerClass "IONetworkController" kIONetworkFilterGroup "IONetworkFilterGroup" kIOPacketFilters "IOPacketFilters" kIORevision "IORevision" kIOSelectedMedium "IOSelectedMedium" kIOVendor "IOVendor"
945
Constants
kIOActiveMedium
A property of IONetworkController objects. The kIOActiveMedium property is a property of IONetworkController objects. It has an OSSymbol value that describes the name of the active medium. This is the name of the medium where an active link has been established. This name can be used as a key into the medium dictionary to gather additional information about the active medium. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIODefaultMedium
A property of IONetworkController objects. The kIODefaultMedium property is a property of IONetworkController objects. It has an OSString value that describes the name of the default medium. This definition may change or disappear in the future. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOFeatures
A property of IONetworkController objects. The kIOFeatures property is a property of IONetworkController objects. It has an OSNumber value that describes generic features defined by IONetworkController that are supported by the network controller. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOLinkData
A property of IONetworkController objects. The kIOLinkData property is a property of IONetworkController objects. It has an OSData value that contains additional information describing the active link that was established. Its interpretation is not defined. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOLinkSpeed
A property of IONetworkController objects. The kIOLinkSpeed property is a property of IONetworkController objects. It has an OSNumber value that describes the speed of the link established over the active medium in bits per second. Available in OS X v10.0 and later. Declared in IONetworkController.h.
946
kIOLinkStatus
A property of IONetworkController objects. The kIOLinkStatus property is a property of IONetworkController objects. It has an OSNumber value that describes the current network link status. See IONetworkMedium for the definition of the link status bits. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOMACAddress
A property of IONetworkController objects. The kIOMACAddress property is a property of IONetworkController objects. It has an OSData value that describes the hardware MAC (media access controller) address, or station address, of the network controller. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOMaxPacketSize
A property of IONetworkController objects. The kIOMaxPacketSize property is a property of IONetworkController objects. It has an OSNumber value that describes the maximum packet size supported by the controller. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOMediumDictionary
A property of IONetworkController objects. The kIOMediumDictionary property is a property of IONetworkController objects. It has an OSDictionary value that is a container for the collection of IONetworkMedium objects that represent the media types supported by the network controller. Each entry in the dictionary is a key/value pair consisting of the medium name, and a dictionary value that contains the properties for that medium entry. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOMinPacketSize
A property of IONetworkController objects. The kIOMinPacketSize property is a property of IONetworkController objects. It has an OSNumber value that describes the minimum packet size supported by the controller. Available in OS X v10.0 and later. Declared in IONetworkController.h.
947
kIOModel
A property of IONetworkController objects. The kIOModel property is a property of IONetworkController objects. It has an OSString value that describes the model of the network controller. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIONetworkControllerClass
The name of the IONetworkController class. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIONetworkFilterGroup
The name assigned to the standard network filter group. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOPacketFilters
A property of IONetworkController objects. The kIOPacketFilters property is a property of IONetworkController objects. It has an OSDictionary value that describes the entire set of packet filters supported by the controller. Each entry in the dictionary is a key/value pair consisting of the filter group name, and an OSNumber describing the set of supported filters for that group. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIORevision
A property of IONetworkController objects. The kIORevision property is a property of IONetworkController objects. It has an OSString value that describes the revision level of the network controller. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOSelectedMedium
A property of IONetworkController objects. The kIOSelectedMedium property is a property of IONetworkController objects. It has an OSSymbol value that describes the name of the current selected medium. This name can be used as a key into the medium dictionary to gather additional information about the selected medium. Available in OS X v10.0 and later. Declared in IONetworkController.h.
948
kIOVendor
A property of IONetworkController objects. The kIOVendor property is a property of IONetworkController objects. It has an OSString value that describes the vendor of the network controller. Available in OS X v10.0 and later. Declared in IONetworkController.h.
Network
Feature flags returned by the getFeatures() method.
enum { kIONetworkFeatureNoBSDWait = 0x01, kIONetworkFeatureHardwareVlan = 0x02, kIONetworkFeatureSoftwareVlan = 0x04, kIONetworkFeatureMultiPages = 0x08, kIONetworkFeatureTSOIPv4 = 0x10, kIONetworkFeatureTSOIPv6 = 0x20 };
Constants
kIONetworkFeatureNoBSDWait
Set this bit in the value returned by getFeatures() to disable the automatic wait for "IOBSD" resource by the IONetworkController::start() method. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIONetworkFeatureHardwareVlan
Set this bit in the value returned by getFeatures() to indicate the controller supports hardware stripping and stuffing of 802.1q vlan tags. If the controller supports this feature it must enable it when initializing so that all received packets delivered to higher layers have the tag stripped. The controller should use setVlanTag() to provide the tag information out of band. Available in OS X v10.3 and later. Declared in IONetworkController.h.
kIONetworkFeatureSoftwareVlan
Set this bit in the value returned by getFeatures() to indicate that the controller can support software based vlan by transmitting and receiving packets 4 bytes longer that normal. Available in OS X v10.3 and later. Declared in IONetworkController.h.
949
kIONetworkFeatureMultiPages
Set this bit if the driver is capable of handling packets coming down from the network stack that reside in virtually, but not in physically contiguous span of the external mbuf clusters. In this case, the data area of a packet in the external mbuf cluster might cross one or more physical pages that are disjoint, depending on the interface MTU and the packet size. Such a use of larger than system page size clusters by the network stack is done for better system efficiency. Drivers that utilize the IOMbufNaturalMemoryCursor with the getPhysicalSegmentsWithCoalesce interfaces and enumerate the list of vectors should set this flag for possible gain in performance during bulk data transfer. Available in OS X v10.5 and later. Declared in IONetworkController.h.
kIONetworkFeatureTSOIPv4
Set this bit to advertise support for TCP/IPv4 segmentation offload. Available in OS X v10.6 and later. Declared in IONetworkController.h.
kIONetworkFeatureTSOIPv6
Set this bit to advertise support for TCP/IPv6 segmentation offload. Available in OS X v10.6 and later. Declared in IONetworkController.h. Discussion Feature Flags
StandardPacketFilters
All standard packet filters.
enum { kIOPacketFilterUnicast = 0x1, kIOPacketFilterBroadcast = 0x2, kIOPacketFilterMulticast = 0x10, kIOPacketFilterMulticastAll = 0x20, kIOPacketFilterPromiscuous = 0x100, kIOPacketFilterPromiscuousAll = 0x200 };
950
Constants
kIOPacketFilterUnicast
Reception of multicast packets addressed to a set of multicast addresses. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOPacketFilterMulticastAll
Reception of all multicast packets. Available in OS X v10.0 and later. Declared in IONetworkController.h.
kIOPacketFilterPromiscuous
Reception of all packets, including bad packets. Available in OS X v10.0 and later. Declared in IONetworkController.h. Discussion Each filter will allow the reception of certain class of packets depending on its destination MAC address.
951
Declared in
IONetworkData.h
Overview Constants
See the Overview for header-level documentation.
Defines
#define kIONetworkDataAccessTypes "Access Types" #define kIONetworkDataBasicAccessTypes \ (kIONetworkDataAccessTypeRead | kIONetworkDataAccessTypeSerialize) #define kIONetworkDataBytes "Data" #define kIONetworkDataSize "Size"
Constants
kIONetworkDataAccessTypes
A property of IONetworkData objects. The kIONetworkDataAccessTypes property is an OSNumber that describes the supported access types of an IONetworkData object. Available in OS X v10.0 and later. Declared in IONetworkData.h.
kIONetworkDataBasicAccessTypes
The default access types supported by an IONetworkData object. Allow read() and serialize(). Available in OS X v10.0 and later. Declared in IONetworkData.h.
952
kIONetworkDataBytes
A property of IONetworkData objects. The kIONetworkDataBytes property is an OSData that describes the data buffer of an IONetworkData object. This property is present only if kIONetworkDataAccessTypeSerialize access is supported. Available in OS X v10.0 and later. Declared in IONetworkData.h.
kIONetworkDataSize
A property of IONetworkData objects. The kIONetworkDataSize property is an OSNumber that describes the size of the data buffer of an IONetworkData object. Available in OS X v10.0 and later. Declared in IONetworkData.h.
NetworkDataAccessTypes
Constants that describe access types.
enum { kIONetworkDataAccessTypeRead = 0x01, kIONetworkDataAccessTypeWrite = 0x02, kIONetworkDataAccessTypeReset = 0x04, kIONetworkDataAccessTypeSerialize = 0x08, kIONetworkDataAccessTypeMask = 0xff };
Constants
kIONetworkDataAccessTypeRead
953
kIONetworkDataAccessTypeSerialize
NetworkDataBufferTypes
The types of data buffers that can be managed by an IONetworkData object.
Constants
kIONetworkDataBufferTypeInternal
An internal data buffer allocated by the init() method. Available in OS X v10.0 and later. Declared in IONetworkData.h.
kIONetworkDataBufferTypeExternal
An external (persistent) data buffer. Available in OS X v10.0 and later. Declared in IONetworkData.h.
kIONetworkDataBufferTypeNone
No data buffer. The only useful action perfomed by an IONetworkData object with this buffer type is to call the access notification handler. Available in OS X v10.0 and later. Declared in IONetworkData.h.
954
Declared in
IONetworkInterface.h
Overview Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOBuiltin "IOBuiltin" kIOInterfaceExtraFlags "IOInterfaceExtraFlags" kIOInterfaceFlags "IOInterfaceFlags" kIOInterfaceNamePrefix "IOInterfaceNamePrefix" kIOInterfaceState "IOInterfaceState" kIOInterfaceType "IOInterfaceType" kIOInterfaceUnit "IOInterfaceUnit" kIOLocation "IOLocation" kIOMaxTransferUnit "IOMaxTransferUnit" kIOMediaAddressLength "IOMediaAddressLength" kIOMediaHeaderLength "IOMediaHeaderLength" kIONetworkData "IONetworkData" kIONetworkInterfaceClass "IONetworkInterface" kIOPrimaryInterface "IOPrimaryInterface"
Constants
kIOBuiltin
kIOBuiltin is a property of IONetworkInterface objects. It has an OSBoolean value. The kIOBuiltin property describes whether the interface is built-in. Available in OS X v10.3 and later. Declared in IONetworkInterface.h.
955
kIOInterfaceExtraFlags
A property of IONetworkInterface objects. The kIOInterfaceExtraFlags property has an OSNumber value that specifies the current value of the interface eflags. The eflag constants are defined in bsd/net/if.h. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIOInterfaceFlags
A property of IONetworkInterface objects. The kIOInterfaceFlags property has an OSNumber value that specifies the current value of the interface flags. The flag constants are defined in bsd/net/if.h. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIOInterfaceNamePrefix
A property of IONetworkInterface objects. The kIOInterfaceNamePrefix property has an OSString value that describes the string prefix for the BSD name assigned to the interface. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIOInterfaceState
A property of IONetworkInterface objects. The kIOInterfaceState property has an OSNumber value that describes the current state of the interface object. This property is not exported to BSD via the ifnet structure. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIOInterfaceType
A property of IONetworkInterface objects. The kIOInterfaceType property has an OSNumber value that specifies the type of network interface that this interface represents. The type constants are defined in bsd/net/if_types.h. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIOInterfaceUnit
A property of IONetworkInterface objects. The kIOInterfaceUnit property has an OSNumber value that describes the unit number assigned to the interface object. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
956
kIOLocation
kIOLocation is a property of IONetworkInterface objects. It has an OSString value. The kIOLocation property describes the physical location of built-in interfaces. Available in OS X v10.3 and later. Declared in IONetworkInterface.h.
kIOMaxTransferUnit
A property of IONetworkInterface objects. The kIOMaxTransferUnit property has an OSNumber value that specifies the maximum transfer unit for the interface in bytes. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIOMediaAddressLength
A property of IONetworkInterface objects. The kIOMediaAddressLength property has an OSNumber value that specifies the size of the media address in bytes. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIOMediaHeaderLength
A property of IONetworkInterface objects. The kIOMediaHeaderLength property has an OSNumber value that specifies the size of the media header in bytes. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIONetworkData
A property of IONetworkInterface objects. The kIONetworkData property has an OSDictionary value and is a container for the set of IONetworkData objects managed by the interface. Each entry in the dictionary is a key/value pair consisting of the network data name, and an OSDictionary describing the contents of the network data. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIONetworkInterfaceClass
The name of the IONetworkInterface class. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
957
kIOPrimaryInterface
A property of IONetworkInterface objects. The kIOInterfaceNamePrefix property has an OSBoolean value that describes whether the interface is the primary or the built-in network interface. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
InterfaceObjectStates
Constants
kIONetworkInterfaceRegisteredState
The interface object has registered with the data link layer. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIONetworkInterfaceOpenedState
One or more clients have an open on the interface object. Available in OS X v10.0 and later. Declared in IONetworkInterface.h.
kIONetworkInterfaceDisabledState
The interface is temporarily unable to service its clients. This will occur when the network controller that is servicing the interface has entered a low power state that renders it unusable. Available in OS X v10.0 and later. Declared in IONetworkInterface.h. Discussion Constants used to encode the state of the interface object.
958
IONetworkLib.h Reference
Declared in
IONetworkLib.h
Overview
Included Headers
Functions
See the Overview for header-level documentation.
IONetworkClose
Close the connection to an IONetworkInterface object.
959
IONetworkGetDataCapacity
Get the capacity (in bytes) of a network data object.
Parameters
conObject
Upon success, the capacity is written to this address. Return Value kIOReturnSuccess on success, or an error code otherwise. Availability Available in OS X v10.0 and later. Declared in
IONetworkLib.h
IONetworkGetDataHandle
Get the handle of a network data object with the given name.
Parameters
conObject
960
dataHandleP
Upon success, the handle is written to this address. Return Value kIOReturnSuccess on success, or an error code otherwise. Availability Available in OS X v10.0 and later. Declared in
IONetworkLib.h
IONetworkGetPacketFiltersMask
Get the packet filters for a given filter group.
IOReturn IONetworkGetPacketFiltersMask( io_connect_t connect, const io_name_t filterGroup, UInt32 *filtersMask, IOOptionBits options );
Parameters
connect
kIONetworkSupportedPacketFilters may be set to fetch the filters that are supported by the hardware. Return Value An IOReturn error code. Discussion A network controller may support a number of packets filters that can accept or reject a type of packet seen on the network. A filter group identifies a set of related filters, such as all filters that will allow a packet to pass upstream based on the destination address encoded within the packet. This function allows an user-space program to get the filtering performed by a given filter group.
961
IONetworkOpen
Open a connection to an IONetworkInterface object. An IONetworkUserClient object is created to manage the connection.
IONetworkReadData
Read the buffer of a network data object.
IOReturn IONetworkReadData( io_connect_t conObj, IONDHandle dataHandle, UInt8 *destBuf, UInt32 *inOutSizeP);
Parameters
conObj
962
inOutSizeP
Pointer to an integer that the caller must initialize to contain the size of the buffer. This function will overwrite it with the actual number of bytes written to the buffer. Return Value kIOReturnSuccess on success, or an error code otherwise. Availability Available in OS X v10.0 and later. Declared in
IONetworkLib.h
IONetworkResetData
Fill the buffer of a network data object with zeroes.
Parameters
conObject
The handle of a network data object. Return Value kIOReturnSuccess on success, or an error code otherwise. Availability Available in OS X v10.0 and later. Declared in
IONetworkLib.h
IONetworkSetPacketFiltersMask
Set the packet filters for a given filter group.
IOReturn IONetworkSetPacketFiltersMask(
963
Parameters
connect
No options are currently defined. Return Value An IOReturn error code. Discussion A network controller may support a number of packets filters that can accept or reject a type of packet seen on the network. A filter group identifies a set of related filters, such as all filters that will allow a packet to pass upstream based on the destination address encoded within the packet. This function allows an user-space program to set the filtering performed by a given filter group. Availability Available in OS X v10.1 and later. Declared in
IONetworkLib.h
IONetworkWriteData
Write to the buffer of a network data object.
IOReturn IONetworkWriteData( io_connect_t conObj, IONDHandle dataHandle, UInt8 *srcBuf, UInt32 inSize);
964
Parameters
conObj
The size of the source buffer. Return Value kIOReturnSuccess on success, or an error code otherwise. Availability Available in OS X v10.0 and later. Declared in
IONetworkLib.h
Constants
See the Overview for header-level documentation.
IONetworkPacketFilterOptions
Constants
kIONetworkSupportedPacketFilters
Indicate the filters that are supported by the hardware. Available in OS X v10.1 and later. Declared in IONetworkLib.h.
965
Declared in
IONetworkMedium.h
Overview
Included Headers
<net/if_media.h>
Data Types
See the Overview for header-level documentation.
IOMediumType
Discussion A 32-bit value divided into fields which describes a single medium type. Availability Available in OS X v10.0 and later. Declared in
IONetworkMedium.h
Constants
See the Overview for header-level documentation.
966
Defines
Constants
kIOMediumFlags
A property of IONetworkMedium objects. The kIOMediumFlags property is an OSNumber object that describes a set of attributes assigned to the medium. Available in OS X v10.0 and later. Declared in IONetworkMedium.h.
kIOMediumIndex
A property of IONetworkMedium objects. The kIOMediumIndex property is an OSNumber object that describes an index assigned by the owner of the medium object. Its interpretation is driver specific. Available in OS X v10.0 and later. Declared in IONetworkMedium.h.
kIOMediumSpeed
A property of IONetworkMedium objects. The kIOMediumSpeed property is an OSNumber object that describes the maximum link speed supported by the medium in bits per second. Available in OS X v10.0 and later. Declared in IONetworkMedium.h.
kIOMediumType
A property of IONetworkMedium objects. The kIOMediumType property is an OSNumber object that describes the type of medium that this object represents. Available in OS X v10.0 and later. Declared in IONetworkMedium.h.
967
Declared in
IONetworkStats.h
Overview
Generic network statistics.
Data Types
See the Overview for header-level documentation.
IONetworkStats
typedef struct { UInt32 inputPackets; UInt32 inputErrors; UInt32 outputPackets; UInt32 outputErrors; UInt32 collisions; } IONetworkStats;
Discussion Generic network statistics structure. Availability Available in OS X v10.0 and later. Declared in
IONetworkStats.h
968
IOOutputQueueStats
typedef struct { UInt32 capacity; UInt32 size; UInt32 peakSize; UInt32 dropCount; UInt32 outputCount; UInt32 retryCount; UInt32 stallCount; UInt32 reserved[4]; } IOOutputQueueStats;
Discussion Statistics recorded by IOOutputQueue objects. Availability Available in OS X v10.0 and later. Declared in
IONetworkStats.h
Constants
See the Overview for header-level documentation.
Defines
Constants
kIONetworkStatsKey
Defines the name of an IONetworkData that contains an IONetworkStats. Available in OS X v10.0 and later. Declared in IONetworkStats.h.
kIOOutputQueueStatsKey
Defines the name of an IONetworkData that contains an IOOutputQueueStats. Available in OS X v10.0 and later. Declared in IONetworkStats.h.
969
Declared in
IOPM.h
Overview
Defines power management constants and keys used by both in-kernel and user space power management. IOPM.h defines a range of power management constants used in several in-kernel and user space APIs. Most significantly, the IOPMPowerFlags used to specify the fields of an IOPMPowerState struct are defined here. Most of the constants defined in IOPM.h are deprecated or for Apple internal use only, and are not elaborated on in headerdoc.
Included Headers
Data Types
See the Overview for header-level documentation.
IOPMSystemCapabilityChangeParameters
A structure describing a system capability change.
struct IOPMSystemCapabilityChangeParameters { uint32_t notifyRef; uint32_t maxWaitForReply; uint32_t changeFlags; uint32_t __reserved1; uint32_t fromCapabilities;
970
Fields
notifyRef
An identifier for this message notification. Clients with pending I/O can signal completion by calling allowPowerChange() with this value as the argument. Clients that are able to process the notification synchronously should ignore this field.
maxWaitForReply
A return value to the caller indicating the maximum time in microseconds to wait for the allowPowerChange() call. The default value is zero, which indicates the client processing has finished, and power management should not wait for an allowPowerChange() call.
changeFlags
Flags will be set to indicate whether the notification precedes the capability change (kIOPMSystemCapabilityWillChange), or after the capability change has occurred (kIOPMSystemCapabilityDidChange).
__reserved1
Set to zero.
fromCapabilities
Set to zero. Discussion A system capability change is a system level transition from a set of system capabilities to a new set of system capabilities. Power management sends a kIOMessageSystemCapabilityChange message and provides this structure as the message data (by reference) to gIOPriorityPowerStateInterest clients when system capability changes.
Constants
See the Overview for header-level documentation.
971
Defines
Constants
kIOPMMessageDarkWakeThermalEmergency
kIOPMMessageDarkWakeThermalEmergency Sent when machine becomes unsustainably warm in DarkWake. Kernel PM might choose to put the machine back to sleep right after. Available in OS X v10.8 and later. Declared in IOPM.h.
kIOPMMessageDriverAssertionsChanged
kIOPMMessageDriverAssertionsChanged Sent when kernel PM driver assertions have changed. Available in OS X v10.7 and later. Declared in IOPM.h.
Global Variables
kIOPMDriverAssertionCPUBit *= 0x01, /! kIOPMDriverAssertionUSBExternalDeviceBit */ kIOPMDriverAssertionUSBExternalDeviceBit *= 0x04, /! kIOPMDriverAssertionBluetoothHIDDevicePairedBit */ kIOPMDriverAssertionBluetoothHIDDevicePairedBit *= 0x08, /! kIOPMDriverAssertionExternalMediaMountedBit */ kIOPMDriverAssertionExternalMediaMountedBit *= 0x10, /! kIOPMDriverAssertionReservedBit5 */ kIOPMDriverAssertionReservedBit5 *= 0x20, /! kIOPMDriverAssertionPreventDisplaySleepBit */ kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, kIOPMDriverAssertionReservedBit7 = 0x80 }; kIOPMDriverAssertionCPUBit *= 0x01, /! kIOPMDriverAssertionUSBExternalDeviceBit */ kIOPMDriverAssertionUSBExternalDeviceBit *= 0x04, /! kIOPMDriverAssertionBluetoothHIDDevicePairedBit */
972
kIOPMDriverAssertionBluetoothHIDDevicePairedBit *= 0x08, /! kIOPMDriverAssertionExternalMediaMountedBit */ kIOPMDriverAssertionExternalMediaMountedBit *= 0x10, /! kIOPMDriverAssertionReservedBit5 */ kIOPMDriverAssertionReservedBit5 *= 0x20, /! kIOPMDriverAssertionPreventDisplaySleepBit */ kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, kIOPMDriverAssertionReservedBit7 = 0x80 }; kIOPMDriverAssertionCPUBit *= 0x01, /! kIOPMDriverAssertionUSBExternalDeviceBit */ kIOPMDriverAssertionUSBExternalDeviceBit *= 0x04, /! kIOPMDriverAssertionBluetoothHIDDevicePairedBit */ kIOPMDriverAssertionBluetoothHIDDevicePairedBit *= 0x08, /! kIOPMDriverAssertionExternalMediaMountedBit */ kIOPMDriverAssertionExternalMediaMountedBit *= 0x10, /! kIOPMDriverAssertionReservedBit5 */ kIOPMDriverAssertionReservedBit5 *= 0x20, /! kIOPMDriverAssertionPreventDisplaySleepBit */ kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, kIOPMDriverAssertionReservedBit7 = 0x80 }; kIOPMDriverAssertionCPUBit *= 0x01, /! kIOPMDriverAssertionUSBExternalDeviceBit */ kIOPMDriverAssertionUSBExternalDeviceBit *= 0x04, /! kIOPMDriverAssertionBluetoothHIDDevicePairedBit */ kIOPMDriverAssertionBluetoothHIDDevicePairedBit *= 0x08, /! kIOPMDriverAssertionExternalMediaMountedBit */ kIOPMDriverAssertionExternalMediaMountedBit *= 0x10, /! kIOPMDriverAssertionReservedBit5 */ kIOPMDriverAssertionReservedBit5 *= 0x20, /! kIOPMDriverAssertionPreventDisplaySleepBit */ kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, kIOPMDriverAssertionReservedBit7 = 0x80 }; kIOPMDriverAssertionCPUBit *= 0x01, /! kIOPMDriverAssertionUSBExternalDeviceBit */ kIOPMDriverAssertionUSBExternalDeviceBit *= 0x04, /! kIOPMDriverAssertionBluetoothHIDDevicePairedBit */ kIOPMDriverAssertionBluetoothHIDDevicePairedBit *= 0x08, /! kIOPMDriverAssertionExternalMediaMountedBit */ kIOPMDriverAssertionExternalMediaMountedBit *= 0x10, /! kIOPMDriverAssertionReservedBit5 */ kIOPMDriverAssertionReservedBit5 *= 0x20, /! kIOPMDriverAssertionPreventDisplaySleepBit */
973
kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, kIOPMDriverAssertionReservedBit7 = 0x80 }; kIOPMDriverAssertionCPUBit *= 0x01, /! kIOPMDriverAssertionUSBExternalDeviceBit */ kIOPMDriverAssertionUSBExternalDeviceBit *= 0x04, /! kIOPMDriverAssertionBluetoothHIDDevicePairedBit */ kIOPMDriverAssertionBluetoothHIDDevicePairedBit *= 0x08, /! kIOPMDriverAssertionExternalMediaMountedBit */ kIOPMDriverAssertionExternalMediaMountedBit *= 0x10, /! kIOPMDriverAssertionReservedBit5 */ kIOPMDriverAssertionReservedBit5 *= 0x20, /! kIOPMDriverAssertionPreventDisplaySleepBit */ kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, kIOPMDriverAssertionReservedBit7 = 0x80 }; kIOPMDriverAssertionCPUBit *= 0x01, /! kIOPMDriverAssertionUSBExternalDeviceBit */ kIOPMDriverAssertionUSBExternalDeviceBit *= 0x04, /! kIOPMDriverAssertionBluetoothHIDDevicePairedBit */ kIOPMDriverAssertionBluetoothHIDDevicePairedBit *= 0x08, /! kIOPMDriverAssertionExternalMediaMountedBit */ kIOPMDriverAssertionExternalMediaMountedBit *= 0x10, /! kIOPMDriverAssertionReservedBit5 */ kIOPMDriverAssertionReservedBit5 *= 0x20, /! kIOPMDriverAssertionPreventDisplaySleepBit */ kIOPMDriverAssertionPreventDisplaySleepBit = 0x40, kIOPMDriverAssertionReservedBit7 = 0x80 };
Constants
kIOPMDriverAssertionBluetoothHIDDevicePairedBit
kIOPMDriverAssertionCPUBit When set, PM kernel will prefer to leave the CPU and core hardware running in "Dark Wake" state, instead of sleeping.
kIOPMDriverAssertionCPUBit
kIOPMDriverAssertionCPUBit When set, PM kernel will prefer to leave the CPU and core hardware running in "Dark Wake" state, instead of sleeping.
kIOPMDriverAssertionExternalMediaMountedBit
kIOPMDriverAssertionCPUBit When set, PM kernel will prefer to leave the CPU and core hardware running in "Dark Wake" state, instead of sleeping.
kIOPMDriverAssertionPreventDisplaySleepBit
kIOPMDriverAssertionPreventDisplaySleepBit When set, the display should remain powered on while the system's awake.
974
kIOPMDriverAssertionPreventDisplaySleepBit
kIOPMDriverAssertionCPUBit When set, PM kernel will prefer to leave the CPU and core hardware running in "Dark Wake" state, instead of sleeping.
kIOPMDriverAssertionReservedBit7
kIOPMDriverAssertionCPUBit When set, PM kernel will prefer to leave the CPU and core hardware running in "Dark Wake" state, instead of sleeping.
kIOPMDriverAssertionUSBExternalDeviceBit
kIOPMDriverAssertionCPUBit When set, PM kernel will prefer to leave the CPU and core hardware running in "Dark Wake" state, instead of sleeping.
IOPMPowerFlags
Bits are used in defining capabilityFlags, inputPowerRequirements, and outputPowerCharacter in the IOPMPowerState structure.
enum { kIOPMPowerOn = 0x00000002, kIOPMDeviceUsable = 0x00008000, kIOPMLowPower = 0x00010000, kIOPMPreventIdleSleep = 0x00000040, kIOPMSleepCapability = 0x00000004, kIOPMRestartCapability = 0x00000080, kIOPMSleep = 0x00000001, kIOPMRestart = 0x00000080, kIOPMInitialDeviceState = 0x00000100 }; typedef unsigned long IOPMPowerFlags;
Constants
kIOPMPowerOn
Indicates the device is on, requires power, and provides power. Useful as a: Capability, InputPowerRequirement, OutputPowerCharacter Available in OS X v10.1 and later. Declared in IOPM.h.
kIOPMDeviceUsable
Indicates the device is usable in this state. Useful only as a Capability Available in OS X v10.1 and later. Declared in IOPM.h.
975
kIOPMLowPower
Indicates device is in a low power state. May be bitwis-OR'd together with kIOPMDeviceUsable flag, to indicate the device is still usable. A device with a capability of kIOPMLowPower may: Require either 0 or kIOPMPowerOn from its power parent Offer either kIOPMLowPower, kIOPMPowerOn, or 0 (no power at all) to its power plane children. Useful only as a Capability, although USB drivers should consult USB family documentation for other valid circumstances to use the kIOPMLowPower bit. Available in OS X v10.5 and later. Declared in IOPM.h.
kIOPMPreventIdleSleep
In the capability field of a power state, disallows idle system sleep while the device is in that state. For example, displays and disks set this capability for their ON power state; since the system may not idle sleep while the display (and thus keyboard or mouse) or the disk is active. Useful only as a Capability. Available in OS X v10.1 and later. Declared in IOPM.h.
kIOPMSleepCapability
Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. Available in OS X v10.1 and later. Declared in IOPM.h.
kIOPMRestartCapability
Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. Available in OS X v10.1 and later. Declared in IOPM.h.
kIOPMSleep
Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. Available in OS X v10.1 and later. Declared in IOPM.h.
kIOPMRestart
Used only by certain IOKit Families (USB). Not defined or used by generic Power Management. Read your family documentation to see if you should define a powerstate using these capabilities. Available in OS X v10.1 and later. Declared in IOPM.h.
976
kIOPMInitialDeviceState
Indicates the initial power state for the device. If initialPowerStateForDomainState() returns a power state with this flag set in the capability field, then the initial power change is performed without calling the driver's setPowerState(). Available in OS X v10.7 and later. Declared in IOPM.h. Discussion These bits may be bitwise-OR'd together in the IOPMPowerState capabilityFlags field, the outputPowerCharacter field, and/or the inputPowerRequirement field. The comments clearly mark whether each flag should be used in the capabilityFlags field, outputPowerCharacter field, and inputPowerRequirement field, or all three. The value of capabilityFlags, inputPowerRequirement or outputPowerCharacter may be 0. Most drivers implement their 'OFF' state, used when asleep, by defininf each of the 3 fields as 0. The bits listed below are only the most common bits used to define a device's power states. Your device's IO family may require that your device specify other input or output power flags to interact properly. Consult family-specific documentation to determine if your IOPower plane parents or children require other power flags; they probably don't. See Also
IOPMPowerFlags (page 975)
IOPMSystemCapabilityChangeFlags
Constants
kIOPMSystemCapabilityWillChange
Indicates the system capability will change. Available in OS X v10.7 and later. Declared in IOPM.h.
977
kIOPMSystemCapabilityDidChange
Indicates the system capability has changed. Available in OS X v10.7 and later. Declared in IOPM.h.
978
IOPMKeys.h Reference
Declared in
IOPMKeys.h
Overview
IOPMKeys.h defines C strings for use accessing power management data. Note that all of these C strings must be converted to CFStrings before use. You can wrap them with the CFSTR() macro, or create a CFStringRef (that you must later CFRelease()) using CFStringCreateWithCString()
Constants
See the Overview for header-level documentation.
Defines
kIOPMAutoPowerOn "poweron" kIOPMAutoRestart "restart" kIOPMAutoShutdown "shutdown" kIOPMAutoSleep "sleep" kIOPMAutoWake "wake" kIOPMAutoWakeOrPowerOn "wakepoweron" kIOPMPowerEventAppNameKey "scheduledby" kIOPMPowerEventTimeKey "time" kIOPMPowerEventTypeKey "eventtype"
Constants
kIOPMAutoPowerOn
Value for scheduled power on from off state. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
979
kIOPMAutoRestart
Value for scheduled restart. Available in OS X v10.5 and later. Declared in IOPMKeys.h.
kIOPMAutoShutdown
Value for scheduled shutdown. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
kIOPMAutoSleep
Value for scheduled sleep. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
kIOPMAutoWake
Value for scheduled wake from sleep. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
kIOPMAutoWakeOrPowerOn
Value for scheduled wake from sleep, or power on. The system will either wake OR power on, whichever is necessary. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
kIOPMPowerEventAppNameKey
Key for the CFBundleIdentifier of the app that scheduled the power event. Value is a CFStringRef. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
kIOPMPowerEventTimeKey
Key for the time of the scheduled power event. Value is a CFDateRef. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
kIOPMPowerEventTypeKey
Key for the type of power event. Value is a CFStringRef, with the c-string value of one of the "kIOPMAuto" strings. Available in OS X v10.3 and later. Declared in IOPMKeys.h.
980
IOPMLib.h Reference
Declared in
IOPMLib.h
Overview
IOPMLib provides access to common power management facilities, like initiating system sleep, getting current idle timer values, registering for sleep/wake notifications, and preventing system sleep.
Included Headers
Functions by Task
See the Overview for header-level documentation.
ScheduledEvents
IOPMCancelScheduledPowerEvent (page 998)
Schedule the machine to wake from sleep, power on, go to sleep, or shutdown.
981
Notifications
IOAllowPowerChange (page 984)
The caller acknowledges notification of a power state change on a device it has registered for notifications for via IORegisterForSystemPower or IORegisterApp.
IOCancelPowerChange (page 985)
Disconnects the caller from an IOService after receiving power state change notifications from the IOService. (Caller must also release IORegisterApp's return io_connect_t and returned IONotificationPortRef for complete clean-up).
IODeregisterForSystemPower (page 987)
Disconnects the caller from the Root Power Domain IOService after receiving system power state change notifications. (Caller must also destroy the IONotificationPortRef returned from IORegisterForSystemPower.)
IORegisterApp (page 1006)
Connects the caller to an IOService for the purpose of receiving power state change notifications for the device controlled by the IOService.
IORegisterForSystemPower (page 1007)
Connects the caller to the Root Power Domain IOService for the purpose of receiving sleep & wake notifications for the system. Does not provide system shutdown and restart notifications.
IOSystemLoadAdvisory
IOCopySystemLoadAdvisoryDetailed (page 986)
Indicates how user activity, battery level, and thermal level each contribute to the overall "SystemLoadAdvisory" level. In the future, this combined level may represent new levels as well.
IOGetSystemLoadAdvisory (page 987)
Returns a hint about whether now would be a good time to perform time-insensitive work.
982
Assertions
IOPMAssertionCopyProperties (page 988)
Declares that the user is active on the system. This causes the display to power on and postpone display sleep up to the user's display sleep Energy Saver settings. If you prefer to hold the display awake for a longer period and you know how long you'd like to hold it, consider taking assertion kIOPMAssertionTypePreventUserIdleDisplaySleep using IOPMAssertionCreateWithDescription (page 989) API instead.
IOPMAssertionRelease (page 995)
Miscellaneous
IOPMAssertionDictionaryKeys (page 994)
983
Use as AssertionType argument to IOPMAssertionCreate (page 989). The idle display will not sleep when enabled, and consequently the system will not idle sleep.
IOPMCopyBatteryInfo (page 1000)
Retrieves the current value of one of the aggressiveness factors in IOKit Power Management.
IOPMSetAggressiveness (page 1004)
Functions
IOAllowPowerChange
The caller acknowledges notification of a power state change on a device it has registered for notifications for via IORegisterForSystemPower or IORegisterApp.
Parameters
kernelPort
A copy of the notification ID which came as part of the power state change notification being acknowledged. Return Value Returns kIOReturnSuccess or an error condition if request failed.
984
Discussion Must be used when handling kIOMessageCanSystemSleep and kIOMessageSystemWillSleep messages from IOPMrootDomain system power. The caller should not call IOAllowPowerChange in response to any messages except for these two. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IOCancelPowerChange
The caller denies an idle system sleep power state change.
Parameters
kernelPort
A copy of the notification ID which came as part of the power state change notification being acknowledged. Return Value Returns kIOReturnSuccess or an error condition if request failed. Discussion Should only called in response to kIOMessageCanSystemSleep messages from IOPMrootDomain. IOCancelPowerChange has no meaning for responding to kIOMessageSystemWillSleep (which is non-abortable) or any other messages. When an app responds to a kIOMessageCanSystemSleep message by calling IOCancelPowerChange, the app vetoes the idle sleep request. The system will stay awake. The idle timer will elapse again after a period of inactivity, and the system will send out the same kIOMessageCanSystemSleep message, and interested applications will respond gain. Availability Available in OS X v10.0 and later.
985
Declared in
IOPMLib.h
IOCopySystemLoadAdvisoryDetailed
Indicates how user activity, battery level, and thermal level each contribute to the overall "SystemLoadAdvisory" level. In the future, this combined level may represent new levels as well.
Return Value Returns a CFDictionaryRef, or NULL on error. Caller must release the returned dictionary. Discussion See dictionary keys defined above. Availability Available in OS X v10.6 and later. Declared in
IOPMLib.h
IODeregisterApp
Disconnects the caller from an IOService after receiving power state change notifications from the IOService. (Caller must also release IORegisterApp's return io_connect_t and returned IONotificationPortRef for complete clean-up).
Parameters
notifier
An object from IORegisterApp. Return Value Returns kIOReturnSuccess or an error condition if request failed. Availability Available in OS X v10.0 and later.
986
Declared in
IOPMLib.h
IODeregisterForSystemPower
Disconnects the caller from the Root Power Domain IOService after receiving system power state change notifications. (Caller must also destroy the IONotificationPortRef returned from IORegisterForSystemPower.)
Parameters
notifier
The object returned from IORegisterForSystemPower. Return Value Returns kIOReturnSuccess or an error condition if request failed. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IOGetSystemLoadAdvisory
Returns a hint about whether now would be a good time to perform time-insensitive work.
Return Value IOSystemLoadAdvisoryLevel - one of: kIOSystemLoadAdvisoryLevelGreat - A Good time to perform time-insensitive work. kIOSystemLoadAdvisoryLevelOK - An OK time to perform time-insensitive work. kIOSystemLoadAdvisoryLevelBad - A Bad time to perform time-insensitive work. Discussion Based on user and system load, IOGetSystemLoadAdvisory determines "better" and "worse" times to run optional or time-insensitive CPU or disk work.
987
Applications may use this result to avoid degrading the user experience. If it is a "Bad" or "OK" time to perform work, applications should slow down and perform work less aggressively. There is no guarantee that the system will ever be in "Great" condition to perform work - all essential work must still be performed even in "Bad", or "OK" times. Completely optional work, such as updating caches, may be postponed indefinitely. Note: You may more efficiently read the SystemLoadAdvisory level using notify_get_state() instead of IOGetSystemLoadAdvisory. The results are identical. notify_get_state() requires that you pass the token argument received by registering for SystemLoadAdvisory notifications. Availability Available in OS X v10.6 and later. Declared in
IOPMLib.h
IOPMAssertionCopyProperties
Copies details about an IOPMAssertion
Parameters
theAssertion
The assertion ID to copy info about. Return Value A dictionary describing the assertion with keys specified in See IOPMAssertionDictionaryKeys. It's the caller's responsibility to release this dictionary. Discussion Returns a dictionary describing an IOPMAssertion's specifications and current state. Availability Available in OS X v10.7 and later. Declared in
IOPMLib.h
988
IOPMAssertionCreate
Dynamically requests a system behavior from the power management system.
IOReturn IOPMAssertionCreate( CFStringRef AssertionType, IOPMAssertionLevel AssertionLevel, IOPMAssertionID *AssertionID) __OSX_AVAILABLE_BUT_DEPRECATED ( __MAC_10_5,__MAC_10_6,__IPHONE_2_0, __IPHONE_2_1);
Parameters
AssertionType
On success, a unique id will be returned in this parameter. Return Value Returns kIOReturnSuccess on success, any other return indicates PM could not successfully activate the specified assertion. Discussion No special privileges necessary to make this call - any process may activate a power assertion. Availability Available in OS X v10.5 and later. Deprecated in OS X v10.6. Declared in
IOPMLib.h
IOPMAssertionCreateWithDescription
IOReturn IOPMAssertionCreateWithDescription( CFStringRef AssertionType, CFStringRef Name, CFStringRef Details, CFStringRef HumanReadableReason, CFStringRef LocalizationBundlePath, CFTimeInterval Timeout,
989
Parameters
AssertionType
A CFString value to correspond to key kIOPMAssertionNameKey. Caller must specify this argument.
Details
A CFString value to correspond to key kIOPMAssertionDetailsKey. Caller my pass NULL, but it helps power users and administrators identify the reasons for this assertion.
HumanReadableReason
A CFString value to correspond to key kIOPMAssertionHumanReadableReasonKey. Caller may pass NULL, but if it's specified OS X may display it to users to describe the active assertions on their system.
LocalizationBundlePath
A CFString value to correspond to key kIOPMAssertionLocalizationBundlePathKey. This bundle path should include a localization for the string HumanReadableReason Caller may pass NULL, but this argument is required if caller specifies HumanReadableReason
Timeout
Specifies a timeout action. Caller my pass NULL. If a timeout is specified but a TimeoutAction is not, the default timeout action is kIOPMAssertionTimeoutActionTurnOff
AssertionID
(Output) On successful return, contains a unique reference to a PM assertion. Return Value kIOReturnSuccess, or another IOKit return code on error. Discussion Creates an IOPMAssertion. This is the preferred API to call to create an assertion. It allows the caller to specify the Name, Details, and HumanReadableReason at creation time. There are other keys that can further describe an assertion, but most developers don't need to use them. Use IOPMAssertionSetProperties or IOPMAssertionCreateWithProperties (page 992) if you need to specify properties that aren't available here. Availability Available in OS X v10.7 and later.
990
Declared in
IOPMLib.h
IOPMAssertionCreateWithName
Dynamically requests a system behavior from the power management system.
IOReturn IOPMAssertionCreateWithName( CFStringRef AssertionType, IOPMAssertionLevel AssertionLevel, CFStringRef AssertionName, IOPMAssertionID *AssertionID) AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER;
Parameters
AssertionType
A string that describes the name of the caller and the activity being handled by this assertion (e.g. "Mail Compacting Mailboxes"). Name may be no longer than 128 characters.
AssertionID
On success, a unique id will be returned in this parameter. Return Value Returns kIOReturnSuccess on success, any other return indicates PM could not successfully activate the specified assertion. Discussion No special privileges are necessary to make this call - any process may activate a power assertion. Caller must specify an AssertionName - NULL is not a valid input. Availability Available in OS X v10.6 and later. Declared in
IOPMLib.h
991
IOPMAssertionCreateWithProperties
Creates an IOPMAssertion with more flexibility than IOPMAssertionCreateWithDescription (page 989).
Parameters
AssertionProperties
(Output) On successful return, contains a unique reference to a PM assertion. Discussion Create a new PM assertion - the caller must specify the type of assertion, initial level, and its properties as IOPMAssertionDictionaryKeys keys in the AssertionProperties dictionary. The following keys are recommend and/or required to be specified in the AssertionProperties dictionary argument.
REQUIRED: kIOPMAssertionTypeKey define the assertion type. REQUIRED: kIOPMAssertionValueKey define an inital value. REQUIRED: kIOPMAssertionNameKey Caller must describe the name for the activity that requires the change in behavior provided by the assertion. OPTIONAL: kIOPMAssertionDetailsKey Caller may describe context-specific data about the assertion. OPTIONAL: kIOPMAssertionHumanReadableReasonKey Caller may describe the reason for creating the assertion in a localizable CFString. This should be a human readable phrase that describes the actions the calling process is taking while the assertion is held, like "Downloading TV episodes", or "Compiling Projects" OPTIONAL: kIOPMAssertionLocalizationBundlePathKey Caller may provide its bundle's path, where OS X can localize for GUI display the CFString specified by kIOPMAssertionHumanReadableReasonKey. OPTIONAL: kIOPMAssertionPlugInIDKey if the caller is a plugin with a different identity than the process it's loaded in. OPTIONAL: kIOPMAssertionFrameworkIDKey if the caller is a framework acting on behalf of a process. OPTIONAL: The caller may specify a timeout.
992
Declared in
IOPMLib.h
IOPMAssertionDeclareUserActivity
Declares that the user is active on the system. This causes the display to power on and postpone display sleep up to the user's display sleep Energy Saver settings. If you prefer to hold the display awake for a longer period and you know how long you'd like to hold it, consider taking assertion kIOPMAssertionTypePreventUserIdleDisplaySleep using IOPMAssertionCreateWithDescription (page 989) API instead.
IOReturn IOPMAssertionDeclareUserActivity( CFStringRef AssertionName, IOPMUserActiveType userType, IOPMAssertionID *AssertionID) AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER; introduced in 10.7.3 */
/* This API is
Parameters
AssertionName
A string that describes the name of the caller and the activity being handled by this assertion (e.g. "Mail Compacting Mailboxes"). Name may be no longer than 128 characters.
userType
This parameter specifies if the active user is located locally in front of the system or connected to the system over the network. Various components of the system are maintained at different power levels depending on user location.
AssertionID
On Success, unique id will be returned in this parameter. Caller may call this function again with the unique id retured previously to report continous user activity. The unique id returned by this function may change on each call depending on how frequently this function call is repeated and the current display sleep timer value. If you make this call more than once, track the returned value for assertionID, and pass it in as an argument on each call. Return Value Returns kIOReturnSuccess on success, any other return indicates PM could not successfully activate the specified assertion. Discussion No special privileges are necessary to make this call - any process may call this API. Caller must specify an AssertionName - NULL is not a valid input.
993
IOPMAssertionDictionaryKeys
/*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */
kIOPMAssertionTimeoutKey CFSTR("TimeoutSeconds")
kIOPMAssertionTimeoutActionKey CFSTR("TimeoutAction")
kIOPMAssertionTimeoutActionLog CFSTR("TimeoutActionLog")
kIOPMAssertionTimeoutActionTurnOff CFSTR("TimeoutActionTurnOff")
kIOPMAssertionTimeoutActionRelease CFSTR("TimeoutActionRelease")
kIOPMAssertionRetainCountKey CFSTR("RetainCount")
kIOPMAssertionNameKey CFSTR("AssertName")
kIOPMAssertionDetailsKey CFSTR("Details")
kIOPMAssertionHumanReadableReasonKey CFSTR("HumanReadableReason")
kIOPMAssertionLocalizationBundlePathKey CFSTR("BundlePath")
kIOPMAssertionFrameworkIDKey CFSTR("FrameworkBundleID")
kIOPMAssertionPlugInIDKey CFSTR("PlugInBundleID")
994
IOPMAssertionRelease
Decrements the assertion's retain count.
Parameters
AssertionID
The assertion_id, returned from IOPMAssertionCreate, to cancel. Return Value Returns kIOReturnSuccess on success. Discussion If the retain count becomes zero, then this also frees and deactivates the assertion referred to by assertionID Calls to IOPMAssertionCreate (page 989) and IOPMAssertionRelease (page 995) must each be paired with calls to IOPMAssertionRelease.
995
IOPMAssertionRetain
Increments the assertion's retain count.
Parameters
theAssertion
The assertion ID to retain. Discussion Increments the retain count according to CoreFoundation style retain/release semantics. Retain count can be inspected in the assertion's info dictionary at key kIOPMAssertionRetainCountKey Availability Available in OS X v10.7 and later. Declared in
IOPMLib.h
IOPMAssertionSetProperty
Sets a property in the assertion.
IOReturn IOPMAssertionSetProperty( IOPMAssertionID theAssertion, CFStringRef theProperty, CFTypeRef theValue) __OSX_AVAILABLE_STARTING( __MAC_10_7, __IPHONE_3_2);
Parameters
theAssertion
996
theProperty
The property to set. It must be a CFNumber or CFString, as specified by the property key named in whichProperty. Return Value Returns kIOReturnNotPriviliged if the caller doesn't have permission to modify this assertion. Returns kIOReturnNotFound if PM can't locate this assertion. Returns kIOReturnError upon an unidentified error. Returns kIOReturnSuccess otherwise. Discussion Only the process that created an assertion may change its properties. Availability Available in OS X v10.7 and later. Declared in
IOPMLib.h
IOPMAssertionTypes
Use as AssertionType argument to IOPMAssertionCreate (page 989). The idle display will not sleep when enabled, and consequently the system will not idle sleep.
/*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define
kIOPMAssertionTypePreventUserIdleSystemSleep CFSTR("PreventUserIdleSystemSleep")
kIOPMAssertionTypePreventUserIdleDisplaySleep CFSTR("PreventUserIdleDisplaySleep")
kIOPMAssertionTypePreventSystemSleep CFSTR("PreventSystemSleep")
kIOPMAssertionTypeNoIdleSleep CFSTR("NoIdleSleepAssertion")
kIOPMAssertionTypeNoDisplaySleep CFSTR("NoDisplaySleepAssertion")
997
Discussion When asserted and set to level kIOPMAssertionLevelOn, the system will prefer to enter the Dark Wake state, or remain in Dark Wake if already there, rather than go to sleep. Assertions are just suggestions to the OS, and the OS can only honor them to the best of its ability. In the case of low power or a thermal emergency, the system may sleep anyway despite the assertion. An assertion must publish the AssertionType in its assertion properties dictionary. The AssertionType should be a key in the properties dictionary, with a value of a CFNumber containing the kCFNumberIntegerType value kIOPMAssertionLevelOff or kIOPMAssertionLevelOn. See Also
kIOPMAssertionTypePreventUserIdleSystemSleep kIOPMAssertionTypePreventUserIdleDisplaySleep kIOPMAssertionTypePreventSystemSleep kIOPMAssertionTypeNoIdleSleep kIOPMAssertionTypeNoDisplaySleep
IOPMCancelScheduledPowerEvent
Cancel a previously scheduled power event.
Parameters
time_to_wake
Type to cancel Return Value kIOReturnSuccess on success, otherwise on failure Discussion Arguments mirror those to IOPMSchedulePowerEvent. All arguments must match the original arguments from when the power on was scheduled. Must be called as root.
998
IOPMCopyAssertionsByProcess
Returns a dictionary listing all assertions, grouped by their owning process.
Parameters
AssertionsByPID
On success, this returns a dictionary of assertions per process. At the top level, keys to the CFDictionary are pids stored as CFNumbers (kCFNumberIntType). The value associated with each CFNumber pid is a CFArray of active assertions. Each entry in the CFArray is an assertion represented as a CFDictionary. See the keys kIOPMAssertionTypeKey and kIOPMAssertionLevelKey. Caller must CFRelease() this dictionary when done. Return Value Returns kIOReturnSuccess on success. Discussion Notes: One process may have multiple assertions. Several processes may have asserted the same assertion to different levels. Availability Available in OS X v10.5 and later. Declared in
IOPMLib.h
IOPMCopyAssertionsStatus
Returns a list of available assertions and their system-wide levels.
999
Parameters
AssertionsStatus
On success, this returns a CFDictionary of all assertions currently available. The keys in the dictionary are the assertion types, and the value of each is a CFNumber that represents the aggregate level for that assertion. Caller must CFRelease() this dictionary when done. Return Value Returns kIOReturnSuccess on success. Discussion The system-wide level is the maximum of all individual assertions' levels. Availability Available in OS X v10.5 and later. Declared in
IOPMLib.h
IOPMCopyBatteryInfo
Request raw battery data from the system.
Parameters
masterPort
A CFArray of CFDictionaries containing raw battery data. Return Value Returns kIOReturnSuccess or an error condition if request failed. Discussion WARNING! IOPMCoyBatteryInfo is unsupported on ALL Intel CPU based systems. For PPC CPU based systems, it remains not recommended. For almost all purposes, developers should use the richer IOPowerSources API (with change notifications) instead of using IOPMCopyBatteryInfo. Keys to decipher IOPMCopyBatteryInfo's return CFArray exist in IOPM.h.
1000
IOPMCopyCPUPowerStatus
Copy status of all current CPU power levels.
Parameters
cpuPowerStatus
Upon success, a pointer to a dictionary defining CPU power; otherwise NULL. Pointer will be populated with a newly created dictionary upon successful return. Caller must release dictionary. Return Value kIOReturnSuccess, or other error report. Returns kIOReturnNotFound if CPU PowerStatus has not been published. Discussion The returned dictionary may define some of these keys, as defined in IOPM.h: kIOPMCPUPowerLimitProcessorSpeedKey - kIOPMCPUPowerLimitProcessorCountKey kIOPMCPUPowerLimitSchedulerTimeKey Availability Available in OS X v10.7 and later. Declared in
IOPMLib.h
IOPMCopyScheduledPowerEvents
List all scheduled system power events
1001
Return Value A CFArray of CFDictionaries of power events. The CFArray must be released by the caller. NULL if there are no scheduled events. Discussion Returns a CFArray of CFDictionaries of power events. Each CFDictionary contains keys for CFSTR(kIOPMPowerEventTimeKey), CFSTR(kIOPMPowerEventAppNameKey), and CFSTR(kIOPMPowerEventTypeKey). Availability Available in OS X v10.3 and later. Declared in
IOPMLib.h
IOPMFindPowerManagement
Finds the Root Power Domain IOService.
Parameters
master_device_port
Just pass in MACH_PORT_NULL for master device port. Return Value Returns a io_connect_t handle on the root domain. Must be released with IOServiceClose() when done. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IOPMGetAggressiveness
Retrieves the current value of one of the aggressiveness factors in IOKit Power Management.
1002
Parameters
fb
Points to where to store the retrieved value of the aggressiveness factor. Return Value Returns kIOReturnSuccess or an error condition if request failed. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IOPMGetThermalWarningLevel
Get thermal warning level of the system.
Return Value kIOReturnSuccess, or other error report. Returns kIOReturnNotFound if thermal warning level has not been published. Availability Available in OS X v10.7 and later. Declared in
IOPMLib.h
IOPMSchedulePowerEvent
Schedule the machine to wake from sleep, power on, go to sleep, or shutdown.
1003
Parameters
time_to_wake
The type of power on you desire, either wake from sleep or power on. Choose from: CFSTR(kIOPMAutoWake) == wake machine, CFSTR(kIOPMAutoPowerOn) == power on machine, CFSTR(kIOPMAutoWakeOrPowerOn) == wake or power on, CFSTR(kIOPMAutoSleep) == sleep machine, CFSTR(kIOPMAutoShutdown) == power off machine, CFSTR(kIOPMAutoRestart) == restart the machine. Return Value kIOReturnSuccess on success, otherwise on failure Discussion This event will be added to the system's queue of power events and stored persistently on disk. The sleep and shutdown events present a graphical warning and allow a console user to cancel the event. Must be called as root. Availability Available in OS X v10.3 and later. Declared in
IOPMLib.h
IOPMSetAggressiveness
Sets one of the aggressiveness factors in IOKit Power Management.
IOReturn IOPMSetAggressiveness ( io_connect_t fb, unsigned long type, unsigned long aggressiveness ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
1004
Parameters
fb
New value of the aggressiveness factor. Return Value Returns kIOReturnSuccess or an error condition if request failed. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IOPMSleepEnabled
Tells whether the system supports full sleep, or just doze
Return Value Returns true if the system supports sleep, false if some hardware prevents full sleep. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IOPMSleepSystem
Request that the system initiate sleep.
1005
Parameters
fb
Port used to communicate to the kernel, from IOPMFindPowerManagement. Return Value Returns kIOReturnSuccess or an error condition if request failed. Discussion For security purposes, caller must be root or the console user. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IORegisterApp
Connects the caller to an IOService for the purpose of receiving power state change notifications for the device controlled by the IOService.
io_connect_t IORegisterApp( void *refcon, io_service_t theDriver, IONotificationPortRef *thePortRef, IOServiceInterestCallback callback, io_object_t *notifier ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
Parameters
refcon
Data returned on power state change notifications and not used by the kernel.
theDriver
Pointer to a port on which the caller will receive power state change notifications. The port is allocated by the calling application.
callback
Pointer to a notifier which caller must keep and pass to subsequent call to IODeregisterApp.
1006
Return Value Returns a io_connect_t session for the IOService or MACH_PORT_NULL if request failed. Caller must close return value via IOServiceClose() after calling IODeregisterApp on the notifier argument. Discussion IORegisterApp requires that the IOService of interest implement an IOUserClient. In addition, that IOUserClient must implement the allowPowerChange and cancelPowerChange methods defined in IOPMLibDefs.h. If you're interested in receiving power state notifications from a device without an IOUserClient, try using IOServiceAddInterestNotification with interest type gIOGeneralInterest instead. Availability Available in OS X v10.0 and later. Declared in
IOPMLib.h
IORegisterForSystemPower
Connects the caller to the Root Power Domain IOService for the purpose of receiving sleep & wake notifications for the system. Does not provide system shutdown and restart notifications.
io_connect_t IORegisterForSystemPower ( void *refcon, IONotificationPortRef *thePortRef, IOServiceInterestCallback callback, io_object_t *notifier ) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
Parameters
refcon
Caller may provide data to receive s an argument to 'callback' on power state changes.
thePortRef
On return, thePortRef is a pointer to an IONotificationPortRef, which will deliver the power notifications. The port is allocated by this function and must be later released by the caller (after calling IODeregisterForSystemPower (page 987)). The caller should also enable IONotificationPortRef by calling IONotificationPortGetRunLoopSource (page 890), or IONotificationPortGetMachPort (page 889), or IONotificationPortSetDispatchQueue (page 891).
callback
1007
notifier
On success, returns a pointer to a unique notifier which caller must keep and pass to a subsequent call to IODeregisterForSystemPower. Return Value Returns a io_connect_t session for the IOPMrootDomain or MACH_PORT_NULL if request failed. Caller must close return value via IOServiceClose() after calling IODeregisterForSystemPower on the notifier argument. Discussion Provides sleep/wake notifications to applications. Requires that applications acknowledge some, but not all notifications. Register for sleep/wake notifications will deliver these messages over the sleep/wake lifecycle: - kIOMessageSystemWillSleep is delivered at the point the system is initiating a non-abortable sleep. Callers MUST acknowledge this event by calling IOAllowPowerChange (page 984). If a caller does not acknowledge the sleep notification, the sleep will continue anyway after a 30 second timeout (resulting in bad user experience). Delivered before any hardware is powered off. - kIOMessageSystemWillPowerOn is delivered at early wakeup time, before most hardware has been powered on. Be aware that any attempts to access disk, network, the display, etc. may result in errors or blocking your process until those resources become available. Caller must NOT acknowledge kIOMessageSystemWillPowerOn; the caller must simply return from its handler. - kIOMessageSystemHasPoweredOn is delivered at wakeup completion time, after all device drivers and hardware have handled the wakeup event. Expect this event 1-5 or more seconds after initiating system wakeup. Caller must NOT acknowledge kIOMessageSystemHasPoweredOn; the caller must simply return from its handler. - kIOMessageCanSystemSleep indicates the system is pondering an idle sleep, but gives apps the chance to veto that sleep attempt. Caller must acknowledge kIOMessageCanSystemSleep by calling IOAllowPowerChange (page 984) or IOCancelPowerChange (page 985). Calling IOAllowPowerChange will not veto the sleep; any app that calls IOCancelPowerChange will veto the idle sleep. A kIOMessageCanSystemSleep notification will be followed up to 30 seconds later by a kIOMessageSystemWillSleep message. or a kIOMessageSystemWillNotSleep message. - kIOMessageSystemWillNotSleep is delivered when some app client has vetoed an idle sleep request. kIOMessageSystemWillNotSleep may follow a kIOMessageCanSystemSleep notification, but will not otherwise be sent. Caller must NOT acknowledge kIOMessageSystemWillNotSleep; the caller must simply return from its handler. To deregister for sleep/wake notifications, the caller must make two calls, in this order: - Call IODeregisterForSystemPower with the 'notifier' argument returned here. - Then call IONotificationPortDestroy passing the 'thePortRef' argument returned here.
1008
Data Types
See the Overview for header-level documentation.
IOPMAssertionID
Type for AssertionID arguments to IOPMAssertionCreateWithProperties (page 992) and
IOPMAssertionRelease (page 995)
IOPMAssertionLevel
Type for AssertionLevel argument to IOPMAssertionCreate
Discussion Possible values for IOPMAssertionLevel are kIOPMAssertionLevelOff and kIOPMAssertionLevelOn Availability Available in OS X v10.5 and later. Declared in
IOPMLib.h
1009
IOSystemLoadAdvisoryLevel
Return type for IOGetSystemLoadAdvisory
Discussion Value is one of kIOSystemLoadAdvisoryLevelGreat, kIOSystemLoadAdvisoryLevelOK, or kIOSystemLoadAdvisoryLevelBad. Availability Available in OS X v10.6 and later. Declared in
IOPMLib.h
Constants
See the Overview for header-level documentation.
Defines
/*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */
kIOPMAssertionDetailsKey CFSTR("Details")
kIOPMAssertionFrameworkIDKey CFSTR("FrameworkBundleID")
kIOPMAssertionHumanReadableReasonKey CFSTR("HumanReadableReason")
kIOPMAssertionLevelKey CFSTR("AssertLevel")
kIOPMAssertionLocalizationBundlePathKey CFSTR("BundlePath")
kIOPMAssertionNameKey CFSTR("AssertName")
1010
#define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define /*! */ #define #define #define #define #define #define #define #define
kIOPMAssertionPlugInIDKey CFSTR("PlugInBundleID")
kIOPMAssertionRetainCountKey CFSTR("RetainCount")
kIOPMAssertionTimeoutActionKey CFSTR("TimeoutAction")
kIOPMAssertionTimeoutActionLog CFSTR("TimeoutActionLog")
kIOPMAssertionTimeoutActionRelease CFSTR("TimeoutActionRelease")
kIOPMAssertionTimeoutActionTurnOff CFSTR("TimeoutActionTurnOff")
kIOPMAssertionTimeoutKey CFSTR("TimeoutSeconds")
kIOPMAssertionTypeKey CFSTR("AssertType")
kIOPMAssertionTypeNoDisplaySleep CFSTR("NoDisplaySleepAssertion")
kIOPMAssertionTypeNoIdleSleep CFSTR("NoIdleSleepAssertion")
kIOPMAssertionTypePreventSystemSleep CFSTR("PreventSystemSleep")
kIOPMAssertionTypePreventUserIdleDisplaySleep CFSTR("PreventUserIdleDisplaySleep")
kIOPMAssertionTypePreventUserIdleSystemSleep CFSTR("PreventUserIdleSystemSleep") kIOPMCPUPowerNotificationKey "com.apple.system.power.CPU" kIOPMThermalWarningNotificationKey "com.apple.system.power.thermal_warning" kIOSystemLoadAdvisoryBatteryLevelKey CFSTR("BatteryLevel") kIOSystemLoadAdvisoryCombinedLevelKey CFSTR("CombinedLevel") kIOSystemLoadAdvisoryNotifyName "com.apple.system.powermanagement.SystemLoadAdvisory" kIOSystemLoadAdvisoryThermalLevelKey CFSTR("ThermalLevel") kIOSystemLoadAdvisoryUserLevelKey CFSTR("UserLevel")
1011
Constants
kIOPMAssertionDetailsKey
The CFDictionary key for assertion name. Setting this key is required when you're creating an assertion.
kIOPMAssertionNameKey describes the the activity the assertion is protecting. The creator should
The assertion name is separate from the assertion type's behavior - specify a CFString like "Checking mail" or "Compiling" that describes the task that this assertion protects. The CFString you associate with this key does not have to be localizable (OS X will not attempt to localize it.) Describe your assertion as thoroughly as possible. See these other keys that can you can also set to add explanation to an assertion: OPTIONAL kIOPMAssertionDetailsKey OPTIONAL kIOPMAssertionHumanReadableReasonKey OPTIONAL
kIOPMAssertionLocalizationBundlePathKey
Specify if the assertion creator is a framework. If the code that creates the assertion resides in a framework or library, the caller should specify a CFBundleIdentifier, as a CFString, identifying that bundle here. This info helps developers and administrators determine the source of an assertion. This key may be specified in the dictionary passed to IOPMAssertionCreateWithProperties (page 992). This key may be present in the dictionary returned from IOPMAssertionCopyProperties (page 988). Available in OS X v10.7 and later. Declared in IOPMLib.h.
1012
kIOPMAssertionHumanReadableReasonKey
Optional key that provides a localizable string for OS X to display PM Assertions in the GUI. The caller should specify this string in IOPMAssertionCreateWithProperties (page 992). If present, OS X may display this string, localized to the user's language, to explain changes in system behavior caused by the assertion. If set, the caller must also specify a bundle path for the key kIOPMAssertionLocalizationBundlePathKey The bundle at that path should contain localization info for the specified string. This key may be specified in the dictionary passed to IOPMAssertionCreateWithProperties (page 992). This key may be present in the dictionary returned from IOPMAssertionCopyProperties (page 988). Describe your assertion as thoroughly as possible. See these other keys that can you can set to add explanation to an assertion: REQUIRED kIOPMAssertionNameKey OPTIONAL
kIOPMAssertionDetailsKey
The CFDictionary key for assertion level in an assertion info dictionary. The value for this key will be a CFNumber, kCFNumberIntType with value kIOPMAssertionLevelOff or kIOPMAssertionLevelOn. The level reflects the assertion's level set at creation, or adjusted via
IOPMAssertionSetLevel
Refers to a CFURL, as a CFString, identifying the path to the caller's bundle, which contains localization info. The bundle must contain localizations for kIOPMAssertionHumanReadableReasonKey This key may be specified in the dictionary passed to IOPMAssertionCreateWithProperties (page 992). This key may be present in the dictionary returned from IOPMAssertionCopyProperties (page 988). Available in OS X v10.7 and later. Declared in IOPMLib.h.
1013
kIOPMAssertionNameKey
The CFDictionary key for assertion name. Setting this key is required when you're creating an assertion.
kIOPMAssertionNameKey describes the the activity the assertion is protecting. The creator should
The assertion name is separate from the assertion type's behavior - specify a CFString like "Checking mail" or "Compiling" that describes the task that this assertion protects. The CFString you associate with this key does not have to be localizable (OS X will not attempt to localize it.) Describe your assertion as thoroughly as possible. See these other keys that can you can also set to add explanation to an assertion: OPTIONAL kIOPMAssertionDetailsKey OPTIONAL kIOPMAssertionHumanReadableReasonKey OPTIONAL
kIOPMAssertionLocalizationBundlePathKey
Specify if the assertion creator is a plugin. If the code that creates the assertion resides in a plugin, the caller should specify a CFBundleIdentifier, as a CFString, identifying the plugin's bundle here. This info helps developers and administrators determine the source of an assertion. This key may be specified in the dictionary passed to IOPMAssertionCreateWithProperties (page 992). This key may be present in the dictionary returned from IOPMAssertionCopyProperties (page 988). Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMAssertionRetainCountKey
A potential value for kIOPMAssertionTimeoutActionKey kIOPMAssertionRetainCountKey reflects the CoreFoundation-style retain count on this assertion. Creating or retaining an assertion increments its retain count. Release an assertion decrements its retain count. When the retain count decrements to zero, the OS will destroy the object. This key can be found in the dictionary returned from IOPMAssertionCopyProperties (page 988). Available in OS X v10.7 and later. Declared in IOPMLib.h.
1014
kIOPMAssertionTimeoutActionKey
Specifies the action to take upon timeout expiration. Specifying the timeout action only has meaning if you also specify an kIOPMAssertionTimeoutKey If the caller does not specify a timeout action, the default action is
kIOPMAssertionTimeoutActionTurnOff
This key may be specified in the dictionary passed to IOPMAssertionCreateWithProperties (page 992). This key may be present in the dictionary returned from IOPMAssertionCopyProperties (page 988). Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMAssertionTimeoutActionLog
A potential value for kIOPMAssertionTimeoutActionKey When this timeout action is specified, PM will log the timeout event but will not turn off or affect the setting of the assertion in any way. Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMAssertionTimeoutActionRelease
A potential value for kIOPMAssertionTimeoutActionKey When a timeout expires with this action, Power Management will log the timeout event, and will release the assertion. Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMAssertionTimeoutActionTurnOff
A potential value for kIOPMAssertionTimeoutActionKey When a timeout expires with this action, Power Management will log the timeout event, and will set the assertion's level to kIOPMAssertionLevelOff. Available in OS X v10.7 and later. Declared in IOPMLib.h.
1015
kIOPMAssertionTimeoutKey
kIOPMAssertionTimeoutKey specifies an outer bound, in seconds, that this assertion should be asserted. If your application hangs, or is unable to complete its assertion task in a reasonable amount of time, specifying a timeout allows PM to disable your assertion so the system can resume normal activity. Once a timeout with the kIOPMAssertionTimeoutActionTurnOff assertion fires, the level will be set to kIOPMAssertionTimeoutActionTurnOff. The assertion may be re-armed by calling IOPMAssertionSetLevel. This key may be specified in the dictionary passed to IOPMAssertionCreateWithProperties (page 992). This key may be present in the dictionary returned from IOPMAssertionCopyProperties (page 988). Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMAssertionTypeKey
The CFDictionary key for assertion type in an assertion info dictionary. The value for this key will be a CFStringRef, with the value of the assertion type specified at creation time. Note that OS X may substitute a support assertion type string if the caller specifies a deprecated assertion type; in that case the value for this key could differ from the caller-provided assertion type. Available in OS X v10.5 and later. Declared in IOPMLib.h.
kIOPMAssertionTypeNoDisplaySleep
Use as AssertionType argument to IOPMAssertionCreate (page 989). The idle display will not sleep when enabled, and consequently the system will not idle sleep. When asserted and set to level kIOPMAssertionLevelOn, the system will prefer to enter the Dark Wake state, or remain in Dark Wake if already there, rather than go to sleep. Assertions are just suggestions to the OS, and the OS can only honor them to the best of its ability. In the case of low power or a thermal emergency, the system may sleep anyway despite the assertion. An assertion must publish the AssertionType in its assertion properties dictionary. The AssertionType should be a key in the properties dictionary, with a value of a CFNumber containing the kCFNumberIntegerType value kIOPMAssertionLevelOff or kIOPMAssertionLevelOn. Available in OS X v10.5 and later. Declared in IOPMLib.h.
1016
kIOPMAssertionTypeNoIdleSleep
Pass as the AssertionType argument to IOPMAssertionCreate (page 989). The system will not idle sleep when enabled (display may sleep). Note that the system may sleep for other reasons. When asserted and set to level kIOPMAssertionLevelOn, the system will prefer to enter the Dark Wake state, or remain in Dark Wake if already there, rather than go to sleep. Assertions are just suggestions to the OS, and the OS can only honor them to the best of its ability. In the case of low power or a thermal emergency, the system may sleep anyway despite the assertion. An assertion must publish the AssertionType in its assertion properties dictionary. The AssertionType should be a key in the properties dictionary, with a value of a CFNumber containing the kCFNumberIntegerType value kIOPMAssertionLevelOff or kIOPMAssertionLevelOn. Available in OS X v10.5 and later. Declared in IOPMLib.h.
kIOPMAssertionTypePreventSystemSleep
Prevents the system from sleeping and allows the system to reside in Dark Wake for an arbitrary length of time. When asserted and set to level kIOPMAssertionLevelOn, the system will prefer to enter the Dark Wake state, or remain in Dark Wake if already there, rather than go to sleep. Assertions are just suggestions to the OS, and the OS can only honor them to the best of its ability. In the case of low power or a thermal emergency, the system may sleep anyway despite the assertion. An assertion must publish the AssertionType in its assertion properties dictionary. The AssertionType should be a key in the properties dictionary, with a value of a CFNumber containing the kCFNumberIntegerType value kIOPMAssertionLevelOff or kIOPMAssertionLevelOn. Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMAssertionTypePreventUserIdleDisplaySleep
Prevents the display from dimming automatically. When asserted and set to level kIOPMAssertionLevelOn, will prevent the display from turning off due to a period of idle user activity. Note that the display may still sleep from other reasons, like a user closing a portable's lid or the machine sleeping. If the display is already off, this assertion does not light up the display. If display needs to be turned on, then consider calling function IOPMAssertionDeclareUserActivity (page 993). While the display is prevented from dimming, the system cannot go into idle sleep. This assertion does not put the system into Dark Wake. A caller publish the AssertionType in its assertion properties dictionary. The AssertionType should be a key in the properties dictionary, with a value of a CFNumber containing the kCFNumberIntegerType value kIOPMAssertionLevelOff or kIOPMAssertionLevelOn. Available in OS X v10.7 and later. Declared in IOPMLib.h.
1017
kIOPMAssertionTypePreventUserIdleSystemSleep
Prevents the system from sleeping automatically due to a lack of user activity. When asserted and set to level kIOPMAssertionLevelOn, will prevent the system from sleeping due to a period of idle user activity. The display may dim and idle sleep while kIOPMAssertionTypePreventUserIdleSystemSleep is enabled, but the system may not idle sleep. The system may still sleep for lid close, Apple menu, low battery, or other sleep reasons. This assertion does not put the system into Dark Wake. A caller publish the AssertionType in its assertion properties dictionary. The AssertionType should be a key in the properties dictionary, with a value of a CFNumber containing the kCFNumberIntegerType value kIOPMAssertionLevelOff or kIOPMAssertionLevelOn. Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMCPUPowerNotificationKey
Key to register for BSD style notifications on CPU power or thermal change. Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOPMThermalWarningNotificationKey
Key to register for BSD style notifications on system thermal warnings. Available in OS X v10.7 and later. Declared in IOPMLib.h.
kIOSystemLoadAdvisoryBatteryLevelKey
Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed Indicates battery constraints on the current SystemLoadAdvisory level. Available in OS X v10.6 and later. Declared in IOPMLib.h.
kIOSystemLoadAdvisoryCombinedLevelKey
Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed Provides a combined level based on UserLevel, BatteryLevel, and ThermalLevels; the combined level is the minimum of these levels. In the future, this combined level may represent new levels as well. The combined level is identical to the value returned by IOGetSystemLoadAdvisory(). Available in OS X v10.6 and later. Declared in IOPMLib.h.
1018
kIOSystemLoadAdvisoryNotifyName
The notification by this name fires when system "SystemLoadAdvisory" status changes. Pass this string as an argument to register via notify(3). You can query SystemLoadAdvisory state via notify_get_state() when this notification fires - this is more efficient than calling IOGetSystemLoadAdvisory(), and returns an identical combined SystemLoadAdvisory value. Available in OS X v10.6 and later. Declared in IOPMLib.h.
kIOSystemLoadAdvisoryThermalLevelKey
Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed Indicates thermal constraints on the current SystemLoadAdvisory level. Available in OS X v10.6 and later. Declared in IOPMLib.h.
kIOSystemLoadAdvisoryUserLevelKey
Key for dictionary returned by IOCopySystemLoadAdvisoryDetailed Indicates user activity constraints on the current SystemLoadAdvisory level. Available in OS X v10.6 and later. Declared in IOPMLib.h. See Also
IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionDictionaryKeys IOPMAssertionTypes IOPMAssertionTypes IOPMAssertionTypes IOPMAssertionTypes IOPMAssertionTypes
1019
Assertion
Level for an enabled assertion, passed as an argument to IOPMAssertionCreate.
Constants
kIOPMAssertionLevelOff
kIOPMNullAssertionID
This value represents a non-initialized assertion ID
enum { kIOPMNullAssertionID = 0 };
Constants
kIOPMNullAssertionID
This value represents a non-initialized assertion ID. Available in OS X v10.5 and later. Declared in IOPMLib.h.
1020
IOPSKeys.h Reference
Declared in
IOPSKeys.h
Overview
IOPSKeys.h defines C strings for use accessing power source data in IOPowerSource CFDictionaries, as returned by IOPSGetPowerSourceDescription (page 1041) Note that all of these C strings must be converted to CFStrings before use. You can wrap them with the CFSTR() macro, or create a CFStringRef (that you must later CFRelease()) using CFStringCreateWithCString().
Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOPSACPowerValue "AC Power" kIOPSBatteryFailureModesKey "BatteryFailureModes" kIOPSBatteryHealthConditionKey "BatteryHealthCondition" kIOPSBatteryHealthKey "BatteryHealth" kIOPSBatteryPowerValue "Battery Power" kIOPSCheckBatteryValue "Check Battery" kIOPSCommandDelayedRemovePowerKey "Delayed Remove Power" kIOPSCommandEnableAudibleAlarmKey "Enable Audible Alarm" kIOPSCommandStartupDelayKey "Startup Delay" kIOPSCurrentCapacityKey "Current Capacity" kIOPSCurrentKey "Current" kIOPSDeadWarnLevelKey "Shutdown Level" kIOPSDesignCapacityKey "DesignCapacity" kIOPSDynamicStorePath "/IOKit/PowerSources" kIOPSFailureCellImbalance "Cell Imbalance" kIOPSFailureChargeFET "Charge FET" kIOPSFailureChargeOverCurrent "Charge Over-Current" kIOPSFailureChargeOverTemp "Charge Over-Temperature"
1021
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOPSFailureDataFlushFault "Data Flush Fault" kIOPSFailureDischargeFET "Discharge FET" kIOPSFailureDischargeOverCurrent "Discharge Over-Current" kIOPSFailureDischargeOverTemp "Discharge Over-Temperature" kIOPSFailureExternalInput "Externally Indicated Failure" kIOPSFailureFuseBlown "Fuse Blown" kIOPSFailureOpenThermistor "Open Thermistor" kIOPSFailurePeriodicAFEComms "Periodic AFE Comms" kIOPSFailurePermanentAFEComms "Permanent AFE Comms" kIOPSFailureSafetyOverVoltage "Safety Over-Voltage" kIOPSFairValue "Fair" kIOPSGoodValue "Good" kIOPSHardwareSerialNumberKey "Hardware Serial Number" kIOPSHealthConfidenceKey "HealthConfidence" kIOPSInternalBatteryType "InternalBattery" kIOPSInternalType "Internal" kIOPSIsChargedKey "Is Charged" kIOPSIsChargingKey "Is Charging" kIOPSIsFinishingChargeKey "Is Finishing Charge" kIOPSIsPresentKey "Is Present" kIOPSLowWarnLevelKey "Low Warn Level" kIOPSMaxCapacityKey "Max Capacity" kIOPSMaxErrKey "MaxErr" kIOPSNameKey "Name" kIOPSNetworkTransportType "Ethernet" kIOPSOffLineValue "Off Line" kIOPSPermanentFailureValue "Permanent Battery Failure" kIOPSPoorValue "Poor" kIOPSPowerAdapterCurrentKey "Current" kIOPSPowerAdapterFamilyKey "FamilyCode" kIOPSPowerAdapterIDKey "AdapterID" kIOPSPowerAdapterRevisionKey "AdapterRevision" kIOPSPowerAdapterSerialNumberKey "SerialNumber" kIOPSPowerAdapterSourceKey "Source" kIOPSPowerAdapterWattsKey "Watts" kIOPSPowerSourceIDKey "Power Source ID" kIOPSPowerSourceStateKey "Power Source State" kIOPSSerialTransportType "Serial" kIOPSTimeToEmptyKey "Time to Empty" kIOPSTimeToFullChargeKey "Time to Full Charge" kIOPSTransportTypeKey "Transport Type" kIOPSTypeKey "Type" kIOPSUPSManagementClaimed "/IOKit/UPSPowerManagementClaimed" kIOPSUPSType "UPS" kIOPSUSBTransportType "USB" kIOPSVendorDataKey "Vendor Specific Data" kIOPSVoltageKey "Voltage"
1022
Constants
kIOPSACPowerValue
Value for key kIOPSPowerSourceStateKey. Power source is connected to external or AC power, and is not draining the internal battery. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSBatteryFailureModesKey
Enumerates a battery's failures and error conditions. Various battery failures will be listed here. A battery may suffer from more than one type of failure simultaneously, so this key has a CFArray value. If BatteryFailureModesKey is not defined (or is set to an empty dictionary), then the battery has no detectable failures. Each entry in the array should be a short descriptive string describing the error.
Apple-defined power sources will publish this key if any battery errors exist. For power source creators: Providing this key is RECOMMENDED. Type CFArrayRef
Apple-defined power sources will publish this key. Value is one of the "Battery Health Condition Values" strings described in this file. For power source creators: Providing this key is OPTIONAL - these keys have values only used by Apple power sources. Type CFStringRef
1023
kIOPSBatteryHealthKey
Apple-defined battery power sources will publish this key. Use value kIOPSGoodValue to describe a well-performing power source, Use kIOPSFairValue to describe a functional power source with limited capacity And use kIOPSPoorValue to describe a power source that's not capable of Providing power. For power source creators: Providing this key is OPTIONAL. Type CFStringRef
Value for key kIOPSPowerSourceStateKey. Power source is currently using the internal battery. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSCheckBatteryValue
Value for key kIOPSBatteryHealthConditionKey This value indicates that the battery should be checked out by a licensed Mac repair service. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSCommandDelayedRemovePowerKey
Command to give a UPS when it should remove power from its AC plugs in a specified amount of time
The matching argument should be a CFNumber of kCFNumberIntType specifying when the UPS should remove power from its AC power ports.
Command to give a UPS when it should either enable or disable the audible alarm.
The matching argument should be a CFBooleanRef where kCFBooleanTrue enables the alarm and kCFBooleanFalse diables the alarm
1024
kIOPSCommandStartupDelayKey
The matching argument should be a CFNumber of kCFNumberIntType specifying when the UPS should remove power from its AC power ports.
Apple-defined power sources will publish this key in units of percent. The power source's software may specify the units for this key. The units must be consistent for all capacities reported by this power source. The power source will usually define this number in units of percent, or mAh. Clients may derive a percentage of power source battery remaining by dividing "Current Capacity" by "Max Capacity" For power source creators: Providing this key is REQUIRED. Type CFNumber kCFNumberIntType (signed integer)
Apple-defined power sources will publish this key. For power source creators: Providing this key is RECOMMENDED. Type CFNumber kCFNumberIntType (signed integer) - units are mA
Key for the "Shutdown System" low power trigger-level. Default is 20%. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
1025
kIOPSDesignCapacityKey
Apple-defined power sources might not publish this key. The power source's software may specify the units for this key. The units must be consistent for all capacities reported by this power source. For power source creators: Providing this key is RECOMMENDED. Type CFNumber kCFNumberIntType (signed integer)
This is only used for internal bookkeeping, and should be ignored. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSFailureCellImbalance
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureChargeFET
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureChargeOverCurrent
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureChargeOverTemp
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureDataFlushFault
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
1026
kIOPSFailureDischargeFET
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureDischargeOverCurrent
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureDischargeOverTemp
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureExternalInput
Value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureFuseBlown
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureOpenThermistor
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailurePeriodicAFEComms
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailurePermanentAFEComms
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSFailureSafetyOverVoltage
Potential value for key kIOPSBatteryFailureModesKey Available in OS X v10.6 and later. Declared in IOPSKeys.h.
1027
kIOPSFairValue
Value for key kIOPSBatteryHealthKey. Available in OS X v10.4 and later. Declared in IOPSKeys.h.
kIOPSGoodValue
Value for key kIOPSBatteryHealthKey. Available in OS X v10.4 and later. Declared in IOPSKeys.h.
kIOPSHardwareSerialNumberKey
A unique serial number that identifies the power source. For Apple-manufactured batteries, this is an alphanumeric string generated during the battery manufacturing process.
Apple-defined power sources will publish this key if the hardware provides the serial number. For power source creators: Providing this key is RECOMMENDED. Type CFStringRef
CFDictionary key for our confidence in the accuracy of our power source's "health" estimate.
Apple-defined power sources will no longer publish this key. Power source creators should not publish this key. For power source creators: This key is DEPRECATED, do not implement it. Type CFStringRef
Represents a battery residing inside a Mac. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSInternalType
Value for key kIOPSTransportTypeKey. Indicates the power source is an internal battery. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
1028
kIOPSIsChargedKey
CFDictionary key indicates whether the battery is charged. A battery must be plugged in to an external power source in order to be fully charged. Note that a battery may validly be plugged in, not charging, and <100% charge. e.g. A battery with capacity >= 95% and not charging, is defined as charged.
Apple-defined power sources will publish this key. For power source creators: Providing this key is REQUIRED. Type CFBoolean - kCFBooleanTrue or kCFBooleanFalse
Apple-defined power sources will publish this key. For power source creators: Providing this key is REQUIRED. Type CFBoolean - kCFBooleanTrue or kCFBooleanFalse
CFDictionary key indicates whether the battery is finishing off its charge. When this is true, the system UI should indicate that the battery is "Finishing Charge." Some batteries may continue charging after they report 100% capacity.
Apple-defined battery power sources will publish this key. For power source creators: Providing this key is RECOMMENDED. Type CFBoolean - kCFBooleanTrue or kCFBooleanFalse
1029
kIOPSIsPresentKey
Apple-defined power sources will publish this key. For instance, a portable with the capacity for two batteries but with only one present would show two power source dictionaries, but kIOPSIsPresentKey would have the value kCFBooleanFalse in one of them. For power source creators: Providing this key is REQUIRED. Type CFBoolean - kCFBooleanTrue or kCFBooleanFalse
Key for the "Warning" UPS low power trigger-level. Default is 50%. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSMaxCapacityKey
CFDictionary key for the current power source's maximum or "Full Charge Capacity"
Apple-defined power sources will publish this key in units of percent. The value is usually 100%. The power source's software may specify the units for this key. The units must be consistent for all capacities reported by this power source. For power source creators: Providing this key is REQUIRED. Type CFNumber kCFNumberIntType (signed integer)
CFDictionary key for the current power source's percentage error in capacity reporting. In internal batteries, this refers to the battery pack's estimated percentage error.
Apple-defined battery power sources will publish this key, but only if it's defined for the battery. For power source creators: Providing this key is OPTIONAL. Type CFNumberRef kCFNumberIntType, non-negative integer
1030
kIOPSNameKey
Apple-defined power sources will publish this key. For power source creators: Providing this key is REQUIRED. Type CFStringRef
Value for key kIOPSTransportTypeKey. Indicates the power source is a UPS attached over a network connection (and it may be managing several computers). Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSOffLineValue
Value for key kIOPSPowerSourceStateKey. Power source is off-line or no longer connected. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSPermanentFailureValue
Value for key kIOPSBatteryHealthConditionKey Indicates the battery needs replacement. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSPoorValue
Value for key kIOPSBatteryHealthKey. Available in OS X v10.4 and later. Declared in IOPSKeys.h.
kIOPSPowerAdapterCurrentKey
This key refers to the current of the external AC power adapter attached to a portable. The value associated with this key is a CFNumberRef kCFNumberIntType integer value, in units of mAmps. This key may be present in the dictionary returned from IOPSCopyExternalPowerAdapterDetails (page 1039) This key might not be defined in the adapter details dictionary. Available in OS X v10.7 and later. Declared in IOPSKeys.h.
1031
kIOPSPowerAdapterFamilyKey
The power adapter's family code. The value associated with this key is a CFNumberRef kCFNumberIntType integer value This key may be present in the dictionary returned from IOPSCopyExternalPowerAdapterDetails (page 1039) This key might not be defined in the adapter details dictionary. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSPowerAdapterIDKey
This key refers to the attached external AC power adapter's ID. The value associated with this key is a CFNumberRef kCFNumberIntType integer. This key may be present in the dictionary returned from IOPSCopyExternalPowerAdapterDetails (page 1039) This key might not be defined in the adapter details dictionary. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSPowerAdapterRevisionKey
The power adapter's revision. The value associated with this key is a CFNumberRef kCFNumberIntType integer value This key may be present in the dictionary returned from IOPSCopyExternalPowerAdapterDetails (page 1039) This key might not be defined in the adapter details dictionary. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSPowerAdapterSerialNumberKey
The power adapter's serial number. The value associated with this key is a CFNumberRef kCFNumberIntType integer value This key may be present in the dictionary returned from IOPSCopyExternalPowerAdapterDetails (page 1039) This key might not be defined in the adapter details dictionary. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSPowerAdapterSourceKey
This key refers to the source of the power. The value associated with this key is a CFNumberRef kCFNumberIntType integer value. This key may be present in the dictionary returned from IOPSCopyExternalPowerAdapterDetails (page 1039) This key might not be defined in the adapter details dictionary. Available in OS X v10.7 and later. Declared in IOPSKeys.h.
1032
kIOPSPowerAdapterWattsKey
This key refers to the wattage of the external AC power adapter attached to a portable. The value associated with this key is a CFNumberRef kCFNumberIntType integer value, in units of watts. This key may be present in the dictionary returned from IOPSCopyExternalPowerAdapterDetails (page 1039) This key might not be defined in the adapter details dictionary. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSPowerSourceIDKey
Apple UPS power sources will publish this key. Callers should not set this key; OS X power management will publish this key for UPS's. Type CFNumber, kCFNumberIntType, uniquely identifying an attached UPS.
Apple-defined power sources will publish this key. For power source creators: Providing this key is REQUIRED.
kIOPSBatteryPowerValue indicates power source is drawing internal power; kIOPSACPowerValue indicates power source is connected to an external power source.
Value for key kIOPSTransportTypeKey. Indicates the power source is a UPS attached over a serial connection. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
1033
kIOPSTimeToEmptyKey
CFDictionary key for the current power source's time remaining until empty. Only valid if the power source is running off its own power. That's when the kIOPSPowerSourceStateKey has value kIOPSBatteryPowerValue and the value of kIOPSIsChargingKey is kCFBooleanFalse.
Apple-defined power sources will publish this key. For power source creators: Providing this key is RECOMMENDED. Type CFNumber kCFNumberIntType (signed integer), units are minutes A value of -1 indicates "Still Calculating the Time", otherwise estimated minutes left on the battery.
CFDictionary key for the current power source's time remaining until empty. Only valid if the value of kIOPSIsChargingKey is kCFBooleanTrue.
Apple-defined power sources will publish this key. For power source creators: Providing this key is RECOMMENDED. Type CFNumber kCFNumberIntType (signed integer), units are minutes A value of -1 indicates "Still Calculating the Time", otherwise estimated minutes until fully charged.
CFDictionary key for the current power source's data transport type (e.g. the means that the power source conveys power source data to the OS X machine).
Apple-defined power sources will publish this key. A value of kIOPSInternalType describes an internal power source.
kIOPSUSBTransportType, kIOPSNetworkTransportType, and kIOPSSerialTransportType
For power source creators: Providing this key is REQUIRED. Type CFStringRef. Valid transport types are kIOPSSerialTransportType, kIOPSUSBTransportType, kIOPSNetworkTransportType, kIOPSInternalType
1034
kIOPSTypeKey
Apple-defined power sources will publish this key. For power source creators: Providing this key is REQUIRED. Type CFStringRef. Valid transport types are kIOPSUPSType or kIOPSInternalBatteryType.
Claims UPS management for a third-party driver. kIOPSUPSManagementClaimed is obsolete. Do not use. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSUPSType
Represents an external attached UPS. Available in OS X v10.6 and later. Declared in IOPSKeys.h.
kIOPSUSBTransportType
Value for key kIOPSTransportTypeKey. Indicates the power source is a UPS attached over a USB connection. Available in OS X v10.2 and later. Declared in IOPSKeys.h.
kIOPSVendorDataKey
Apple-defined power sources are not required to publish this key. For power source creators: Providing this key is OPTIONAL. CFDictionary; contents determined by the power source software. OS X will not look at this data.
Apple-defined power sources will publish this key. For power source creators: Providing this key is RECOMMENDED. Type CFNumber kCFNumberIntType (signed integer) - units are mV
1035
Declared in
IOPartitionScheme.h
Overview
This header contains the IOPartitionScheme class definition.
Constants
See the Overview for header-level documentation.
Defines
#define kIOMediaLiveKey "Live" #define kIOMediaPartitionIDKey "Partition ID" #define kIOPartitionSchemeClass "IOPartitionScheme"
Constants
kIOMediaLiveKey
A property of IOMedia objects. The kIOMediaLiveKey property has an OSBoolean value and is placed into an IOMedia instance created via the partition scheme. It describes whether the partition is live, that is, it is up-to-date with respect to the on-disk partition table. Available in OS X v10.5 and later. Declared in IOPartitionScheme.h.
1036
kIOMediaPartitionIDKey
A property of IOMedia objects. The kIOMediaPartitionIDKey property has an OSNumber value and is placed into an IOMedia instance created via the partition scheme. It is an ID that differentiates one partition from the other (within a given scheme). It is typically an index into the on-disk partition table. Available in OS X v10.0 and later. Declared in IOPartitionScheme.h.
kIOPartitionSchemeClass
The name of the IOPartitionScheme class. kIOPartitionSchemeClass is the name of the IOPartitionScheme class. Available in OS X v10.0 and later. Declared in IOPartitionScheme.h.
1037
IOPowerSources.h Reference
Declared in
IOPowerSources.h
Overview
IOPowerSources provides uniform access to the state of power sources attached to the system. You can receive a change notification when any power source data changes. "Power sources" currently include batteries and UPS devices. The header follows CF semantics in that it is the caller's responsibility to CFRelease() anything returned by a "Copy" function, and the caller should not CFRelease() anything returned by a "Get" function.
Included Headers
<sys/cdefs.h>
Functions by Task
See the Overview for header-level documentation.
Returns the estimated minutes remaining until all power sources (battery and/or UPS's) are empty, or returns kIOPSTimeRemainingUnlimited if attached to an unlimited power source.
Returns a CFDictionary that describes the attached (AC) external power adapter (if any external power adapter is attached.
1038
Returns a CFDictionary with readable information about the specific power source.
IOPSGetProvidingPowerSourceType(CFTypeRef) (page 1042)
Returns a CFRunLoopSourceRef that notifies the caller when power source information changes.
Functions
IOPSCopyExternalPowerAdapterDetails
Returns a CFDictionary that describes the attached (AC) external power adapter (if any external power adapter is attached.
Return Value Returns a CFDictionary on success. Caller must release the returned dictionary. If no adapter is attached, or if there's an error, returns NULL. Discussion Use the kIOPSPowerAdapter... keys described in IOPSKeys.h to interpret the returned CFDictionary.
1039
IOPSCopyPowerSourcesInfo
Returns a blob of Power Source information in an opaque CFTypeRef.
Return Value NULL if errors were encountered, a CFTypeRef otherwise. Caller must CFRelease() the return value when done accessing it. Discussion Clients should not directly access data in the returned CFTypeRef - they should use the accessor functions IOPSCopyPowerSourcesList and IOPSGetPowerSourceDescription, instead. Availability Available in OS X v10.2 and later.
Related Sample Code Quartz Composer BatteryInfo
Declared in
IOPowerSources.h
IOPSCopyPowerSourcesList
Returns a CFArray of Power Source handles, each of type CFTypeRef.
Parameters
blob
1040
Return Value Returns NULL if errors were encountered, otherwise a CFArray of CFTypeRefs. Caller must CFRelease() the returned CFArrayRef. Discussion The caller shouldn't directly access the CFTypeRefs, but should use IOPSGetPowerSourceDescription on each member of the CFArrayRef. Availability Available in OS X v10.2 and later.
Related Sample Code Quartz Composer BatteryInfo
Declared in
IOPowerSources.h
IOPSGetBatteryWarningLevel
Indicates whether the system is at a low battery warning level.
Discussion If your app runs in full screen mode and occludes OS X's battery monitor's low battery warnings, you should alert the user at least when the system is in kIOPSLowBatteryWarnFinal. Availability Available in OS X v10.6 and later. Declared in
IOPowerSources.h
IOPSGetPowerSourceDescription
Returns a CFDictionary with readable information about the specific power source.
1041
Parameters
blob
One of the CFTypeRefs in the CFArray returned by IOPSCopyPowerSourcesList() Return Value Returns NULL if an error was encountered, otherwise a CFDictionary. Caller should NOT release the returned CFDictionary - it will be released as part of the CFTypeRef returned by IOPSCopyPowerSourcesInfo(). Discussion See the C-strings defined in IOPSKeys.h for specific keys into the dictionary. Don't expect all keys to be present in any dictionary. Some power sources, for example, may not support the "Time Remaining To Empty" key and it will not be present in their dictionaries. Availability Available in OS X v10.2 and later.
Related Sample Code Quartz Composer BatteryInfo
Declared in
IOPowerSources.h
IOPSGetProvidingPowerSourceType(CFTypeRef )
Indicates the power source the computer is currently drawing from.
Parameters
snapshot
The CFTypeRef returned by IOPSCopyPowerSourcesInfo(); caller may pass NULL. Return Value One of: CFSTR(kIOPMACPowerKey), CFSTR(kIOPMBatteryPowerKey), CFSTR(kIOPMUPSPowerKey) Discussion Determines which power source is providing power.
1042
IOPSGetProvidingPowerSourceType(CFTypeRef )
Indicates the power source the computer is currently drawing from.
Parameters
snapshot
The CFTypeRef returned by IOPSCopyPowerSourcesInfo() Return Value One of: CFSTR(kIOPMACPowerKey), CFSTR(kIOPMBatteryPowerKey), CFSTR(kIOPMUPSPowerKey) Discussion Determines which power source is providing power.
IOPSGetTimeRemainingEstimate
Returns the estimated minutes remaining until all power sources (battery and/or UPS's) are empty, or returns kIOPSTimeRemainingUnlimited if attached to an unlimited power source.
Return Value Returns kIOPSTimeRemainingUnknown if the OS cannot determine the time remaining. Returns kIOPSTimeRemainingUnlimited if the system has an unlimited power source. Otherwise returns a positive number of type CFTimeInterval, indicating the time remaining in seconds until all power sources are depleted. Discussion If attached to an "Unlimited" power source, like AC power or any external source, the return value is
kIOPSTimeRemainingUnlimited
If the system is on "Limited" power, like a battery or UPS, but is still calculating the time remaining, which may take several seconds after each system power event (e.g. waking from sleep, or unplugging AC Power), the return value is kIOPSTimeRemainingUnknown Otherwise, if the system is on "Limited" power and the system has an accurate time remaining estimate, the system returns a CFTimeInterval estimate of the time remaining until the system is out of battery power.
1043
If you require more detailed battery information, use IOPSCopyPowerSourcesInfo (page 1040)> and IOPSGetPowerSourceDescription (page 1041)>. Availability Available in OS X v10.7 and later. Declared in
IOPowerSources.h
IOPSNotificationCreateRunLoopSource
Returns a CFRunLoopSourceRef that notifies the caller when power source information changes.
Parameters
callback
Any user-defined pointer, passed to the IOPowerSource callback. Return Value Returns NULL if an error was encountered, otherwise a CFRunLoopSource. Caller must release the CFRunLoopSource. Discussion Returns a CFRunLoopSourceRef for scheduling with your CFRunLoop. If your project does not use a CFRunLoop, you can alternatively receive notifications via mach port, dispatch, or signal, via notify.h using the name
kIOPSTimeRemainingNotificationKey
1044
Data Types
See the Overview for header-level documentation.
IOPSLowBatteryWarningLevel
The battery can provide no more than 10 minutes of runtime.
typedef enum { /*! @constant kIOPSLowBatteryWarningNone */ kIOPSLowBatteryWarningNone = 1, /*! @constant kIOPSLowBatteryWarningEarly */ kIOPSLowBatteryWarningEarly = 2, /*! @constant kIOPSLowBatteryWarningFinal */ kIOPSLowBatteryWarningFinal = 3 } IOPSLowBatteryWarningLevel;
Constants
kIOPSLowBatteryWarningNone
Available in OS X v10.6 and later. Declared in IOPowerSources.h. Discussion OS X makes no guarantees that the system shall remain in Final Warning for 10 minutes. Batteries are frequently calibrated differently and may provide runtime for more, or less, than the estimated 10 minutes. Availability Available in OS X v10.6 and later. Declared in
IOPowerSources.h
1045
Constants
See the Overview for header-level documentation.
Defines
Constants
kIOPSNotifyLowBattery
Notify(3) key. The system delivers notifications on this key when the battery time remaining drops into a warnable level. Available in OS X v10.6 and later. Declared in IOPowerSources.h.
kIOPSTimeRemainingNotificationKey
C-string key for a notification that fires when the power source(s) time remaining changes. Use notify(3) API to register for notifications. Available in OS X v10.7 and later. Declared in IOPowerSources.h.
kIOPSTimeRemainingUnknown
Possible return value from IOPSGetTimeRemainingEstimate (page 1043) Indicates the system is connected to a limited power source, but the system is still calculating a time remaining estimate. Check for a valid estimate again when the notification kIOPSPowerSourcesNotificationKey fires. Available in OS X v10.7 and later. Declared in IOPowerSources.h.
kIOPSTimeRemainingUnlimited
Possible return value from IOPSGetTimeRemainingEstimate (page 1043) Indicates the system is connected to an external power source, without a time limit. Available in OS X v10.7 and later. Declared in IOPowerSources.h.
1046
Declared in
IOStorage.h
Overview
This header contains the IOStorage class definition.
Included Headers
<sys/kernel_types.h> <IOKit/IOTypes.h>
Constants
See the Overview for header-level documentation.
Defines
kIOStorageCategory "IOStorage" /* (as IOMatchCategory) */ kIOStorageClass "IOStorage" kIOStorageFeatureForceUnitAccess "Force Unit Access" kIOStorageFeaturesKey "IOStorageFeatures" kIOStorageFeatureUnmap "Unmap"
1047
Constants
kIOStorageCategory
kIOStorageCategory is a value for IOService's kIOMatchCategoryKey property. The kIOStorageCategory value is the standard value for the IOService property kIOMatchCategoryKey ("IOMatchCategory") for all storage drivers. All storage objects that expect to drive new content (that is, produce new media objects) are expected to compete within the kIOStorageCategory namespace. See the IOService documentation for more information on match categories. Available in OS X v10.0 and later. Declared in IOStorage.h.
kIOStorageClass
The name of the IOStorage class. Available in OS X v10.0 and later. Declared in IOStorage.h.
kIOStorageFeatureForceUnitAccess
Describes the presence of the Force Unit Access feature. This property describes the ability of the storage stack to force a request to access the media. It is one of the feature entries listed under the top- level kIOStorageFeaturesKey property table. It has an OSBoolean value. Available in OS X v10.5 and later. Declared in IOStorage.h.
kIOStorageFeaturesKey
A property of any object in the storage stack. kIOStorageFeaturesKey is a property of any object in the storage stack that wishes to express support of additional features, such as Force Unit Access. It is typically defined in the device object below the block storage driver object. It has an OSDictionary value, where each entry describes one given feature. Available in OS X v10.5 and later. Declared in IOStorage.h.
kIOStorageFeatureUnmap
Describes the presence of the Unmap feature. This property describes the ability of the storage stack to delete unused data from the media. It is one of the feature entries listed under the top- level kIOStorageFeaturesKey property table. It has an OSBoolean value. Available in OS X v10.7 and later. Declared in IOStorage.h.
1048
Overview Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOProperty64BitKey "64-bit" kIOPropertyApplicationIDKey "Application ID" kIOPropertyBaseFrequencyKey "Base Frequency" kIOPropertyBusVoltageKey "Bus Voltage" kIOPropertyBusWidthKey "Bus Width" kIOPropertyCardCharacteristicsKey "Card Characteristics" kIOPropertyCardPresentKey "Card Present" kIOPropertyCardTypeKey "Card Type" kIOPropertyCardTypeMMCKey "MMC" kIOPropertyCardTypeSDHCKey "SDHC" kIOPropertyCardTypeSDSCKey "SDSC" kIOPropertyCardTypeSDXCKey "SDXC" kIOPropertyClockDivisorKey "Clock Divisor" kIOPropertyManufacturerIDKey "Manufacturer ID" kIOPropertyManufacturingDateKey "Manufacturing Date" kIOPropertyProductSerialNumberKey "Serial Number" kIOPropertySlotKey "Slot" kIOPropertySpecificationVersionKey "Specification Version" kIOPropertySpeedClassKey "Speed Class"
1049
Constants
kIOProperty64BitKey
This key defines wether the device supports 64-bit. Requirement: Mandatory Example:
This key is used to indicate the card application ID. Requirement: Optional Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDHC</string> <key>Application ID</key> <data>ffff</data> </dict> </dict>
1050
kIOPropertyBaseFrequencyKey
This key defines the current base frequency for the device. Requirement: Mandatory. Example:
This key defines the current bus voltage for the device in mV Requirement: Mandatory. Example:
This key defines the current bus width for the device. Requirement: Mandatory. Example:
1051
kIOPropertyCardCharacteristicsKey
This key is used to define Card Characteristics for a particular piece of MMC/SD media and it has an associated dictionary which lists the card characteristics. Requirement: Mandatory Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> </dict> </dict>
This key defines wether a MMC or SD card is physically present. Requirement: Mandatory Example:
1052
kIOPropertyCardTypeKey
This key is used to indicate the card type is MMC. Requirement: Optional. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>MMC</string> </dict> </dict>
This key is used to indicate the card type is MMC. Requirement: Optional. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>MMC</string> </dict> </dict>
1053
kIOPropertyCardTypeSDHCKey
This key is used to indicate the card type is SDHC. Requirement: Optional. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDHC</string> </dict> </dict>
This key is used to indicate the card type is SDSC. Requirement: Optional. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDSC</string> </dict> </dict>
1054
kIOPropertyCardTypeSDXCKey
This key is used to indicate the card type is SDXC. Requirement: Optional. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDXC</string> </dict> </dict>
This key defines the current clock divisor for the device. Requirement: Mandatory. Example:
1055
kIOPropertyManufacturerIDKey
This key is used to indicate the card manufacturer ID. Requirement: Optional Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDHC</string> <key>Manufacturer ID</key> <data>03</data> </dict> </dict>
This key is used to indicate the card manufacturing date. Requirement: Mandatory. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDHC</string> <key>Manufacturing Date</key> <string>2009-12</string> </dict> </dict>
1056
kIOPropertyProductSerialNumberKey
This key is used to indicate the card serial number ID. Requirement: Mandatory Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDHC</string> <key>Serial Number</key> <data>0045ff</data> </dict> </dict>
This key is used to define the slot number for the device Requirement: Mandatory Example:
1057
kIOPropertySpecificationVersionKey
This key is used to indicate the card specification version. Requirement: Mandatory. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDHC</string> <key>Specification Version</key> <string>3.0</string> </dict> </dict>
This key is used to indicate SD card speed class. Requirement: Mandatory. Example:
<dict> <key>Card Characteristics</key> <dict> <key>Product Name</key> <string>SD32G</string> <key>Product Revision Level</key> <string>1.0</string> <key>Card Type</key> <string>SDHC</string> <key>Speed Class</key> <data>02</data> </dict> </dict>
1058
Overview
Included Headers
<IOKit/storage/IOStorageProtocolCharacteristics.h>
Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOPropertyBytesPerPhysicalSectorKey "Bytes per Physical Sector" kIOPropertyCylinderCountKey "Cylinder Count" kIOPropertyDeviceCharacteristicsKey "Device Characteristics" kIOPropertyHeadCountKey "Head Count" kIOPropertyLogicalBlockSizeKey "Logical Block Size" kIOPropertyMediumRotationRateKey "Rotation Rate" kIOPropertyMediumTypeKey "Medium Type" kIOPropertyMediumTypeRotationalKey "Rotational" kIOPropertyMediumTypeSolidStateKey "Solid State" kIOPropertyPhysicalBlockSizeKey "Physical Block Size" kIOPropertyProductNameKey "Product Name" kIOPropertyProductRevisionLevelKey "Product Revision Level" kIOPropertyProductSerialNumberKey "Serial Number" kIOPropertyRigidDiskGeometryKey "Rigid Disk Geometry" kIOPropertySectorCountPerTrackKey "Sector Count per Track" kIOPropertySupportedBDFeaturesKey "BD Features" kIOPropertySupportedCDFeaturesKey "CD Features" kIOPropertySupportedDVDFeaturesKey "DVD Features"
1059
Constants
kIOPropertyBytesPerPhysicalSectorKey
This key is used to define the number of heads for a particular medium. Requirement: Mandatory element of the Rigid Disk Geometry dictionary. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Rigid Disk Geometry</key> <dict> <key>Sector Count per Track</key> <integer>12345</integer> <key>Head Count</key> <integer>12</integer> <key>Cylinder Count</key> <integer>12345</integer> <key>Bytes per Physical Sector</key> <integer>512</integer> </dict> </dict> </dict>
1060
kIOPropertyCylinderCountKey
This key is used to define the number of heads for a particular medium. Requirement: Mandatory element of the Rigid Disk Geometry dictionary. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Rigid Disk Geometry</key> <dict> <key>Sector Count per Track</key> <integer>12345</integer> <key>Head Count</key> <integer>12</integer> <key>Cylinder Count</key> <integer>12345</integer> <key>Bytes per Physical Sector</key> <integer>512</integer> </dict> </dict> </dict>
1061
kIOPropertyDeviceCharacteristicsKey
This key is used to define Device Characteristics for a particular device and it has an associated dictionary which lists the device characteristics. The device characteristics are Command Set specific and are listed in the header files for each command set. Requirement: Mandatory Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> </dict> </dict>
1062
kIOPropertyHeadCountKey
This key is used to define the number of heads for a particular medium. Requirement: Mandatory element of the Rigid Disk Geometry dictionary. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Rigid Disk Geometry</key> <dict> <key>Sector Count per Track</key> <integer>12345</integer> <key>Head Count</key> <integer>12</integer> <key>Cylinder Count</key> <integer>12345</integer> <key>Bytes per Physical Sector</key> <integer>512</integer> </dict> </dict> </dict>
1063
kIOPropertyLogicalBlockSizeKey
This key is used to define the logical block size of a hard disk drive. Requirement: Mandatory for hard disk drives with logical block size other than 512 bytes or that does not match its physical block size. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Physical Block Size</key> <integer>4096</integer> <key>Logical Block Size</key> <integer>512</integer> </dict> </dict>
1064
kIOPropertyMediumRotationRateKey
This key is used to indicate the medium rotation rate in RPM of the device. Requirement: Optional. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>AAPL</string> <key>Product Name</key> <string>FireWire Target</string> <key>Product Revision Level</key> <string>0000</string> <key>Rotation Rate</key> <integer>7200</integer> </dict> </dict>
This key is used to indicate the medium type of the device. Requirement: Optional. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>AAPL</string> <key>Product Name</key> <string>FireWire Target</string> <key>Product Revision Level</key> <string>0000</string> <key>Medium Type</key> <string>Rotational</string> </dict> </dict>
1065
kIOPropertyMediumTypeRotationalKey
This key is used to indicate the medium type of the device is rotational. Requirement: Optional. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>AAPL</string> <key>Product Name</key> <string>FireWire Target</string> <key>Product Revision Level</key> <string>0000</string> <key>Medium Type</key> <string>Rotational</string> </dict> </dict>
This key is used to indicate the medium type of the device is solid state. Requirement: Optional. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>AAPL</string> <key>Product Name</key> <string>FireWire Target</string> <key>Product Revision Level</key> <string>0000</string> <key>Medium Type</key> <string>Solid State</string> </dict> </dict>
1066
kIOPropertyPhysicalBlockSizeKey
This key is used to define the physical block size of a hard disk drive. Requirement: Mandatory for hard disk drives with physical block size other than 512 bytes. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Physical Block Size</key> <integer>4096</integer> <key>Logical Block Size</key> <integer>512</integer> </dict> </dict>
This key is used to define the Product Name for a particular device and it has an associated string. Requirement: Mandatory Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> </dict> </dict>
1067
kIOPropertyProductRevisionLevelKey
This key is used to define the Product Revision Level for a particular device and it has an associated string. Requirement: Mandatory Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> </dict> </dict>
This key is used to define the Product Serial Number for a particular device and it has an associated data. Requirement: Mandatory Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Serial Number</key> <string>123456789</string> </dict> </dict>
1068
kIOPropertyRigidDiskGeometryKey
This key is used to define a dictionary containing rigid disk geometry information. Requirement: Optional. If a device publishes this dictionary, it must publish all key/value pairs which are deemed Mandatory. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Rigid Disk Geometry</key> <dict> <key>Sector Count per Track</key> <integer>12345</integer> <key>Head Count</key> <integer>12</integer> <key>Cylinder Count</key> <integer>12345</integer> <key>Bytes per Physical Sector</key> <integer>512</integer> </dict> </dict> </dict>
1069
kIOPropertySectorCountPerTrackKey
This key is used to define the number of sectors per each track for a particular medium. Requirement: Mandatory element of the Rigid Disk Geometry dictionary. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> <key>Rigid Disk Geometry</key> <dict> <key>Sector Count per Track</key> <integer>12345</integer> </dict> </dict> </dict>
1070
kIOPropertySupportedBDFeaturesKey
This key is used to define the supported BD Features for a particular optical device and it has an associated bitfield. See <IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the bits and associated bitmasks. Requirement: Mandatory for optical devices (Peripheral Device Type 05h). Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>SuperDrive</string> <key>Product Revision Level</key> <string>1.0</string> <key>CD Features</key> <integer>1663</integer> <key>DVD Features</key> <integer>103</integer> <key>BD Features</key> <integer>21</integer> </dict> </dict>
1071
kIOPropertySupportedCDFeaturesKey
This key is used to define the supported CD Features for a particular optical device and it has an associated bitfield. See <IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the bits and associated bitmasks. Requirement: Mandatory for optical devices (Peripheral Device Type 05h). Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>SuperDrive</string> <key>Product Revision Level</key> <string>1.0</string> <key>CD Features</key> <integer>1663</integer> <key>DVD Features</key> <integer>103</integer> </dict> </dict>
1072
kIOPropertySupportedDVDFeaturesKey
This key is used to define the supported DVD Features for a particular optical device and it has an associated bitfield. See <IOKit/scsi/IOSCSIMultimediaCommandsDevice.h> for definitions of the bits and associated bitmasks. Requirement: Mandatory for optical devices (Peripheral Device Type 05h). Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>SuperDrive</string> <key>Product Revision Level</key> <string>1.0</string> <key>CD Features</key> <integer>1663</integer> <key>DVD Features</key> <integer>103</integer> </dict> </dict>
1073
kIOPropertyTargetDiskModeKey
This key is used to indicate the device is another computer in Target Disk Mode. Requirement: Optional. Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>AAPL</string> <key>Product Name</key> <string>FireWire Target</string> <key>Product Revision Level</key> <string>0000</string> <key>Target Disk Mode</key> <true/> </dict> </dict>
This key is used to define the Vendor Name for a particular device and it has an associated string. Requirement: Mandatory Example:
<dict> <key>Device Characteristics</key> <dict> <key>Vendor Name</key> <string>Apple</string> <key>Product Name</key> <string>iPod</string> <key>Product Revision Level</key> <string>1.0</string> </dict> </dict>
1074
Overview Constants
See the Overview for header-level documentation.
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOPropertyExternalKey "External" kIOPropertyFibreChannelAddressIdentifierKey "Address Identifier" kIOPropertyFibreChannelALPAKey "AL_PA" kIOPropertyFibreChannelCableDescriptionCopperKey "Copper" kIOPropertyFibreChannelCableDescriptionFiberOpticKey "Fiber Optic" kIOPropertyFibreChannelCableDescriptionKey "Fibre Channel Cabling Type" kIOPropertyFibreChannelNodeWorldWideNameKey "Node World Wide Name" kIOPropertyFibreChannelPortWorldWideNameKey "Port World Wide Name" kIOPropertyInterconnectFileKey "File" kIOPropertyInterconnectRAMKey "RAM" kIOPropertyInternalExternalKey "Internal/External" kIOPropertyInternalKey "Internal" kIOPropertyPhysicalInterconnectLocationKey "Physical Interconnect Location" kIOPropertyPhysicalInterconnectTypeATA "ATA" kIOPropertyPhysicalInterconnectTypeATAPI "ATAPI" kIOPropertyPhysicalInterconnectTypeFibreChannel "Fibre Channel Interface" kIOPropertyPhysicalInterconnectTypeFireWire "FireWire" kIOPropertyPhysicalInterconnectTypeKey "Physical Interconnect" kIOPropertyPhysicalInterconnectTypeSCSIParallel "SCSI Parallel Interface" kIOPropertyPhysicalInterconnectTypeSecureDigital "Secure Digital" kIOPropertyPhysicalInterconnectTypeSerialATA "SATA" kIOPropertyPhysicalInterconnectTypeSerialAttachedSCSI "SAS" kIOPropertyPhysicalInterconnectTypeUSB "USB"
1075
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOPropertyPhysicalInterconnectTypeVirtual "Virtual Interface" kIOPropertyPortDescriptionKey "Port Description" kIOPropertyPortSpeed10GigabitKey "10 Gigabit" kIOPropertyPortSpeed12GigabitKey "12 Gigabit" kIOPropertyPortSpeed16GigabitKey "16 Gigabit" kIOPropertyPortSpeed1_5GigabitKey "1.5 Gigabit" kIOPropertyPortSpeed1GigabitKey "1 Gigabit" kIOPropertyPortSpeed2GigabitKey "2 Gigabit" kIOPropertyPortSpeed3GigabitKey "3 Gigabit" kIOPropertyPortSpeed40GigabitKey "40 Gigabit" kIOPropertyPortSpeed4GigabitKey "4 Gigabit" kIOPropertyPortSpeed6GigabitKey "6 Gigabit" kIOPropertyPortSpeed8GigabitKey "8 Gigabit" kIOPropertyPortSpeedAutomatic10GigabitKey "Automatic (10 Gigabit)" kIOPropertyPortSpeedAutomatic1_5GigabitKey "Automatic (1.5 Gigabit)" kIOPropertyPortSpeedAutomatic1GigabitKey "Automatic (1 Gigabit)" kIOPropertyPortSpeedAutomatic2GigabitKey "Automatic (2 Gigabit)" kIOPropertyPortSpeedAutomatic3GigabitKey "Automatic (3 Gigabit)" kIOPropertyPortSpeedAutomatic4GigabitKey "Automatic (4 Gigabit)" kIOPropertyPortSpeedAutomatic6GigabitKey "Automatic (6 Gigabit)" kIOPropertyPortSpeedAutomatic8GigabitKey "Automatic (8 Gigabit)" kIOPropertyPortSpeedAutomaticKey "Automatic" kIOPropertyPortSpeedKey "Port Speed" kIOPropertyPortStatusKey "Port Status" kIOPropertyPortStatusLinkEstablishedKey "Link Established" kIOPropertyPortStatusLinkFailedKey "Link Failed" kIOPropertyPortStatusNoLinkEstablishedKey "No Link Established" kIOPropertyPortTopologyAutomaticKey "Automatic" kIOPropertyPortTopologyAutomaticNLPortKey "Automatic (NL_Port)" kIOPropertyPortTopologyAutomaticNPortKey "Automatic (N_Port)" kIOPropertyPortTopologyKey "Port Topology" kIOPropertyPortTopologyNLPortKey "NL_Port" kIOPropertyPortTopologyNPortKey "N_Port" kIOPropertyProtocolCharacteristicsKey "Protocol Characteristics" kIOPropertySASAddressKey "SAS Address" kIOPropertySCSIDomainIdentifierKey "SCSI Domain Identifier" kIOPropertySCSIInitiatorIdentifierKey "SCSI Initiator Identifier" kIOPropertySCSILogicalUnitNumberKey "SCSI Logical Unit Number" kIOPropertySCSIParallelSignalingTypeHVDKey "High Voltage Differential" kIOPropertySCSIParallelSignalingTypeKey "SCSI Parallel Signaling Type" kIOPropertySCSIParallelSignalingTypeLVDKey "Low Voltage Differential" kIOPropertySCSIParallelSignalingTypeSEKey "Single Ended" kIOPropertySCSIPortIdentifierKey "Unique SCSI Port Identifier" kIOPropertySCSIProtocolMultiInitKey "Multiple Initiators" kIOPropertySCSITargetIdentifierKey "SCSI Target Identifier"
1076
Constants
kIOPropertyExternalKey
This key defines the value of External for the key kIOPropertyPhysicalInterconnectLocationKey. If the device is connected to an external bus, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> </dict> </dict>
1077
kIOPropertyFibreChannelAddressIdentifierKey
This key is the 24-bit Address Identifier (S_ID or D_ID) as defined in the FC-FS specification. It contains the address identifier of the source or destination Nx_Port. Note: This value can change. It is not a static value. Requirement: Optional (only necessary for Fibre Channel Interface). Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> <key>Address Identifier</key> <data>001122</data> </dict> </dict>
Example2:
1078
kIOPropertyFibreChannelALPAKey
This key is the 8-bit Arbitrated Loop Physical Address (AL_PA) value as defined in the FC-AL-2 specification. Note: This value can change. It is not a static value. Requirement: Optional (only necessary for Fibre Channel Interface). Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> <key>AL_PA</key> <data>04</data> </dict> </dict>
Example2:
1079
kIOPropertyFibreChannelCableDescriptionCopperKey
This key defines the value of Copper for the key kIOPropertyFibreChannelCableDescriptionKey. If the cabling is Copper, this key should be used. Requirement: Optional for Fibre Channel Interface interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Fibre Channel Cabling Type</key> <string>Copper</string> </dict> </dict>
This key defines the value of Fiber Optic for the key kIOPropertyFibreChannelCableDescriptionKey. If the cabling is Fiber Optic, this key should be used. Requirement: Optional for Fibre Channel Interface interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Fibre Channel Cabling Type</key> <string>Fiber Optic</string> </dict> </dict>
1080
kIOPropertyFibreChannelCableDescriptionKey
This key is associated with the cabling type used for this Fibre Channel port. Valid values include "Copper" and "Fiber Optic". Requirement: Optional for Fibre Channel Interface. Not defined for any other physical interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Fibre Channel Cabling Type</key> <string>Copper</string> </dict> </dict>
1081
kIOPropertyFibreChannelNodeWorldWideNameKey
This key is the unique 64-bit World Wide Name for the device server node located at this port, or for the initiating host port. Requirement: Mandatory for Fibre Channel Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> <key>Node World Wide Name</key> <data>0011223344556677</data> </dict> </dict>
Example2:
<dict> <key>Controller Characteristics</key> <dict> <key>Node World Wide Name</key> <data>0011223344556677</data> </dict> </dict>
1082
kIOPropertyFibreChannelPortWorldWideNameKey
This key is the unique 64-bit World Wide Name for the port. Requirement: Mandatory for Fibre Channel Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> <key>Port World Wide Name</key> <data>0011223344556677</data> </dict> </dict>
Example2:
<dict> <key>Controller Characteristics</key> <dict> <key>Port World Wide Name</key> <data>0011223344556677</data> </dict> </dict>
1083
kIOPropertyInterconnectFileKey
This key defines the value of File for the key kIOPropertyPhysicalInterconnectLocationKey. If the device is a file that is being represented as a storage device, this key should be set. NOTE: This key should only be used when the Physical Interconnect is set to Virtual Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Virtual Interface</string> <key>Physical Interconnect Location</key> <string>File</string> </dict> </dict>
This key defines the value of RAM for the key kIOPropertyPhysicalInterconnectLocationKey. If the device is system memory that is being represented as a storage device, this key should be set. NOTE: This key should only be used when the Physical Interconnect is set to Virtual Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Virtual Interface</string> <key>Physical Interconnect Location</key> <string>RAM</string> </dict> </dict>
1084
kIOPropertyInternalExternalKey
This key defines the value of Internal/External for the key kIOPropertyPhysicalInterconnectLocationKey. If the device is connected to a bus and it is indeterminate whether it is internal or external, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>Internal/External</string> </dict> </dict>
This key defines the value of Internal for the key kIOPropertyPhysicalInterconnectLocationKey. If the device is connected to an internal bus, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>ATA</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
1085
kIOPropertyPhysicalInterconnectLocationKey
This key is used to define the Physical Interconnect Location. Requirement: Mandatory. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
This key defines the value of ATA for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to an ATA bus, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>ATA</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
1086
kIOPropertyPhysicalInterconnectTypeATAPI
This key defines the value of ATAPI for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to an ATA bus and follows the ATAPI command specification, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>ATAPI</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
This key defines the value of Fibre Channel Interface for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to a Fibre Channel port, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> </dict> </dict>
1087
kIOPropertyPhysicalInterconnectTypeFireWire
This key defines the value of USB for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to a FireWire port, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>FireWire</string> <key>Physical Interconnect Location</key> <string>External</string> </dict> </dict>
This key is used to define the Physical Interconnect to which a device is attached. Requirement: Mandatory. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
1088
kIOPropertyPhysicalInterconnectTypeSCSIParallel
This key defines the value of SCSI Parallel Interface for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to a SCSI Parallel port, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> </dict> </dict>
This key defines the value of Secure Digital for the key kIOPropertyPhysicalInterconnectTypeSecureDigital. If the device is connected to a Secure Digital port and follows the Secure Digital specification, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Secure Digital</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
1089
kIOPropertyPhysicalInterconnectTypeSerialATA
This key defines the value of SATA for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to a SATA bus, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SATA</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
This key defines the value of SAS for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to a SAS bus, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SAS</string> <key>Physical Interconnect Location</key> <string>External</string> </dict> </dict>
1090
kIOPropertyPhysicalInterconnectTypeUSB
This key defines the value of USB for the key kIOPropertyPhysicalInterconnectTypeKey. If the device is connected to a USB port, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>USB</string> <key>Physical Interconnect Location</key> <string>External</string> </dict> </dict>
This key defines the value of Virtual Interface for the key kIOPropertyPhysicalInterconnectTypeVirtual. If the device is being made to look like a storage device, but is not such in actuality, such as a File or RAM, this key should be set. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Virtual Interface</string> <key>Physical Interconnect Location</key> <string>File</string> </dict> </dict>
1091
kIOPropertyPortDescriptionKey
This key is associated with an human readable port description. Examples include "Channel A", "Port 1", etc. Requirement: Optional for all interconnects. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Description</key> <string>Channel A</string> </dict> </dict>
This key defines the value of 10 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 10 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>10 Gigabit</string> </dict> </dict>
1092
kIOPropertyPortSpeed12GigabitKey
This key defines the value of 12 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 12 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>12 Gigabit</string> </dict> </dict>
This key defines the value of 16 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 16 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>16 Gigabit</string> </dict> </dict>
1093
kIOPropertyPortSpeed1_5GigabitKey
This key defines the value of 1.5 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 1.5 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>1.5 Gigabit</string> </dict> </dict>
This key defines the value of 1 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 1 Gigabit per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>1 Gigabit</string> </dict> </dict>
1094
kIOPropertyPortSpeed2GigabitKey
This key defines the value of 2 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 2 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>2 Gigabit</string> </dict> </dict>
This key defines the value of 3 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 3 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>3 Gigabit</string> </dict> </dict>
1095
kIOPropertyPortSpeed40GigabitKey
This key defines the value of 40 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 40 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>40 Gigabit</string> </dict> </dict>
This key defines the value of 4 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 4 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>4 Gigabit</string> </dict> </dict>
1096
kIOPropertyPortSpeed6GigabitKey
This key defines the value of 6 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 6 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>6 Gigabit</string> </dict> </dict>
This key defines the value of 8 Gigabit for the key kIOPropertyPortSpeedKey. If the speed of the port is 8 Gigabits per second and is not automatically determined (i.e. the user configured the port to be exactly this speed), this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>8 Gigabit</string> </dict> </dict>
1097
kIOPropertyPortSpeedAutomatic10GigabitKey
This key defines the value of Automatic (10 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 10 Gigabits per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (10 Gigabit)</string> </dict> </dict>
This key defines the value of Automatic (1.5 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 1.5 Gigabits per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (1.5 Gigabit)</string> </dict> </dict>
1098
kIOPropertyPortSpeedAutomatic1GigabitKey
This key defines the value of Automatic (1 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 1 Gigabit per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (1 Gigabit)</string> </dict> </dict>
This key defines the value of Automatic (2 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 2 Gigabits per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (2 Gigabit)</string> </dict> </dict>
1099
kIOPropertyPortSpeedAutomatic3GigabitKey
This key defines the value of Automatic (3 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 3 Gigabits per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (3 Gigabit)</string> </dict> </dict>
This key defines the value of Automatic (4 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 4 Gigabits per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (4 Gigabit)</string> </dict> </dict>
1100
kIOPropertyPortSpeedAutomatic6GigabitKey
This key defines the value of Automatic (6 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 6 Gigabits per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (6 Gigabit)</string> </dict> </dict>
This key defines the value of Automatic (8 Gigabit) for the key kIOPropertyPortSpeedKey. If the speed of the port is 8 Gigabits per second and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (8 Gigabit)</string> </dict> </dict>
1101
kIOPropertyPortSpeedAutomaticKey
This key defines the value of Automatic for the key kIOPropertyPortSpeedKey. If the speed of the port is automatically adjusted by the host/device and a definitive speed is not known, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
This key is associated with the current port speed. The port speed can be any valid speed for the interconnect. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Speed</key> <string>Automatic (1 Gigabit)</string> </dict> </dict>
1102
kIOPropertyPortStatusKey
This key is associated with the current port status of the physical link. The port status is either "Link Established", "No Link Established", or "Link Failed". Note: This value can change when the port status changes. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Status</key> <string>Link Established</string> </dict> </dict>
This key defines the value of Link Established for the key kIOPropertyPortStatusKey. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Status</key> <string>Link Established</string> </dict> </dict>
1103
kIOPropertyPortStatusLinkFailedKey
This key defines the value of Link Failed for the key kIOPropertyPortStatusKey. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Status</key> <string>Link Failed</string> </dict> </dict>
This key defines the value of No Link Established for the key kIOPropertyPortStatusKey. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Status</key> <string>No Link Established</string> </dict> </dict>
1104
kIOPropertyPortTopologyAutomaticKey
This key defines the value of Automatic for the key kIOPropertyPortTopologyKey. If the topology of the port is automatically adjusted by the host/device and a definitive topology is not known, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
This key defines the value of Automatic (NL_Port) for the key kIOPropertyPortTopologyKey. If the topology of the port is NL_Port and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Topology</key> <string>Automatic (NL_Port)</string> </dict> </dict>
1105
kIOPropertyPortTopologyAutomaticNPortKey
This key defines the value of Automatic (N_Port) for the key kIOPropertyPortTopologyKey. If the topology of the port is N_Port and is automatically determined by host software, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Topology</key> <string>Automatic (N_Port)</string> </dict> </dict>
This key is associated with the current port topology. The port topology can be any valid topology for the interconnect. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>Port Topology</key> <string>Automatic (N_Port)</string> </dict> </dict>
1106
kIOPropertyPortTopologyNLPortKey
This key defines the value of NL_Port for the key kIOPropertyPortTopologyKey. If the topology of the port is an NL_Port, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
This key defines the value of N_Port for the key kIOPropertyPortTopologyKey. If the topology of the port is an N_Port, this key should be used. Note: This value can change. It is not a static value. Requirement: Optional for any interconnect. Example:
1107
kIOPropertyProtocolCharacteristicsKey
This key is used to define Protocol Characteristics for a particular protocol and it has an associated dictionary which lists the protocol characteristics. Requirement: Mandatory Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>ATAPI</string> <key>Physical Interconnect Location</key> <string>Internal</string> </dict> </dict>
1108
kIOPropertySASAddressKey
This key is the unique 64-bit SAS Address for the device server node located at this port, or for the initiating host port. Requirement: Mandatory for SAS. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SAS</string> <key>Physical Interconnect Location</key> <string>External</string> <key>SAS Address</key> <data>0011223344556677</data> </dict> </dict>
Example2:
1109
kIOPropertySCSIDomainIdentifierKey
An identifier that will uniquely identify this SCSI Domain for the Physical Interconnect type. This identifier is only guaranteed to be unique for any given Physical Interconnect and is not guaranteed to be the same across restarts or shutdowns. Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>Internal</string> <key>SCSI Domain Identifier</key> <integer>0</integer> </dict> </dict>
An identifier that will uniquely identify this SCSI Initiator for the SCSI Domain. Requirement: Mandatory for SCSI Parallel Interface, SAS, and Fibre Channel Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>Internal</string> <key>SCSI Initiator Identifier</key> <integer>7</integer> </dict> </dict>
1110
kIOPropertySCSILogicalUnitNumberKey
This key is the SCSI Logical Unit Number for the device server controlled by the driver. Requirement: Mandatory for SCSI Parallel Interface, SAS, and Fibre Channel Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>Internal</string> <key>SCSI Logical Unit Number</key> <integer>2</integer> </dict> </dict>
This key defines the value of High Voltage Differential for the key kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is High Voltage Differential, this key should be used. Requirement: Optional for SCSI Parallel Interface interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>SCSI Parallel Signaling Type</key> <string>High Voltage Differential</string> </dict> </dict>
1111
kIOPropertySCSIParallelSignalingTypeKey
This key is associated with the signaling type used for this SCSI Parallel bus. Valid values include "High Voltage Differential", "Low Voltage Differential", and "Single Ended". Requirement: Optional for SCSI Parallel Interface. Not defined for any other physical interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>SCSI Parallel Signaling Type</key> <string>High Voltage Differential</string> </dict> </dict>
This key defines the value of Low Voltage Differential for the key kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is Low Voltage Differential, this key should be used. Requirement: Optional for SCSI Parallel Interface interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>SCSI Parallel Signaling Type</key> <string>Low Voltage Differential</string> </dict> </dict>
1112
kIOPropertySCSIParallelSignalingTypeSEKey
This key defines the value of Single Ended for the key kIOPropertySCSIParallelSignalingTypeKey. If the signaling type of the port is Single Ended, this key should be used. Requirement: Optional for SCSI Parallel Interface interconnect. Example:
<dict> <key>Controller Characteristics</key> <dict> <key>SCSI Parallel Signaling Type</key> <string>Single Ended</string> </dict> </dict>
1113
kIOPropertySCSIPortIdentifierKey
This key is the unique port identifier for the device server node located at this port, or for the initiating host port. The format for this data is allowed to be vendor-specific, as long as it is guaranteed to be unique. Length is arbitrary, to allow for itnerfaces with non-standard identifier rules. It is recommended to have this be a copy of an existing standard unique identifier for this port, should one already exist for your interface type Requirement: Mandatory. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> <key>Node World Wide Name</key> <data>0011223344556677</data> <key>Unique SCSI Port Identifier</key> <data>0011223344556677</data> </dict> </dict>
Example2:
<dict> <key>Controller Characteristics</key> <dict> <key>Unique SCSI Port Identifier</key> <data>0011223344556677</data> </dict> </dict>
1114
kIOPropertySCSIProtocolMultiInitKey
This protocol characteristics key is used to inform the system that the protocol supports having multiple devices that act as initiators. Requirement: Optional. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>Fibre Channel Interface</string> <key>Physical Interconnect Location</key> <string>External</string> <key>Multiple Initiators</key> <string>True</string> </dict> </dict>
This is the SCSI Target Identifier for a given SCSI Target Device. Requirement: Mandatory for SCSI Parallel Interface and Fibre Channel Interface. Example:
<dict> <key>Protocol Characteristics</key> <dict> <key>Physical Interconnect</key> <string>SCSI Parallel Interface</string> <key>Physical Interconnect Location</key> <string>Internal</string> <key>SCSI Target Identifier</key> <integer>3</integer> </dict> </dict>
1115
IOStreamLib.h Reference
Declared in
IOStreamLib.h
Overview
IOCFPlugin library for using IOStream objects. The IOStream plugin provides a convenient set of functions for accessing and manipulating IOStream objects from user programs.
Included Headers
Functions by Task
See the Overview for header-level documentation.
Gets a CFRunLoopSource for the CFMachPort used for notifications from the kernel that data is ready.
RemoveFromRunLoop (page 1126)
Remove the CFRunLoopSource for the notification port from a run loop.
1116
Closes an IOStream.
Open (page 1126)
Notifications
SendInputNotification (page 1127)
Send a notification to the kernel side of the IOStream that data is available in the input queue.
SendInputSyncNotification (page 1127)
Notify the kernel side of the stream that input is ready by using a fast trap to call directly into the stream user client driver. This will transfer control to the kernel and continue executing on your same thread, rather than sending the notification to a separate thread.
Get the notification port for buffers moving in from user to kernel space.
GetInputQueue (page 1124)
Get the shared memory queue for buffers moving in from user to kernel space.
GetOutputPort (page 1124)
Get the notification port for buffers moving out from kernel to user space.
GetOutputQueue (page 1125)
Get the shared memory queue for buffers moving out from kernel to user space.
SetOutputCallback (page 1128)
Set the callback function to be called when a new buffer is available from the kernel.
Send a buffer to the kernel side of the IOStream on the input queue.
1117
Buffer information
GetBufferCount (page 1121)
1118
Functions
AddToRunLoop
Add the CFRunLoopSource for the notification port to a run loop.
Parameters
stream
The run loop to which to add the notification source. Return Value Returns kIOReturnSuccess if the source was successfully added to the run loop.
Close
Closes an IOStream.
Parameters
stream
The IOStreamRef of the stream to close. Return Value Returns kIOReturnSuccess if the stream was successfully closed and the buffers unmapped. Discussion Calling Close umaps all shared memory for the stream and frees all user resources used by the stream.
DequeueOutputEntry
Get the next IOStreamBufferQueueEntry available from the output queue.
1119
Parameters
stream
A pointer to an IOStreamBufferQueueEntry structure. The next available entry from the output queue will be copied into it. Return Value The IOStreamBufferID of the next available buffer, or kInvalidIOStreamBufferID if no buffer is in the queue.
EnqueueInputBuffer
Send a buffer to the kernel side of the IOStream on the input queue.
IOReturn ( *EnqueueInputBuffer)( IOStreamRef stream, IOStreamBufferID bufferID, IOByteCount dataOffset, IOByteCount dataLength, IOByteCount controlOffset, IOByteCount controlLength );
Parameters
stream
The length of the valid data in the buffer. Return Value Returns kIOReturnSuccess if the buffer was successfully placed on the input queue.
1120
EnqueueInputEntry
GetBufferCount
Gets the number of buffers in the stream.
Parameters
stream
The IOStreamRef of the stream to operate on. Return Value Returns then number of buffers in the stream.
GetBufferInfo
Gets information about a buffer in an IOStream.
IOReturn ( *GetBufferInfo)( IOStreamRef stream, IOStreamBufferID bufferID, void **dataBufferAddressOut, IOByteCount *dataBufferSizeOut, void **controlBufferAddressOut, IOByteCount *controlBufferSizeOut );
Parameters
stream
1121
GetControlBuffer
Get a pointer to the control area of an IOStreamBuffer.
Parameters
stream
The IOStreamBufferID of the buffer to operate on. Return Value A pointer to the control buffer area of the IOStreamBuffer, or NULL if it does not have a control buffer.
GetControlBufferLength
Get the length of the control area of an IOStreamBuffer.
Parameters
stream
1122
Return Value The length in bytes of the control buffer, or 0 if there is no control buffer.
GetDataBuffer
Get a pointer to the data area of an IOStreamBuffer.
Parameters
stream
The IOStreamBufferID of the buffer to operate on. Return Value A pointer to the data buffer area of the IOStreamBuffer, or NULL if it does not have a data buffer.
GetDataBufferLength
Get the length of the data area of an IOStreamBuffer.
Parameters
stream
The IOStreamBufferID of the buffer to operate on. Return Value The length in bytes of the data buffer, or 0 if there is no data buffer.
1123
GetInputPort
Get the notification port for buffers moving in from user to kernel space.
Parameters
stream
The IOStreamRef of the stream to operate on. Return Value A CFMachPortRef for the input notification port.
GetInputQueue
Get the shared memory queue for buffers moving in from user to kernel space.
Parameters
stream
The IOStreamRef of the stream to operate on. Return Value A pointer to the shared memory IOStreamBufferQueue structure for the input queue. Discussion If you use the notification functions, you should never need to access the queues directly.
GetMode
GetOutputPort
Get the notification port for buffers moving out from kernel to user space.
1124
Parameters
stream
The IOStreamRef of the stream to operate on. Return Value A CFMachPortRef of the output notification port.
GetOutputQueue
Get the shared memory queue for buffers moving out from kernel to user space.
Parameters
stream
The IOStreamRef of the stream to operate on. Return Value A pointer to the shared memory IOStreamBufferQueue structure for the output queue. Discussion If you use the notification functions, you should never need to access the queues directly.
GetRunLoopSource
Gets a CFRunLoopSource for the CFMachPort used for notifications from the kernel that data is ready.
Parameters
stream
The IOStreamRef of the stream to operate on. Return Value The CFRunLoopSourceRef for the run loop source, or NULL if there was an error creating the source.
1125
Open
Open an IOStream from user space.
Parameters
stream
Open options. Currently unused. Return Value If the stream could not be opened or the buffers could not be mapped, an error will be returned. Discussion The Open function opens the stream and maps the memory for the shared input and output queues into the current task, as well as the memory for all the buffers in the queue. It also creates the notification ports for input and output.
RemoveFromRunLoop
Remove the CFRunLoopSource for the notification port from a run loop.
Parameters
stream
The run loop from which to remove the notification source. Return Value Returns kIOReturnSuccess if the source was successfully removed from the run loop.
1126
SendInputNotification
Send a notification to the kernel side of the IOStream that data is available in the input queue.
Parameters
stream
A value to pass to the stream's notification function. This is unused by IOStream but may be used by subclasses. Return Value Returns kIOReturnSuccess if the notification was successfully sent.
SendInputSyncNotification
Notify the kernel side of the stream that input is ready by using a fast trap to call directly into the stream user client driver. This will transfer control to the kernel and continue executing on your same thread, rather than sending the notification to a separate thread.
Parameters
stream
A value to pass to the stream's notification function. This is unused by IOStream but may be used by subclasses. Return Value Returns kIOReturnSuccess if the notification was successfully sent.
1127
SetMode
SetOutputCallback
Set the callback function to be called when a new buffer is available from the kernel.
Parameters
stream
The IOStreamRef of the stream to operate on. Pass NULL to remove the callback. Return Value Returns kIOReturnSuccess if the callback was successfully set or removed.
StartStream
StopStream
SuspendStream
1128
Callbacks
See the Overview for header-level documentation.
IOStreamCallback
See Also
IOStreamOutputCallback (page 1129)
IOStreamOutputCallback
Declared in
IOStreamLib.h
Data Types
See the Overview for header-level documentation.
IOStreamRef
1129
Declared in
IOStreamLib.h
1130
Declared in
IOStreamShared.h
Overview
IOStream definitions shared between kernel and user space.
Included Headers
<sys/cdefs.h> <IOKit/IOTypes.h>
Data Types
See the Overview for header-level documentation.
IOStreamBufferID
IOStreamBufferQueue
1131
Fields
entryCount
The index of the next queue slot that will be filled in by the queue writer.
tailIndex
The index of the next queue slot that can be read by the queue reader.
reserved
IOStreamBufferQueueEntry
struct IOStreamBufferQueueEntry { IOStreamBufferID bufferID; UInt32 dataOffset; UInt32 dataLength; UInt32 controlOffset; UInt32 controlLength; UInt32 reserved[3]; };
Fields
bufferID
1132
Constants
See the Overview for header-level documentation.
Constants
kIOStreamPortTypeOutput
enum { kIOStreamMemoryTypeOutputQueue = 0x10000000, kIOStreamMemoryTypeInputQueue = 0x20000000, kIOStreamMemoryTypeBufferData = 0x30000000, kIOStreamMemoryTypeBufferControl = 0x40000000, kIOStreamBufferIDMask = 0x0FFFFFFF, kIOStreamMemoryTypeMask = 0xF0000000 };
1133
Constants
kIOStreamMemoryTypeOutputQueue
Constants
kIOStreamMethodOpen
1134
kIOStreamMethodClose
Constants
kIOStreamEnqueueInputTrap
1135
Declared in
IOTypes.h
Overview
Included Headers
Constants
See the Overview for header-level documentation.
Scale Factors
enum { kNanosecondScale = 1, kMicrosecondScale = 1000, kMillisecondScale = 1000 * 1000, kSecondScale = 1000 * 1000 * 1000, kTickScale = ( kSecondScale / 100) };
1136
Constants
kNanosecondScale
Scale factor for nanosecond based times. Available in OS X v10.0 and later. Declared in IOTypes.h.
kMicrosecondScale
Scale factor for microsecond based times. Available in OS X v10.0 and later. Declared in IOTypes.h.
kMillisecondScale
Scale factor for millisecond based times. Available in OS X v10.0 and later. Declared in IOTypes.h.
kTickScale
Scale factor for the standard (100Hz) tick. Available in OS X v10.4 and later. Declared in IOTypes.h.
kSecondScale
Scale factor for second based times. Available in OS X v10.0 and later. Declared in IOTypes.h. Discussion Used when a scale_factor parameter is required to define a unit of time.
1137
IOUPSPlugIn.h Reference
Declared in
IOUPSPlugIn.h
Overview
IOUPSPlugIn.h is the header that defines the software used by ioupsd in user-space to communicate with UPS devices. NOTE: Kernel extensions should have the following key/value pair in their personality in order to be recognized by ioupsd:
<key>UPSDevice<key> <true/>
To communicate with a UPS device, an instance of IOUPSPlugInInterface (a struct which is defined below) is created. The methods of IOUPSPlugInInterface allow ioupsd to communicate with the device. To obtain an IOUPSPlugInInterface for a UPS device, use the function IOCreatePlugInInterfaceForService() defined in IOKit/IOCFPlugIn.h. (Note the "i" in "PlugIn" is always upper-case.) Quick usage reference:
'service' is a reference to the IOKit registry entry of the kernel object (usually of type IOHIDDevice) representing the device of interest. This reference can be obtained using the functions defined in IOKit/IOKitLib.h. 'plugInType' should be CFUUIDGetUUIDBytes(kIOCFPlugInInterfaceID) 'interfaceType' should be CFUUIDGetUUIDBytes(kIOUPSPlugInTypeID) when using IOUPSPlugIn
The interface returned by IOCreatePlugInInterfaceForService() should be deallocated using IODestroyPlugInInterface(). Do not call Release() on it.
1138
Included Headers
<CoreFoundation/CoreFoundation.h> <IOKit/IOCFPlugIn.h>
Callbacks
See the Overview for header-level documentation.
IOUPSEventCallbackFunction
typedef void ( *IOUPSEventCallbackFunction) ( void *target, IOReturn result, void *refcon, void *sender, CFDictionaryRef event);
Parameters
target
CFDictionaryRef containing event data. Discussion Type and arguments of callout C function that is used when a completion routine is called. This function pointer is set via setEventCallback and is called when an event is available from the UPS. Availability Available in OS X v10.3 and later. Declared in
IOUPSPlugIn.h
1139
Constants
See the Overview for header-level documentation.
Defines
#define kIOUPSPlugInInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x63, 0xf8, 0xbf, 0xc4, 0x26, 0xa0, 0x11, 0xd8, \ 0x88, 0xb4, 0x0, 0xa, 0x95, 0x8a, 0x2c, 0x78) #define kIOUPSPlugInInterfaceID_v140 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0xe6, 0xe, 0x7, 0x99, 0x9a, 0xa6, 0x49, 0xdf, \ 0xb5, 0x5b, 0xa5, 0xc9, 0x4b, 0xa0, 0x7a, 0x4a) #define kIOUPSPlugInTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \
1140
0x40, 0xa5, 0x7a, 0x4e, 0x26, 0xa0, 0x11, 0xd8, \ 0x92, 0x95, 0x00, 0x0a, 0x95, 0x8a, 0x2c, 0x78)
Constants
kIOUPSPlugInInterfaceID
Interface ID for the IOUPSPlugInInterface. Corresponds to an available UPS device. Available in OS X v10.3 and later. Declared in IOUPSPlugIn.h.
kIOUPSPlugInInterfaceID_v140
Interface ID for the IOUPSPlugInInterface. Corresponds to an available UPS device. Available in OS X v10.4 and later. Declared in IOUPSPlugIn.h.
kIOUPSPlugInTypeID
Type ID for the IOUPSPlugInInterface. Corresponds to an available UPS device. Available in OS X v10.3 and later. Declared in IOUPSPlugIn.h.
1141
IOUSBLib.h Reference
Declared in
IOUSBLib.h
Overview
This documentation describes the details of the programming interface for accessing USB devices and USB interfaces from code running in user space. This documentation assumes that you have a basic understanding of the material contained in Accessing Hardware From Applications For definitions of I/O Kit terms used in this documentation, such as matching dictionary, family, and driver, see the overview of I/O Kit terms and concepts in the "Device Access and the I/O Kit" chapter of Accessing Hardware From Applications . This documentation also assumes you have read Working With USB Device Interfaces . Please review that document before using this reference. All of the information described in this document is contained in the header file IOUSBLib.h found at /System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h.
Included Headers
Functions
See the Overview for header-level documentation.
1142
FindNextAltInterface
Parameters
self
specifies what properties an interface must have to match. Return Value Pointer to a matching interface descriptor, or NULL if none match. Discussion return alternate interface descriptor satisfying the requirements specified in request, or NULL if there aren't any. discussion request is updated with the properties of the returned interface.
FindNextAssociatedDescriptor
Find the next descriptor of the requested type associated with the interface.
Parameters
self
1143
Return Value Pointer to the descriptor, or NULL if no matching descriptors found. Discussion The interface does not have to be open to use this function.
GetBusFrameNumberWithTime
Gets a recent frame number of the bus to which the device is attached, along with a system time corresponding to the start of that frame
Parameters
self
Pointer to a returned AbsoluteTime, which is the system time ("wall time") as close as possible to the beginning of that USB frame. The jitter on this value may be as much as 200 microseconds. Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnUnsupported is the bus doesn't support this function. Discussion The device does not have to be open to use this function.
GetPipePropertiesV2
Gets the properties for a pipe, including the USB SuperSpeed endpoint companion properties.
1144
UInt8 *direction, UInt8 *number, UInt8 *transferType, UInt16 *maxPacketSize, UInt8 *interval, UInt8 *maxBurst, UInt8 *mult, UInt16 *bytesPerInterval);
Parameters
self
Pointer to an UInt8 to get the interval for polling the pipe for data (in milliseconds).
maxBurst
Pointer to an UInt8 to get the bMaxBurst value of the SuperSpeed Endpoint Companion descriptor
mult
Pointer to an UInt8 to get the mult value of the bmAttributes field of the SuperSpeed Endpoint Companion descriptor, valid only for an isochronous endpoint
bytesPerInterval
Pointer to an UInt16 to get the wBytesPerInterval value of the SuperSpeed Endpoint Companion descriptor, valid only for periodic endpoints Return Value Returns kIOReturnSuccess if successful, kIOReturnNoDevice if there is no connection to an IOService, or kIOReturnNotOpen if the interface is not open for exclusive access.
1145
Discussion Once an interface is opened, all of the pipes in that interface get created by the kernel. The number of pipes can be retrieved by GetNumEndpoints. The client can then get the properties of any pipe using an index of 1 to GetNumEndpoints. Pipe 0 is the default control pipe in the device.
Constants
See the Overview for header-level documentation.
Defines
#define kIOUSBDeviceInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x5c, 0x81, 0x87, 0xd0, 0x9e, 0xf3, 0x11, 0xD4, \ 0x8b, 0x45, 0x00, 0x0a, 0x27, 0x05, 0x28, 0x61) #define kIOUSBDeviceInterfaceID182 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x15, 0x2f, 0xc4, 0x96, 0x48, 0x91, 0x11, 0xD5, \ 0x9d, 0x52,
1146
0x00, 0x0a, 0x27, 0x80, 0x1e, 0x86) #define kIOUSBDeviceInterfaceID187 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x3C, 0x9E, 0xE1, 0xEB, 0x24, 0x02, 0x11, 0xB2, \ 0x8E, 0x7E, 0x00, 0x0A, 0x27, 0x80, 0x1E, 0x86) #define kIOUSBDeviceInterfaceID197 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0xC8, 0x09, 0xB8, 0xD8, 0x08, 0x84, 0x11, 0xD7, \ 0xBB, 0x96, 0x00, 0x03, 0x93, 0x3E, 0x3E, 0x3E) #define kIOUSBDeviceInterfaceID245 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0xFE, 0x2F, 0xD5,
1147
0x2F, 0x3B, 0x5A, 0x47, 0x3B, \ 0x97, 0x7B, 0xAD, 0x99, 0x00, 0x1E, 0xB3, 0xED) #define kIOUSBDeviceInterfaceID300 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x39, 0x61, 0x04, 0xF7, 0x94, 0x3D, 0x48, 0x93, \ 0x90, 0xF1, 0x69, 0xBD, 0x6C, 0xF5, 0xC2, 0xEB) #define kIOUSBDeviceInterfaceID320 CFUUIDGetConstantUUIDWithBytes(kCFAllocatorSystemDefault, \ 0x01, 0xA2, 0xD0, 0xE9, 0x42, 0xF6, 0x4A, 0x87, \ 0x8B, 0x8B, 0x77, 0x05,
1148
0x7C, 0x8C, 0xE0, 0xCE) #define kIOUSBDeviceInterfaceID500 CFUUIDGetConstantUUIDWithBytes(kCFAllocatorSystemDefault, \ 0xA3, 0x3C, 0xF0, 0x47, 0x4B, 0x5B, 0x48, 0xE2, \ 0xB5, 0x7D, 0x02, 0x07, 0xFC, 0xEA, 0xE1, 0x3B) #define kIOUSBDeviceUserClientTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x9d, 0xc7, 0xb7, 0x80, 0x9e, 0xc0, 0x11, 0xD4, \ 0xa5, 0x4f, 0x00, 0x0a, 0x27, 0x05, 0x28, 0x61) #define kIOUSBFactoryID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x45, 0x47, 0xa8, 0xaa,
1149
0x9e, 0xf3, 0x11, 0xD4, \ 0xa9, 0xbd, 0x00, 0x0a, 0x27, 0x05, 0x28, 0x61) #define kIOUSBInterfaceInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x73, 0xc9, 0x7a, 0xe8, 0x9e, 0xf3, 0x11, 0xD4, \ 0xb1, 0xd0, 0x00, 0x0a, 0x27, 0x05, 0x28, 0x61) #define kIOUSBInterfaceInterfaceID182 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x49, 0x23, 0xac, 0x4c, 0x48, 0x96, 0x11, 0xD5, \ 0x92, 0x08, 0x00, 0x0a, 0x27, 0x80,
1150
0x1e, 0x86) #define kIOUSBInterfaceInterfaceID183 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x1c, 0x43, 0x83, 0x56, 0x74, 0xc4, 0x11, 0xD5, \ 0x92, 0xe6, 0x00, 0x0a, 0x27, 0x80, 0x1e, 0x86) #define kIOUSBInterfaceInterfaceID190 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x8f, 0xdb, 0x84, 0x55, 0x74, 0xa6, 0x11, 0xD6, \ 0x97, 0xb1, 0x00, 0x30, 0x65, 0xd3, 0x60, 0x8e) #define kIOUSBInterfaceInterfaceID192 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x6C, 0x79, 0x8A, 0x6E, 0xD6, 0xE9, 0x11,
1151
0xD6, \ 0xAD, 0xD6, 0x00, 0x03, 0x93, 0x3E, 0x3E, 0x3E) #define kIOUSBInterfaceInterfaceID197 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0xC6, 0x3D, 0x3C, 0x92, 0x08, 0x84, 0x11, 0xD7, \ 0x96, 0x92, 0x00, 0x03, 0x93, 0x3E, 0x3E, 0x3E) #define kIOUSBInterfaceInterfaceID220 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x77, 0x0D, 0xE6, 0x0C, 0x2F, 0xE8, 0x11, 0xD8, \ 0xA5, 0x82, 0x00, 0x03, 0x93, 0xDC, 0xB1, 0xD0) #define kIOUSBInterfaceInterfaceID245 CFUUIDGetConstantUUIDWithBytes(NULL,
1152
\ 0x64, 0xBA, 0xBD, 0xD2, 0x0F, 0x6B, 0x4B, 0x4F, \ 0x8E, 0x3E, 0xDC, 0x36, 0x04, 0x69, 0x87, 0xAD) #define kIOUSBInterfaceInterfaceID300 CFUUIDGetConstantUUIDWithBytes(NULL, \ 0xBC, 0xEA, 0xAD, 0xDC, 0x88, 0x4D, 0x4F, 0x27, \ 0x83, 0x40, 0x36, 0xD6, 0x9F, 0xAB, 0x90, 0xF6) #define kIOUSBInterfaceInterfaceID500 CFUUIDGetConstantUUIDWithBytes(kCFAllocatorSystemDefault, \ 0x6C, 0x0D, 0x38, 0xC3, 0xB0, 0x93, 0x4E, 0xA7, \
1153
0x80, 0x9B, 0x09, 0xFB, 0x5D, 0xDD, 0xAC, 0x16) #define kIOUSBInterfaceUserClientTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x2d, 0x97, 0x86, 0xc6, 0x9e, 0xf3, 0x11, 0xD4, \ 0xad, 0x51, 0x00, 0x0a, 0x27, 0x05, 0x28, 0x61)
1154
Constants
kIOUSBDeviceInterfaceID
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBDeviceInterface is returned by all versions of the IOUSBFamily currently shipping. However, there are some functions that are available only in IOUSBFamily version 1.8.2 and above. Access to these functions, in addition to the functions contained in IOUSBDeviceInterface, can be obtained by using one of the other UUIDs listed in this header. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID), (LPVoid)&dev);
1155
kIOUSBDeviceInterfaceID182
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface182. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBDeviceInterface182 is returned only by version 1.8.2 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.0.4. If your software is running on an earlier version of OS X, you will need to use the UUID kIOUSBDeviceInterfaceID and you will not have access to some functions. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface182 **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID182), (LPVoid)&dev);
1156
kIOUSBDeviceInterfaceID187
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface187. This device interface is obtained after the device interface for the service itself has been obtained (see kIOUSBDeviceUserClientTypeID ). Note: The IOUSBDeviceInterface187 is returned only by version 1.8.7 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.1.2. If your software is running on an earlier version of OS X you will need to use UUID kIOUSBDeviceInterfaceID or kIOUSBDeviceInterfaceID182 and you will not have access to some functions. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface187 **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID187), (LPVoid)&dev);
1157
kIOUSBDeviceInterfaceID197
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface197. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBDeviceInterface197 is returned only by version 1.9.7 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.2.3. If your software is running on an earlier version of OS X you will need to use UUID kIOUSBDeviceInterfaceID, kIOUSBDeviceInterfaceID182, or kIOUSBDeviceInterfaceID187 and you will not have access to some functions. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface197 **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID197), (LPVoid)&dev);
1158
kIOUSBDeviceInterfaceID245
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface245. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBDeviceInterface245 is returned only by version 2.4.5 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.4.5 (for Intel). This version does not add any more functions to the interface. It is used to allow us to fix an overrelease in our termination without affecting any current drivers: In previous versions, we would end up releasing our IOService, even though we had not retained it. For IOUSBDeviceInterfaceID245 clients we will retain the IOService. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface245 **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID245), (LPVoid)&dev);
1159
kIOUSBDeviceInterfaceID300
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface300. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBDeviceInterface300 is returned only by version 3.0.0 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.5. If your software is running on an earlier version of OS X you will need to use UUID kIOUSBDeviceInterfaceID, kIOUSBDeviceInterfaceID182, kIOUSBDeviceInterfaceID187, kIOUSBDeviceInterfaceID197, or kIOUSBDeviceInterfaceID245 and you will not have access to some functions. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface300 **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID300), (LPVoid)&dev);
1160
kIOUSBDeviceInterfaceID320
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface320. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBDeviceInterface320 is returned only by version 3.2.0 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.5.4 If your software is running on an earlier version of OS X you will need to use UUID kIOUSBDeviceInterfaceID, kIOUSBDeviceInterfaceID182, kIOUSBDeviceInterfaceID187, kIOUSBDeviceInterfaceID197, kIOUSBDeviceInterfaceID245, or kIOUSBDeviceInterfaceID300 and you will not have access to some functions. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface320 **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID320), (LPVoid)&dev);
1161
kIOUSBDeviceInterfaceID500
This UUID constant is used to obtain a device interface corresponding to an IOUSBDevice user client in the kernel. The type of this device interface is IOUSBDeviceInterface320. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBDeviceInterface5000 is returned only by version 5.0.0 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.7.3 If your software is running on an earlier version of OS X you will need to use UUID kIOUSBDeviceInterfaceID, kIOUSBDeviceInterfaceID182, kIOUSBDeviceInterfaceID187, kIOUSBDeviceInterfaceID197, kIOUSBDeviceInterfaceID245, kIOUSBDeviceInterfaceID300, or kIOUSBDeviceInterfaceID320 and you will not have access to some functions. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBDeviceInterface500 **dev; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBDeviceInterfaceID500), (LPVoid)&dev);
1162
kIOUSBDeviceUserClientTypeID
This UUID constant is used to obtain a device interface corresponding to an io_service_t corresponding to an IOUSBDevice in the kernel. Once you have obtained the device interface for the service, you must use the QueryInterface function to obtain the device interface for the user client itself. Example:
This UUID constant is used internally by the system, and should not have to be used by any driver code to access the device interfaces. Available in OS X v10.0 and later. Declared in IOUSBLib.h.
1163
kIOUSBInterfaceInterfaceID
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface is returned by all versions of the IOUSBFamily currently shipping. However, there are some functions which are available only in IOUSBFamily version 1.8.2 and above. Access to these functions, as well as to all of the functions contained in IOUSBInterfaceInterface, can be obtained by using one of the other UUIDs listed in this header. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
IOUSBInterfaceInterface **intf; // fetching this now IOReturn err; err = (*iodev)->QueryInterface(iodev, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVoid)&intf);
1164
kIOUSBInterfaceInterfaceID182
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface182. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface182 is returned only by version 1.8.2 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.0.4. If your software is running on an earlier version of OS X, you will need to use the UUID kIOUSBInterfaceInterfaceID and you will not have access to some functions. Example:
IOCFPluginInterface
**iodev;
// obtained earlier
1165
kIOUSBInterfaceInterfaceID183
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface183. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface183 is returned only by version 1.8.3 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.1. If your software is running on a version of OS X prior to 10.1 you will need to use the UUID kIOUSBInterfaceInterfaceID or kIOUSBInterfaceInterfaceID182 and you will not have access to some functions. Example:
1166
kIOUSBInterfaceInterfaceID190
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface190. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface190 is returned only by version 1.9 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.2. If your software is running on a version of OS X prior to 10.2 you will need to use the UUID kIOUSBInterfaceInterfaceID, kIOUSBInterfaceInterfaceID182, or kIOUSBInterfaceInterfaceID183 and you will not have access to some functions. Example:
1167
kIOUSBInterfaceInterfaceID192
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface192. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface192 is returned only by version 1.9.2 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.2.3. If your software is running on a version of OS X prior to 10.2.3 you will need to use the UUID kIOUSBInterfaceInterfaceID, kIOUSBInterfaceInterfaceID182, kIOUSBInterfaceInterfaceID183, or kIOUSBInterfaceInterfaceID190 and you will not have access to some functions. Example:
1168
kIOUSBInterfaceInterfaceID197
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface197. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface197 is returned only by version 1.9.7 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.2.5. If your software is running on a version of OS X prior to 10.2.5 you will need to use the UUID kIOUSBInterfaceInterfaceID, kIOUSBInterfaceInterfaceID182, kIOUSBInterfaceInterfaceID183, kIOUSBInterfaceInterfaceID190, or kIOUSBInterfaceInterfaceID192 and you will not have access to some functions. Example:
1169
kIOUSBInterfaceInterfaceID220
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface197. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface220 is returned only by version 2.2.0 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.4. If your software is running on a version of OS X prior to 10.4 you will need to use the UUID kIOUSBInterfaceInterfaceID, kIOUSBInterfaceInterfaceID182, kIOUSBInterfaceInterfaceID183, kIOUSBInterfaceInterfaceID190, kIOUSBInterfaceInterfaceID192, or kIOUSBInterfaceInterfaceID197 and you will not have access to some functions. Example:
1170
kIOUSBInterfaceInterfaceID245
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface245. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface245 is returned only by version 2.4.5 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.4.5. This version does not add any new functions. It is used to allow us to fix a leak in our termination without affecting any current drivers: In previous versions, we would not release a reference to the IOUSBDevice. For IOUSBInterfaceInterfaceID245 clients we will now release that reference. Example:
1171
kIOUSBInterfaceInterfaceID300
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface300. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface300 is returned only by version 3.0.0 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.5. If your software is running on a version of OS X prior to 10.5 you will need to use the UUID kIOUSBInterfaceInterfaceID, kIOUSBInterfaceInterfaceID182, kIOUSBInterfaceInterfaceID183, kIOUSBInterfaceInterfaceID190, kIOUSBInterfaceInterfaceID192, kIOUSBInterfaceInterfaceID197, kIOUSBInterfaceInterfaceID220, or kIOUSBInterfaceInterfaceID245 and you will not have access to some functions. Example:
1172
kIOUSBInterfaceInterfaceID500
This UUID constant is used to obtain a device interface corresponding to an IOUSBInterface user client in the kernel. The type of this device interface is IOUSBInterfaceInterface500. This device interface is obtained after the device interface for the service itself has been obtained. Note: The IOUSBInterfaceInterface500 is returned only by version 5.0.0 or above of the IOUSBFamily. This version of IOUSBFamily shipped with OS X version 10.7.3. If your software is running on a version of OS X prior to 10.7.3 you will need to use the UUID kIOUSBInterfaceInterfaceID, kIOUSBInterfaceInterfaceID182, kIOUSBInterfaceInterfaceID183, kIOUSBInterfaceInterfaceID190, kIOUSBInterfaceInterfaceID192, kIOUSBInterfaceInterfaceID197, kIOUSBInterfaceInterfaceID220, kIOUSBInterfaceInterfaceID245, or kIOUSBInterfaceInterfaceID300 and you will not have access to some functions. Example:
1173
kIOUSBInterfaceUserClientTypeID
This UUID constant is used to obtain a device interface corresponding to an io_service_t corresponding to an IOUSBInterface in the kernel. Once you have obtained the device interface for the service, you must use the QueryInterface function to obtain the device interface for the user client itself. Example:
io_service_t
1174
Declared in
IOVideoDeviceLib.h
Overview
Included Headers
Functions
See the Overview for header-level documentation.
AddToRunLoop
Add the CFRunLoopSource for the notification port to a run loop.
Parameters
device
1175
runLoop
The run loop to which to add the notification source. Return Value Returns kIOReturnSuccess if the source was successfully added to the run loop.
Close
Closes an IOVideoDevice.
Parameters
device
The IOVideoDeviceRef of the device to close. Return Value Returns kIOReturnSuccess if the device was successfully closed. Discussion Calling Close frees all streams belonging to the device and frees all user resources used by the device.
CreateStreamInterface
IOReturn ( *CreateStreamInterface)( IOVideoDeviceRef device, CFDictionaryRef streamDictionary, UInt32 streamIndex, bool isInput, IOStreamRef *streamRef);
Parameters
device
1176
isInput
Return Value Returns kIOReturnSuccess if the stream was successfully stopped from the run loop.
GetNotificationPort
Get the notification port for device state changes sent to user space.
Parameters
device
The IOVideoDeviceRef of the stream to operate on. Return Value A CFMachPortRef of the output notification port.
GetRunLoopSource
Gets a CFRunLoopSource for the CFMachPort used for notifications from the kernel that data is ready.
Parameters
device
The IOVideoDeviceRef of the stream to operate on. Return Value The CFRunLoopSourceRef for the run loop source, or NULL if there was an error creating the source.
Open
Open an IOVideoDevice from user space.
1177
Parameters
device
Open options. Currently unused. Return Value If the device could not be opened an error will be returned. Discussion The Open function opens the device.
ReleaseStreamInterface
Parameters
device
Return Value Returns kIOReturnSuccess if the stream was successfully stopped from the run loop.
RemoveFromRunLoop
Remove the CFRunLoopSource for the notification port from a run loop.
Parameters
device
1178
runLoop
The run loop from which to remove the notification source. Return Value Returns kIOReturnSuccess if the source was successfully removed from the run loop.
SetControlValue
IOReturn ( *SetControlValue)( IOVideoDeviceRef device, UInt32 controlID, UInt32 value, UInt32 *newValue);
Parameters
device controlID newValue
Return Value Returns kIOReturnSuccess if the call was successfully. Availability Available in OS X v10.0 and later. Not available to 64-bit applications. Declared in
Controls.h
SetNotificationCallback
Set the callback function to be called when certain device state changes happen.
1179
Parameters
device
The IOVideoDeviceRef of the device to operate on. Pass NULL to remove the callback. Return Value Returns kIOReturnSuccess if the callback was successfully set or removed.
SetStreamFormat
Parameters
device streamID streamFormat
Callbacks
See the Overview for header-level documentation.
IOVideoDeviceNotificationCallback
1180
IOVideoDeviceOutputCallback
Data Types
See the Overview for header-level documentation.
IOVideoDeviceInterface_v1_t
Forward declaration of IOVideoDeviceInterface_v1_t.
IOVideoDeviceRef
1181
Constants
See the Overview for header-level documentation.
Defines
#define kIOVideoDeviceInterfaceID_v1 CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x0D, 0xE0, 0x80, 0xE3, 0x51, 0x06, 0x4D, 0x16, 0xB7, 0x0C, 0xB3, 0x21, 0x6F, 0x13, 0xCD, 0xB9) #define kIOVideoDeviceLibTypeID CFUUIDGetConstantUUIDWithBytes(kCFAllocatorDefault, 0x53, 0x39, 0x63, 0x3C, 0xF9, 0x03, 0x42, 0x12, 0x9C, 0x90, 0x9B, 0x18, 0xAF, 0x01, 0x86, 0x2D)
1182
Constants
kIOVideoDeviceInterfaceID_v1
This is the UUID of version 1 of the plug-in interface (080E3-5106-4D16-B70C-B3216F13CDB9A). Available in OS X v10.7 and later. Declared in IOVideoDeviceLib.h.
kIOVideoDeviceLibTypeID
This is the UUID of the plug-in type (5339633C-F903-4212-9C90-9B18AF01862D). Available in OS X v10.7 and later. Declared in IOVideoDeviceLib.h.
1183
Declared in
IOVideoDeviceShared.h
Overview
IOVideoDevice definitions shared between kernel and user space.
Included Headers
<sys/cdefs.h> <IOKit/IOTypes.h>
Constants
See the Overview for header-level documentation.
Mach
Port types used with IOConnectSetNotificationPort().
Constants
kIOVideoDevicePortTypeNotification
1184
kIOVideoDevicePortTypeOutput
1185
Declared in
IOVideoDeviceUserClient.h
Overview
Included Headers
Constants
See the Overview for header-level documentation.
User
Client method numbers used with IOConnectMethod...() functions.
enum { kIOVideoDeviceMethodOpen = 0, kIOVideoDeviceMethodClose, kIOVideoDeviceMethodGetMode, kIOVideoDeviceMethodSetMode, kIOVideoDeviceMethodSetControlValue, kIOVideoDeviceMethodOpenStream, kIOVideoDeviceMethodCloseStream, kIOVideoDeviceMethodSetStreamFormat, kIOVideoDeviceMethodStartStream, kIOVideoDeviceMethodStopStream, kIOVideoDeviceMethodSuspendStream, kIOVideoDeviceMethodCount };
1186
Constants
kIOVideoDeviceMethodOpen
1187
Declared in
IOVideoTypes.h
Overview
Included Headers
<IOKit/IOTypes.h> <mach/message.h>
Data Types
See the Overview for header-level documentation.
IOVideoDeviceNotification
This structure contains an individual notification from the driver.
struct IOVideoDeviceNotification { UInt32 mObjectID; UInt32 mNotificationID; UInt32 mNotificationArgument1; UInt32 mNotificationArgument2; UInt64 mNotificationArgument3; UInt64 mNotificationArgument4; };
Fields
mObjectID
1188
mNotificationArgument1
A UInt64 whose usage depends on the the specific kind of notification. See Also
IOVideoNotification
IOVideoDeviceNotificationMessage
This structure describes a notification from the driver. Note that the message can contain multiple notifications.
struct IOVideoDeviceNotificationMessage { mach_msg_header_t mMessageHeader; UInt32 mClientData; UInt32 mNumberNotifications; IOVideoDeviceNotification mNotifications[1]; };
Fields
mMessageHeader
The client data that was registered with the mach port.
mNumberNotifications
A variable length array of IOVideoNotification structures that carry the actual notification data. The number of elements in this array is denoted by mNumberNotifications, but can also be inferred from the message size in the mach message header.
IOVideoNotification
This structure contains an individual notification from the driver.
1189
struct IOVideoDeviceNotification { UInt32 mObjectID; UInt32 mNotificationID; UInt32 mNotificationArgument1; UInt32 mNotificationArgument2; UInt64 mNotificationArgument3; UInt64 mNotificationArgument4; };
Fields
mObjectID
A UInt64 whose usage depends on the the specific kind of notification. See Also
IOVideoDeviceNotification (page 1189)
Constants
See the Overview for header-level documentation.
Control
Various constants related to controls.
1190
kIOVideoControlElementMaster = 0 };
Constants
kIOVideoControlScopeGlobal
The scope for controls that apply to the device as a whole. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoControlScopeInput
The scope for controls that apply to the input section of the device. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoControlScopeOutput
The scope for controls that apply to the output section of the device. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoControlScopePlayThrough
The scope for controls that apply to the play through section of the device. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoControlElementMaster
The element value for controls that apply to the master element or to the entire scope. Note that other elements are numbered consecutively starting from 1. Available in OS X v10.7 and later. Declared in IOVideoTypes.h. Discussion Constants
Control
The class IDs that identify the various control base classes.
1191
Constants
kIOVideoControlBaseClassIDBoolean
The class ID that identifies the boolean control class which is a subclass of the base control class. Boolean controls manipulate on/off switches in the hardware. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoControlBaseClassIDSelector
The class ID that identifies the selector control class which is a subclass of the base control class. Selector controls manipulate controls that have multiple, but discreet values. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoControlBaseClassIDFeature
The class ID that identifies the feature control class which is a subclass of the base control class. Feature controls manipulate various features that might be present on a device, such as hue, saturation, zoom, etc. Available in OS X v10.7 and later. Declared in IOVideoTypes.h. Discussion Base Class IDs
IOVideoBooleanControl
The four char codes that identify the various standard subclasses of IOVideoBooleanControl.
Constants
kIOVideoBooleanControlClassIDJack
A IOVideoBooleanControl where a true value means something is plugged into that element. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
1192
kIOVideoBooleanControlClassIDDirection
A IOVideoBooleanControl where a true value means the element is operating in input mode, and false means the element is operating in output mode. This control is only needed for devices which can do input and output, but not at the same time. Available in OS X v10.7 and later. Declared in IOVideoTypes.h. Discussion Subclass IDs
enum { kIOVideoFeatureControlClassIDBlackLevel = 'bklv', kIOVideoFeatureControlClassIDWhiteLevel = 'whlv', kIOVideoFeatureControlClassIDHue = 'hue ', kIOVideoFeatureControlClassIDSaturation = 'satu', kIOVideoFeatureControlClassIDContrast = 'ctst', kIOVideoFeatureControlClassIDSharpness = 'shrp', kIOVideoFeatureControlClassIDBrightness = 'brit', kIOVideoFeatureControlClassIDGain = 'gain', kIOVideoFeatureControlClassIDIris = 'iris', kIOVideoFeatureControlClassIDShutter = 'shtr', kIOVideoFeatureControlClassIDExposure = 'xpsr', kIOVideoFeatureControlClassIDWhiteBalanceU = 'whbu', kIOVideoFeatureControlClassIDWhiteBalanceV = 'whbv', kIOVideoFeatureControlClassIDGamma = 'gmma', kIOVideoFeatureControlClassIDTemperature = 'temp', kIOVideoFeatureControlClassIDZoom = 'zoom', kIOVideoFeatureControlClassIDFocus = 'fcus', kIOVideoFeatureControlClassIDPan = 'pan ', kIOVideoFeatureControlClassIDTilt = 'tilt', kIOVideoFeatureControlClassIDOpticalFilter = 'opft', kIOVideoFeatureControlClassIDBacklightCompensation = 'bklt', kIOVideoFeatureControlClassIDPowerLineFrequency = 'pwfq' };
1193
Constants
kIOVideoFeatureControlClassIDBlackLevel
A IOVideoFeatureControl that controls the black level offset. The units for the control's absolute value are percetage (%). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDWhiteLevel
A IOVideoFeatureControl that controls the white level offset. The units for the control's absolute value are percentage (%). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDHue
A IOVideoFeatureControl that controls the hue offset. Positive values mean counterclockwise, negative values means clockwise on a vector scope. The units for the control's absolute value are degrees (\xB0). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDSaturation
A IOVideoFeatureControl that controls color intensity. For example, at high saturation levels, red appears to be red; at low saturation, red appears as pink. The unit for the control's absolute value is a percentage (%). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDContrast
A IOVideoFeatureControl that controls a the distance bewtween the whitest whites and blackest blacks. The units for the control's absolute value are percentage (%). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDSharpness
A IOVideoFeatureControl that controls the sharpness of the picture. The units for the control's absolute value are undefined. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDBrightness
A IOVideoFeatureControl that controls the intensity of the video level. The units for the control's absolute value are percetage (%). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
1194
kIOVideoFeatureControlClassIDGain
A IOVideoFeatureControl that controls the amplification of the signal. The units for the control's absolute value are decibels (dB). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDIris
A IOVideoFeatureControl that controls a mechanical lens iris. The units for the control's absolute value are an F number (F). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDShutter
A IOVideoFeatureControl that controls the integration time of the incoming light. The units for the control's absolute value are seconds (s). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDExposure
A IOVideoFeatureControl that controls a the total amount of light accumulated. The units for the control's absolute value are exposure value (EV). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDWhiteBalanceU
A IOVideoFeatureControl that controls the adjustment of the white color of the picture. The units for the control's absolute value are kelvin (K). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDWhiteBalanceV
A IOVideoFeatureControl that controls a adjustment of the white color of the picture. The units for the control's absolute value are kelvin (K). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDGamma
A IOVideoFeatureControl that defines the function between incoming light level and output picture level. The units for the control's absolute value are undefined. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
1195
kIOVideoFeatureControlClassIDTemperature
A IOVideoFeatureControl that controls the temperature inside of the device and/or controlling temperature. The units for the control's absolute value are undefined. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDZoom
A IOVideoFeatureControl that controls the zoom. The units for the control's absolute value are power where 1 is the wide end. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDFocus
A IOVideoFeatureControl that controls a focus mechanism. The units for the control's absolute value are meters (m). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDPan
A IOVideoFeatureControl that controls a panning mechanism. Positive values mean clockwise, negative values means counterclockwise. The units for the control's absolute value are degrees (\xB0). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDTilt
A IOVideoFeatureControl that controls a tilt mechanism. Positive values mean updwards, negative values means downwards. The units for the control's absolute value are degrees (\xB0). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDOpticalFilter
A IOVideoFeatureControl that controls chagning the optical filter of camera lens function. The units for the control's absolute value are are undefined. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoFeatureControlClassIDBacklightCompensation
A IOVideoFeatureControl that controls the amount of backlight compensation to apply. A low number indicates the least amount of backlight compensation. The units for the control's absolute value are are undefined. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
1196
kIOVideoFeatureControlClassIDPowerLineFrequency
A IOVideoFeatureControl to specify the power line frequency to properly implement anti-flicker processing. The units for the contorl's absolute value are hertz (Hz). Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
IOVideoSelectorControl
The four char codes that identify the various standard subclasses of IOVideoSelectorControl.
Constants
kIOVideoSelectorControlClassIDDataSource
A IOVideoSelectorControl that identifies where the data for the element is coming from. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoSelectorControlClassIDDataDestination
A IOVideoSelectorControl that identifies where the data for the element is going. Available in OS X v10.7 and later. Declared in IOVideoTypes.h. Discussion Subclass IDs
Notification IDs
The four char codes used to identify the kind of the notification.
1197
Constants
kIOVideoDeviceNotificationID_ControlValueChanged
Indicates that the value of the control with the given ID has changed. The first argument is the new value. Available in OS X v10.7 and later. Declared in IOVideoTypes.h.
kIOVideoDeviceNotificationID_ControlRangeChanged
Indicates that the range of the control with the given ID has changed. Available in OS X v10.7 and later. Declared in IOVideoTypes.h. Discussion All device-level notifications will have an object ID of 0.
1198
KextManager.h Reference
Declared in
KextManager.h
Overview
The KextManager API provides a simple interface for applications to load kernel extensions (kexts) via RPC to kextd, and to look up the URLs for kexts by bundle identifier.
Included Headers
Functions
See the Overview for header-level documentation.
KextManagerCopyLoadedKextInfo
Returns information about loaded kexts in a dictionary.
Parameters
kextIdentifiers
An array of kext identifiers to read from the kernel. Pass NULL to read info for all loaded kexts.
infoKeys
An array of info keys to read from the kernel. Pass NULL to read all information.
1199
Return Value A dictionary, keyed by bundle identifier, of dictionaries containing information about loaded kexts. Discussion The information keys returned by this function are listed below. Some are taken directly from the kext's information property list, and some are generated at run time. Never assume a given key will be present for a kext.
CFBundleIdentifier - CFString CFBundleVersion - CFString (note: version strings may be canonicalized but their numeric values will
OSBundleCompatibleVersion - CFString OSBundleIsInterface - CFBoolean OSKernelResource - CFBoolean OSBundleCPUType - CFNumber OSBundleCPUSubtype - CFNumber OSBundlePath - CFString (this is merely a hint stored in the kernel; the kext is not guaranteed to be at
this path)
OSBundleExecutablePath - CFString (the absolute path to the executable within the kext bundle; a
hint as above)
OSBundleUUID - CFData (the UUID of the kext executable, if it has one) OSBundleStarted - CFBoolean (true if the kext is running) OSBundlePrelinked - CFBoolean (true if the kext is loaded from a prelinked kernel) OSBundleLoadTag - CFNumber (the "Index" given by kextstat) OSBundleLoadAddress - CFNumber OSBundleLoadSize - CFNumber OSBundleWiredSize - CFNumber OSBundleDependencies - CFArray of load tags identifying immediate link dependencies OSBundleRetainCount - CFNumber (the OSObject retain count of the kext itself ) OSBundleClasses - CFArray of CFDictionary containing info on C++ classes defined by the kext: OSMetaClassName - CFString OSMetaClassSuperclassName - CFString, absent for root classes
1200
OSMetaClassTrackingCount - CFNumber giving the instance count of the class itself, plus 1 for each
direct subclass with any instances Availability Available in OS X v10.7 and later. Declared in
KextManager.h
KextManagerCreateURLForBundleIdentifier
Create a URL locating a kext with a given bundle identifier.
Parameters
allocator
The allocator to use to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.
kextIdentifier
The bundle identifier to look up. Return Value A CFURLRef locating a kext with the requested bundle identifier. Returns NULL if the kext cannot be found, or on error. Discussion Kexts are looked up first by whether they are loaded, second by version. Specifically, if kextIdentifier identifies a kext that is currently loaded, the returned URL will locate that kext if it's still present on disk. If the requested kext is not loaded, or if its bundle is not at the location it was originally loaded from, the returned URL will locate the latest version of the desired kext, if one can be found within the system extensions folder. If no version of the kext can be found, NULL is returned. Availability Available in OS X v10.2 and later. Declared in
KextManager.h
1201
KextManagerLoadKextWithIdentifier
Request the kext loading system to load a kext with a given bundle identifier.
Parameters
kextIdentifier
An array of additional URLs, of individual kexts and of folders that may contain kexts. Return Value
kOSReturnSuccess if the kext is successfully loaded (or is already loaded), otherwise returns on error.
Discussion
kextIdentifier is looked up in the system extensions folder and among any kexts from dependencyKextAndFolderURLs. Any non-kext URLs in dependencyKextAndFolderURLs are scanned
at the top level for kexts and plugins of kexts. Either the calling process must have an effective user id of 0 (superuser), or the kext being loaded and all its dependencies must reside in /System and have an OSBundleAllowUserLoad property of true. Availability Available in OS X v10.6 and later. Declared in
KextManager.h
KextManagerLoadKextWithURL
Request the kext loading system to load a kext with a given URL.
1202
Parameters
kextURL
An array of additional URLs, of individual kexts and of folders that may contain kexts. Return Value
kOSReturnSuccess if the kext is successfully loaded (or is already loaded), otherwise returns on error.
Discussion Any non-kext URLs in dependencyKextAndFolderURLs are scanned at the top level for kexts and plugins of kexts. Either the calling process must have an effective user id of 0 (superuser), or the kext being loaded and all its dependencies must reside in /System and have an OSBundleAllowUserLoad property of true. Availability Available in OS X v10.6 and later. Declared in
KextManager.h
KextManagerUnloadKextWithIdentifier
Request the kernel to unload a kext with a given bundle identifier.
Parameters
kextIdentifier
Discussion The calling process must have an effective user id of 0 (superuser). Availability Available in OS X v10.7 and later.
1203
Declared in
KextManager.h
1204
Overview
This file contains all definitions for the data returned from the INQUIRY (0x12) command.
Included Headers
<IOKit/IOTypes.h> <CoreFoundation/CoreFoundation.h>
Data Types
See the Overview for header-level documentation.
SCSICmd_INQUIRY_Page00_Header
typedef struct SCSICmd_INQUIRY_Page00_Header { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. UInt8 PAGE_CODE; // Must be equal to 00h UInt8 RESERVED; // reserved field UInt8 PAGE_LENGTH; // n-3 bytes } SCSICmd_INQUIRY_Page00_Header;
Discussion INQUIRY Page 00h Header. Availability Available in OS X v10.2 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
1205
SCSICmd_INQUIRY_Page80_Header
typedef struct SCSICmd_INQUIRY_Page80_Header { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. UInt8 PAGE_CODE; // Must be equal to 80h UInt8 RESERVED; // reserved field UInt8 PAGE_LENGTH; // n-3 bytes UInt8 PRODUCT_SERIAL_NUMBER; // 4-n } SCSICmd_INQUIRY_Page80_Header;
Discussion INQUIRY Page 80h Header. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
SCSICmd_INQUIRY_Page83_Header
typedef struct SCSICmd_INQUIRY_Page83_Header { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. UInt8 PAGE_CODE; // Must be equal to 83h UInt8 RESERVED; // reserved field UInt8 PAGE_LENGTH; // n-3 bytes } SCSICmd_INQUIRY_Page83_Header;
Discussion INQUIRY Page 83h Header. Availability Available in OS X v10.2 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
SCSICmd_INQUIRY_Page83_Header_SPC_16
typedef struct SCSICmd_INQUIRY_Page83_Header_SPC_16 { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type.
1206
UInt8 PAGE_CODE; // Must be equal to 83h UInt16 PAGE_LENGTH; // n-3 bytes } SCSICmd_INQUIRY_Page83_Header_SPC_16;
Discussion INQUIRY Page 83h Header used with the 16 byte INQUIRY command. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
SCSICmd_INQUIRY_Page83_Identification_Descriptor
typedef struct SCSICmd_INQUIRY_Page83_Identification_Descriptor { UInt8 CODE_SET; // 7-4 = Protocol Identifier. 3-0 = Code Set UInt8 IDENTIFIER_TYPE; // 7 = PIV 5-4 = ASSOCIATION 3-0 = Identifier UInt8 RESERVED; UInt8 IDENTIFIER_LENGTH; UInt8 IDENTIFIER; } SCSICmd_INQUIRY_Page83_Identification_Descriptor;
Discussion INQUIRY Page 83h Identification Descriptor. Availability Available in OS X v10.2 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
SCSICmd_INQUIRY_Page83_LogicalUnitGroup_Identifier
1207
SCSICmd_INQUIRY_Page83_RelativeTargetPort_Identifier
Discussion INQUIRY Page 83h Relative Target Port Identifier. Availability Available in OS X v10.7 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
SCSICmd_INQUIRY_Page83_TargetPortGroup_Identifier
Discussion INQUIRY Page 83h Target Port Group Identifier. Availability Available in OS X v10.7 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
1208
SCSICmd_INQUIRY_Page89_Data
typedef struct SCSICmd_INQUIRY_Page89_Data { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. UInt8 PAGE_CODE; // Must be equal to 89h UInt16 PAGE_LENGTH; // Must be equal to 238h UInt32 Reserved; UInt8 SAT_VENDOR_IDENTIFICATION[ kINQUIRY_VENDOR_IDENTIFICATION_Length]; UInt8 SAT_PRODUCT_IDENTIFICATION[ kINQUIRY_PRODUCT_IDENTIFICATION_Length]; UInt8 SAT_PRODUCT_REVISION_LEVEL[ kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; UInt8 ATA_DEVICE_SIGNATURE[20]; UInt8 COMMAND_CODE; UInt8 Reserved2[3]; UInt8 IDENTIFY_DATA[512]; } SCSICmd_INQUIRY_Page89_Data;
Discussion INQUIRY Page 89h data as defined in the SAT 1.0 specification. This section contians all structures and definitions used by the INQUIRY command in response to a request for page 89h - ATA information VPD Page. Availability Available in OS X v10.4 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
SCSICmd_INQUIRY_PageB1_Data
typedef struct SCSICmd_INQUIRY_PageB1_Data { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. UInt8 PAGE_CODE; // Must be equal to B1h UInt8 Reserved; UInt8 PAGE_LENGTH; // Must be equal to 3Ch UInt16 MEDIUM_ROTATION_RATE; UInt8 Reserved2[58]; } SCSICmd_INQUIRY_PageB1_Data;
Discussion INQUIRY Page B1h data as defined in the SBC specification. This section contians all structures and definitions used by the INQUIRY command in response to a request for page B1h - Block Device Characteristics VPD Page.
1209
SCSICmd_INQUIRY_StandardData
typedef struct SCSICmd_INQUIRY_StandardData { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type. UInt8 RMB; // 7 = removable UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. (SPC-3 obsoletes AERC) // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data UInt8 SCCSReserved; // SCC-2 device flag and reserved fields (SPC-3 adds PROTECT 3PC TPGS, and ACC) UInt8 flags1; // First byte of support flags (See SPC-3 section 6.4.2) UInt8 flags2; // Second byte of support flags (Byte 7) (See SPC-3 section 6.4.2) char VENDOR_IDENTIFICATION[ kINQUIRY_VENDOR_IDENTIFICATION_Length]; char PRODUCT_IDENTIFICATION[ kINQUIRY_PRODUCT_IDENTIFICATION_Length]; char PRODUCT_REVISION_LEVEL[ kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; } SCSICmd_INQUIRY_StandardData;
Discussion This structure defines the format of the required standard data that is returned for the INQUIRY command. This is the data that is required to be returned from all devices. Availability Available in OS X v10.0 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
SCSICmd_INQUIRY_StandardDataAll
typedef struct SCSICmd_INQUIRY_StandardDataAll { UInt8 PERIPHERAL_DEVICE_TYPE; // 7-5 = Qualifier. 4-0 = Device type.
1210
UInt8 RMB; // 7 = removable UInt8 VERSION; // 7/6 = ISO/IEC, 5-3 = ECMA, 2-0 = ANSI. UInt8 RESPONSE_DATA_FORMAT; // 7 = AERC, 6 = Obsolete, 5 = NormACA, 4 = HiSup 3-0 = Response data format. // If ANSI Version = 0, this is ATAPI and bits 7-4 = ATAPI version. UInt8 ADDITIONAL_LENGTH; // Number of additional bytes available in inquiry data UInt8 SCCSReserved; // SCC-2 device flag and reserved fields UInt8 flags1; // First byte of support flags (Byte 6) UInt8 flags2; // Second byte of support flags (Byte 7) char VENDOR_IDENTIFICATION[ kINQUIRY_VENDOR_IDENTIFICATION_Length]; char PRODUCT_IDENTIFICATION[ kINQUIRY_PRODUCT_IDENTIFICATION_Length]; char PRODUCT_REVISION_LEVEL[ kINQUIRY_PRODUCT_REVISION_LEVEL_Length]; // Following is the optional data that may be returned by a device. UInt8 VendorSpecific1[20]; UInt8 flags3; // Third byte of support flags, mainly SPI-3 (Byte 56) UInt8 Reserved1; UInt16 VERSION_DESCRIPTOR[8]; UInt8 Reserved2[22]; UInt8 VendorSpecific2[160]; } SCSICmd_INQUIRY_StandardDataAll;
Discussion This structure defines the all of the fields that can be returned in repsonse to the INQUIRy request for the standard data. There is no requirement as to how much of the additional data must be returned by a device. Availability Available in OS X v10.2 and later. Declared in
SCSICmds_INQUIRY_Definitions.h
Constants
See the Overview for header-level documentation.
Defines
kINQUIRY_VERSION_DESCRIPTOR_MaxCount 8 kIOPropertyHiSup "Hierarchical LUN Support" kIOPropertySATProductIdentification "SAT Product Identification" kIOPropertySATProductRevisonLevel "SAT Product Revision Level"
1211
#define #define #define #define #define #define #define #define #define #define #define #define #define #define
kIOPropertySATVendorIdentification "SAT Vendor Identification" kIOPropertySCSIINQUIRYDeviceIdAssociation "Association" kIOPropertySCSIINQUIRYDeviceIdCodeSet "Code Set" kIOPropertySCSIINQUIRYDeviceIdentification "INQUIRY Device Identification" kIOPropertySCSIINQUIRYDeviceIdentifier "Identifier" kIOPropertySCSIINQUIRYDeviceIdType "Identifier Type" kIOPropertySCSIINQUIRYUnitSerialNumber "INQUIRY Unit Serial Number" kIOPropertySCSIPeripheralDeviceType "Peripheral Device Type" kIOPropertySCSIPeripheralDeviceTypeSize 8 kIOPropertySCSIProductIdentification "Product Identification" kIOPropertySCSIProductRevisionLevel "Product Revision Level" kIOPropertySCSIVendorIdentification "Vendor Identification" kIOPropertyTPGSInfo "TPGS Information" kIOPropertyTPGSInfoSize 8
Constants
kINQUIRY_VERSION_DESCRIPTOR_MaxCount
Maximum number of INQUIRY version descriptors supported. Available in OS X v10.4 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertyHiSup
Hierarchical LUN Support as reported in the INQUIRY data. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySATProductIdentification
Product Identification of the SATL. Available in OS X v10.4 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySATProductRevisonLevel
Product Revision Level of the SATL. Available in OS X v10.4 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySATVendorIdentification
Vendor Identification of the SATL. Available in OS X v10.4 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySCSIINQUIRYDeviceIdAssociation
1212
kIOPropertySCSIINQUIRYDeviceIdCodeSet
Code Set type key. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySCSIINQUIRYDeviceIdentification
Identifier key (data or string). Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySCSIINQUIRYDeviceIdType
Key that describes the INQUIRY Unit Serial Number in the IORegistry. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySCSIPeripheralDeviceType
SCSI Peripheral Device Type as reported in the INQUIRY data. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySCSIPeripheralDeviceTypeSize
Size of the kIOPropertySCSIPeripheralDeviceType key. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySCSIProductIdentification
Product ID as reported in the INQUIRY data. Additional space characters (0x20) are truncated. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertySCSIProductRevisionLevel
Product Revision Level as reported in the INQUIRY data. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1213
kIOPropertySCSIVendorIdentification
Vendor ID as reported in the INQUIRY data. Additional space characters (0x20) are truncated. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertyTPGSInfo
TPGS Info as reported in the INQUIRY data. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kIOPropertyTPGSInfoSize
Size of the kIOPropertyTPGSInfo key. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
enum { // Byte offset kINQUIRY_Byte56_Offset = 56, // Bit definitions kINQUIRY_Byte56_IUS_Bit = 0, kINQUIRY_Byte56_QAS_Bit = 1, // Bits 2 and 3 are the CLOCKING bits // All other bits are reserved kINQUIRY_Byte56_IUS_Mask = ( 1 << kINQUIRY_Byte56_IUS_Bit), kINQUIRY_Byte56_QAS_Mask = ( 1 << kINQUIRY_Byte56_QAS_Bit), kINQUIRY_Byte56_CLOCKING_Mask = 0x0C, // Definitions for the CLOCKING bits kINQUIRY_Byte56_CLOCKING_ONLY_ST = 0x00, kINQUIRY_Byte56_CLOCKING_ONLY_DT = 0x04, // kINQUIRY_Byte56_CLOCKING_RESERVED kINQUIRY_Byte56_CLOCKING_ST_AND_DT = 0x0C };
= 0x08,
Constants
kINQUIRY_Byte56_IUS_Bit
1214
kINQUIRY_Byte56_QAS_Bit
Mask to use to test the IUS bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte56_QAS_Mask
Mask to use to test the QAS bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte56_CLOCKING_Mask
Mask to use to test CLOCKING bits. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte56_CLOCKING_ONLY_ST
Single-transition and double-transition clocking. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for bits/masks in the INQUIRY Byte 56 field. Inquiry Byte 56 features (for devices that report an ANSI VERSION of kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant or later). These are SPI-3 Specific.
enum {
1215
// Byte offset kINQUIRY_Byte6_Offset = 6, // Bit definitions kINQUIRY_Byte6_ADDR16_Bit = 0, // SPI Specific // Bit 1 is Obsolete // Bit 2 is Obsolete kINQUIRY_Byte6_MCHNGR_Bit = 3, kINQUIRY_Byte6_MULTIP_Bit = 4, kINQUIRY_Byte6_VS_Bit = 5, kINQUIRY_Byte6_ENCSERV_Bit = 6, kINQUIRY_Byte6_BQUE_Bit = 7, // Masks kINQUIRY_Byte6_ADDR16_Mask = ( 1 << kINQUIRY_Byte6_ADDR16_Bit), // SPI Specific // Bit 1 is Obsolete // Bit 2 is Obsolete kINQUIRY_Byte6_MCHNGR_Mask = ( 1 << kINQUIRY_Byte6_MCHNGR_Bit), kINQUIRY_Byte6_MULTIP_Mask = ( 1 << kINQUIRY_Byte6_MULTIP_Bit), kINQUIRY_Byte6_VS_Mask = ( 1 << kINQUIRY_Byte6_VS_Bit), kINQUIRY_Byte6_ENCSERV_Mask = ( 1 << kINQUIRY_Byte6_ENCSERV_Bit), kINQUIRY_Byte6_BQUE_Mask = ( 1 << kINQUIRY_Byte6_BQUE_Bit) };
Constants
kINQUIRY_Byte6_ADDR16_Bit
1216
kINQUIRY_Byte6_VS_Bit
Mask to use to test the ADDR16 bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte6_MCHNGR_Mask
Mask to use to test the MCHNGR bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte6_MULTIP_Mask
Mask to use to test the MULTIP bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte6_VS_Mask
Mask to use to test the VS bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte6_ENCSERV_Mask
Mask to use to test the ENCSERV bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte6_BQUE_Mask
Mask to use to test the BQUE bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1217
enum { // Byte offset kINQUIRY_Byte7_Offset = 7, // Bit definitions kINQUIRY_Byte7_VS_Bit = 0, kINQUIRY_Byte7_CMDQUE_Bit = 1, kINQUIRY_Byte7_TRANDIS_Bit = 2, // SPI Specific kINQUIRY_Byte7_LINKED_Bit = 3, kINQUIRY_Byte7_SYNC_Bit = 4, // SPI Specific kINQUIRY_Byte7_WBUS16_Bit = 5, // SPI Specific // Bit 6 is Obsolete kINQUIRY_Byte7_RELADR_Bit = 7, // Masks kINQUIRY_Byte7_VS_Mask = ( 1 << kINQUIRY_Byte7_VS_Bit), kINQUIRY_Byte7_CMDQUE_Mask = ( 1 << kINQUIRY_Byte7_CMDQUE_Bit), kINQUIRY_Byte7_TRANDIS_Mask = ( 1 << kINQUIRY_Byte7_TRANDIS_Bit),// SPI Specific kINQUIRY_Byte7_LINKED_Mask = ( 1 << kINQUIRY_Byte7_LINKED_Bit), kINQUIRY_Byte7_SYNC_Mask = ( 1 << kINQUIRY_Byte7_SYNC_Bit), // SPI Specific kINQUIRY_Byte7_WBUS16_Mask = ( 1 << kINQUIRY_Byte7_WBUS16_Bit), // SPI Specific // Bit 6 is Obsolete kINQUIRY_Byte7_RELADR_Mask = ( 1 << kINQUIRY_Byte7_RELADR_Bit) };
Constants
kINQUIRY_Byte7_VS_Bit
1218
kINQUIRY_Byte7_CMDQUE_Bit
Mask to use to test the VS bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte7_CMDQUE_Mask
Mask to use to test the CMDQUE bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte7_TRANDIS_Mask
Mask to use to test the TRANDIS bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1219
kINQUIRY_Byte7_LINKED_Mask
Mask to use to test the LINKED bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte7_SYNC_Mask
Mask to use to test the SYNC bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte7_WBUS16_Mask
Mask to use to test the WBUS16 bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte7_RELADR_Mask
Mask to use to test the RELADR bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for bits/masks in the INQUIRY flags2 field.
Constants
kINQUIRY_VENDOR_IDENTIFICATION_Length
1220
kINQUIRY_PRODUCT_REVISION_LEVEL_Length
Size of PRODUCT_REVISION_LEVEL field. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Sizes for some of the inquiry data fields.
enum { // SPC-3 - Association is changed to be specific to // Logical Units kINQUIRY_Page83_AssociationLogicalUnit = 0x00, // Backwards compatibility for SPC-2 kINQUIRY_Page83_AssociationDevice = kINQUIRY_Page83_AssociationLogicalUnit, // Association is related to a Target Port kINQUIRY_Page83_AssociationTargetPort = 0x10, // SPC-3 - Added as specific association to // a Target device. kINQUIRY_Page83_AssociationTargetDevice = 0x20, kINQUIRY_Page83_AssociationMask = 0x30, kINQUIRY_Page83_AssociationShift = 4 };
Constants
kINQUIRY_Page83_AssociationLogicalUnit
Association of the identifier is with the logical unit. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_AssociationDevice
Association of the identifier is with the device (same as logical unit in SPC-2). Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_AssociationTargetPort
Association of the identifier is with the target port. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1221
kINQUIRY_Page83_AssociationTargetDevice
Association of the identifier is with the target device (i.e. all ports). Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_AssociationMask
Mask to use to determine association. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for the Association field.
enum { kINQUIRY_Page83_CodeSetReserved = 0x0, kINQUIRY_Page83_CodeSetBinaryData = 0x1, kINQUIRY_Page83_CodeSetASCIIData = 0x2, kINQUIRY_Page83_CodeSetUTF8Data = 0x3, // 0x4 - 0xF reserved kINQUIRY_Page83_CodeSetMask = 0xF };
Constants
kINQUIRY_Page83_CodeSetBinaryData
The identifier contains binary data. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_CodeSetASCIIData
The identifier contains ASCII data. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_CodeSetUTF8Data
The identifier contains UTF-8 data. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1222
enum { kINQUIRY_Page83_IdentifierTypeVendorSpecific = 0, kINQUIRY_Page83_IdentifierTypeVendorID = 1, kINQUIRY_Page83_IdentifierTypeIEEE_EUI64 = 2, kINQUIRY_Page83_IdentifierTypeNAAIdentifier = 3, kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier = 4, kINQUIRY_Page83_IdentifierTypeTargetPortGroup = 5, kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup = 6, kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier = 7, kINQUIRY_Page83_IdentifierTypeSCSINameString = 8, // 0x9 - 0xF Reserved kINQUIRY_Page83_IdentifierTypeMask = 0xF, kINQUIRY_Page83_ProtocolIdentifierValidBit = 7, kINQUIRY_Page83_ProtocolIdentifierValidMask = ( 1 << kINQUIRY_Page83_ProtocolIdentifierValidBit) };
Constants
kINQUIRY_Page83_IdentifierTypeVendorSpecific
Vendor Specific Identifier Type. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_IdentifierTypeVendorID
Vendor Specific Identifier Type. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_IdentifierTypeIEEE_EUI64
1223
kINQUIRY_Page83_IdentifierTypeRelativePortIdentifier
Relative Target Port Identifier Type. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_IdentifierTypeTargetPortGroup
Target Port Group Identifier Type. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_IdentifierTypeLogicalUnitGroup
Logical Unit Group Identifier Type. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_IdentifierTypeMD5LogicalUnitIdentifier
MD5 Logical Unit Identifier Type. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_IdentifierTypeSCSINameString
SCSI Name String Identifier Type. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_IdentifierTypeMask
Mask to use to determine association. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Page83_ProtocolIdentifierValidBit
Mask to use to determine if PIV is set. Available in OS X v10.5 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for the Identifier Type field.
1224
= = = = =
Constants
kINQUIRY_Page00_PageCode
Page Code 89h. Available in OS X v10.4 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion INQUIRY Page Codes to be used when EVPD is set in the INQUIRY command.
kINQUIRY_VERSION_DESCRIPTOR_SAT
1225
Payload sizes
Constants
kINQUIRY_StandardDataHeaderSize
INQUIRY data header size. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_MaximumDataSize
Maximum size for INQUIRY data. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for sizes related to the INQUIRY data.
enum { kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice = 0x00, kINQUIRY_PERIPHERAL_TYPE_SequentialAccessSSCDevice = 0x01, kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice = 0x02, kINQUIRY_PERIPHERAL_TYPE_ProcessorSPCDevice = 0x03, kINQUIRY_PERIPHERAL_TYPE_WriteOnceSBCDevice = 0x04, kINQUIRY_PERIPHERAL_TYPE_CDROM_MMCDevice = 0x05, kINQUIRY_PERIPHERAL_TYPE_ScannerSCSI2Device = 0x06, kINQUIRY_PERIPHERAL_TYPE_OpticalMemorySBCDevice = 0x07, kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice = 0x08, kINQUIRY_PERIPHERAL_TYPE_CommunicationsSSCDevice = 0x09, /* 0x0A - 0x0B ASC IT8 Graphic Arts Prepress Devices */ kINQUIRY_PERIPHERAL_TYPE_StorageArrayControllerSCC2Device = 0x0C, kINQUIRY_PERIPHERAL_TYPE_EnclosureServicesSESDevice = 0x0D, kINQUIRY_PERIPHERAL_TYPE_SimplifiedDirectAccessRBCDevice = 0x0E, kINQUIRY_PERIPHERAL_TYPE_OpticalCardReaderOCRWDevice = 0x0F, /* 0x10 - 0x1E Reserved Device Types */ kINQUIRY_PERIPHERAL_TYPE_ObjectBasedStorageDevice = 0x11, kINQUIRY_PERIPHERAL_TYPE_AutomationDriveInterface = 0x12, kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit = 0x1E,
1226
Constants
kINQUIRY_PERIPHERAL_TYPE_DirectAccessSBCDevice
Sequential Access (Tape) SSC Device. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_PERIPHERAL_TYPE_PrinterSSCDevice
1227
kINQUIRY_PERIPHERAL_TYPE_MediumChangerSMCDevice
Automation Drive Interface device. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_PERIPHERAL_TYPE_WellKnownLogicalUnit
Well known logical unit. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1228
kINQUIRY_PERIPHERAL_TYPE_UnknownOrNoDeviceType
Mask to use for PERIPHERAL_DEVICE_TYPE field. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Inquiry Peripheral Device type definitions
Peripheral Qualifier
Constants
kINQUIRY_PERIPHERAL_QUALIFIER_Connected
Peripheral Device is supported, but not connected. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_PERIPHERAL_QUALIFIER_NotSupported
Peripheral Device is not supported. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_PERIPHERAL_QUALIFIER_Mask
Mask to use for PERIPHERAL_DEVICE_TYPE field. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1229
enum { kSCSIProtocolIdentifier_FibreChannel = 0, kSCSIProtocolIdentifier_ParallelSCSI = 1, kSCSIProtocolIdentifier_SSA = 2, kSCSIProtocolIdentifier_FireWire = 3, kSCSIProtocolIdentifier_RDMA = 4, kSCSIProtocolIdentifier_iSCSI = 5, kSCSIProtocolIdentifier_SAS = 6, kSCSIProtocolIdentifier_ADT = 7, kSCSIProtocolIdentifier_ATAPI = 8, // 0x9-xE Reserved kSCSIProtocolIdentifier_None = 0xF };
Constants
kSCSIProtocolIdentifier_FibreChannel
Parallel SCSI Protocol Identifier. Available in OS X v10.5 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kSCSIProtocolIdentifier_SSA
FireWire (IEEE-1394) Protocol Identifier. Available in OS X v10.5 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1230
kSCSIProtocolIdentifier_RDMA
No Protocol Identifier. Available in OS X v10.5 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for the protocol identifier values.
1231
Constants
kINQUIRY_PERIPHERAL_RMB_MediumFixed
Medium type is fixed disk. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_PERIPHERAL_RMB_MediumRemovable
Medium type is removable disk. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_PERIPHERAL_RMB_BitMask
Mask to use for RMB field. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Inquiry Removable Bit field definitions
enum { // Bit definitions // Bits 0-3: RESPONSE DATA FORMAT kINQUIRY_Byte3_HISUP_Bit = 4, kINQUIRY_Byte3_NORMACA_Bit = 5, // Bit 6 is Obsolete kINQUIRY_Byte3_AERC_Bit = 7, // Masks kINQUIRY_RESPONSE_DATA_FORMAT_Mask = 0x0F, // Bits 0-3 kINQUIRY_Byte3_HISUP_Mask = ( 1 << kINQUIRY_Byte3_HISUP_Bit), kINQUIRY_Byte3_NORMACA_Mask = ( 1 << kINQUIRY_Byte3_NORMACA_Bit), // Bit 6 is Obsolete kINQUIRY_Byte3_AERC_Mask = ( 1 << kINQUIRY_Byte3_AERC_Bit) };
1232
Constants
kINQUIRY_Byte3_HISUP_Bit
Mask for valid bits for RESPONSE_DATA_FORMAT. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte3_HISUP_Mask
Mask to use to test the HISUP bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte3_NORMACA_Mask
Mask to use to test the NORMACA bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte3_AERC_Mask
Mask to use to test the AERC bit. Available in OS X v10.2 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for bits/masks in the INQUIRY RESPONSE_DATA_FORMAT field.
1233
kINQUIRY_Byte5_SCCS_Bit = 7, kINQUIRY_Byte5_ACC_Bit = 6, kINQUIRY_Byte5_ExplicitTPGS_Bit = 5, kINQUIRY_Byte5_ImplicitTPGS_Bit = 4, kINQUIRY_Byte5_3PC_Bit = 3, // Bits 1-2: Reserved kINQUIRY_Byte5_PROTECT_Bit = 0, // Masks kINQUIRY_Byte5_SCCS_Mask = ( 1 << kINQUIRY_Byte5_SCCS_Bit), kINQUIRY_Byte5_ACC_Mask = ( 1 << kINQUIRY_Byte5_ACC_Bit), kINQUIRY_Byte5_ExplicitTPGS_Mask = ( 1 << kINQUIRY_Byte5_ExplicitTPGS_Bit), kINQUIRY_Byte5_ImplicitTPGS_Mask = ( 1 << kINQUIRY_Byte5_ImplicitTPGS_Bit), kINQUIRY_Byte5_3PC_Mask = ( 1 << kINQUIRY_Byte5_3PC_Bit), // Bits 1-2: Reserved kINQUIRY_Byte5_PROTECT_Mask = ( 1 << kINQUIRY_Byte5_PROTECT_Bit) };
Constants
kINQUIRY_Byte5_SCCS_Bit
Explicit TPGS bit definition. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte5_ImplicitTPGS_Bit
Implicit TPGS bit definition. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1234
kINQUIRY_Byte5_3PC_Bit
Mask to use to test the SCCS bit. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte5_ACC_Mask
Mask to use to test the ACC bit. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte5_ExplicitTPGS_Mask
Mask to use for the Explicit TPGS bits. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte5_ImplicitTPGS_Mask
Mask to use for the Implicit TPGS bits. Available in OS X v10.7 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte5_3PC_Mask
Mask to use to test the 3PC bit. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_Byte5_PROTECT_Mask
Mask to use to test the PROTECT bit. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for bits/masks in the INQUIRY SCCSReserved field.
1235
enum { kINQUIRY_ISO_IEC_VERSION_Mask = 0xC0, kINQUIRY_ECMA_VERSION_Mask = 0x38, kINQUIRY_ANSI_VERSION_NoClaimedConformance = 0x00, kINQUIRY_ANSI_VERSION_SCSI_1_Compliant = 0x01, kINQUIRY_ANSI_VERSION_SCSI_2_Compliant = 0x02, kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant = 0x03, kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant = 0x04, kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant = 0x05, kINQUIRY_ANSI_VERSION_Mask = 0x07 };
Constants
kINQUIRY_ISO_IEC_VERSION_Mask
Mask for valid bits for ISO/IEC Version. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_ECMA_VERSION_Mask
Mask for valid bits for ECMA Version. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_ANSI_VERSION_NoClaimedConformance
No ANSI conformance claimed by the device server. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_ANSI_VERSION_SCSI_1_Compliant
SCSI-1 conformance claimed by the device server. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_ANSI_VERSION_SCSI_2_Compliant
SCSI-2 conformance claimed by the device server. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_ANSI_VERSION_SCSI_SPC_Compliant
SPC conformance claimed by the device server. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
1236
kINQUIRY_ANSI_VERSION_SCSI_SPC_2_Compliant
SPC-2 conformance claimed by the device server. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_ANSI_VERSION_SCSI_SPC_3_Compliant
SPC-3 conformance claimed by the device server. Available in OS X v10.3 and later. Declared in SCSICmds_INQUIRY_Definitions.h.
kINQUIRY_ANSI_VERSION_Mask
Mask for valid bits for ANSI Version. Available in OS X v10.0 and later. Declared in SCSICmds_INQUIRY_Definitions.h. Discussion Definitions for bits/masks in the INQUIRY Version field.
1237
Overview
This file contains all definitions for the data returned from the MODE_SENSE_6 and MODE_SENSE_10 commands.
Included Headers
<IOKit/IOTypes.h> <CoreFoundation/CoreFoundation.h>
Data Types
See the Overview for header-level documentation.
DASDModeParameterBlockDescriptor
typedef struct DASDModeParameterBlockDescriptor { UInt32 NUMBER_OF_BLOCKS; UInt8 DENSITY_CODE; UInt8 BLOCK_LENGTH[3]; } DASDModeParameterBlockDescriptor;
Discussion Direct Access Storage Device mode parameter block descriptor. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
1238
LongLBAModeParameterBlockDescriptor
typedef struct LongLBAModeParameterBlockDescriptor { UInt64 NUMBER_OF_BLOCKS; UInt8 DENSITY_CODE; UInt8 RESERVED[3]; UInt32 BLOCK_LENGTH; } LongLBAModeParameterBlockDescriptor;
Discussion Long LBA mode parameter block descriptor. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
ModePageFormatHeader
Discussion Mode Page format header. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
ModeParameterBlockDescriptor
typedef struct ModeParameterBlockDescriptor { UInt8 DENSITY_CODE; UInt8 NUMBER_OF_BLOCKS[3]; UInt8 RESERVED; UInt8 BLOCK_LENGTH[3]; } ModeParameterBlockDescriptor;
1239
Discussion General mode parameter block descriptor. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
SBCModePageCaching
typedef struct SBCModePageCaching { ModePageFormatHeader header; UInt8 flags; UInt8 DEMAND_READ_WRITE_RETENTION_PRIORITY; UInt16 DISABLE_PREFETCH_TRANSFER_LENGTH; UInt16 MINIMUM_PREFETCH; UInt16 MAXIMUM_PREFETCH; UInt16 MAXIMUM_PREFETCH_CEILING; UInt8 flags2; UInt8 NUMBER_OF_CACHE_SEGMENTS; UInt16 CACHE_SEGMENT_SIZE; UInt8 RESERVED; UInt8 NON_CACHE_SEGMENT_SIZE[3]; } SBCModePageCaching;
Discussion Caching Mode Page (PAGE CODE 0x08) format. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
SBCModePageFlexibleDisk
typedef struct SBCModePageFlexibleDisk { ModePageFormatHeader header; UInt16 TRANSFER_RATE; UInt8 NUMBER_OF_HEADS; UInt8 SECTORS_PER_TRACK;
1240
UInt16 DATA_BYTES_PER_SECTOR; UInt16 NUMBER_OF_CYLINDERS; UInt16 STARTING_CYLINDER_WRITE_PRECOMPENSATION; UInt16 STARTING_CYLINDER_REDUCED_WRITE_CURRENT; UInt16 DEVICE_STEP_RATE; UInt8 DEVICE_STEP_PULSE_WIDTH; UInt16 HEAD_SETTLE_DELAY; UInt8 MOTOR_ON_DELAY; UInt8 MOTOR_OFF_DELAY; UInt8 TRDY_SSN_MO; UInt8 SPC; UInt8 WRITE_COMPENSATION; UInt8 HEAD_LOAD_DELAY; UInt8 HEAD_UNLOAD_DELAY; UInt8 PIN_34_PIN_2; UInt8 PIN_4_PIN_1; UInt16 MEDIUM_ROTATION_RATE; UInt8 RESERVED[2]; } SBCModePageFlexibleDisk;
Discussion Flexible Disk Mode Page (PAGE CODE 0x05) format. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
SBCModePageFormatDevice
typedef struct SBCModePageFormatDevice { ModePageFormatHeader header; UInt16 TRACKS_PER_ZONE; UInt16 ALTERNATE_SECTORS_PER_ZONE; UInt16 ALTERNATE_TRACKS_PER_ZONE; UInt16 ALTERNATE_TRACKS_PER_LOGICAL_UNIT; UInt16 SECTORS_PER_TRACK; UInt16 DATA_BYTES_PER_PHYSICAL_SECTOR; UInt16 INTERLEAVE; UInt16 TRACK_SKEW_FACTOR; UInt16 CYLINDER_SKEW_FACTOR; UInt8 SSEC_HSEC_RMB_SURF; UInt8 RESERVED[3]; } SBCModePageFormatDevice;
1241
Discussion Format Device Mode Page (PAGE CODE 0x03) format. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
SBCModePageRigidDiskGeometry
typedef struct SBCModePageRigidDiskGeometry { ModePageFormatHeader header; UInt8 NUMBER_OF_CYLINDERS[3]; UInt8 NUMBER_OF_HEADS; UInt8 STARTING_CYLINDER_WRITE_PRECOMPENSATION[3]; UInt8 STARTING_CYLINDER_REDUCED_WRITE_CURRENT[3]; UInt16 DEVICE_STEP_RATE; UInt8 LANDING_ZONE_CYLINDER[3]; UInt8 RPL; UInt8 ROTATIONAL_OFFSET; UInt8 RESERVED; UInt16 MEDIUM_ROTATION_RATE; UInt8 RESERVED1[2]; } SBCModePageRigidDiskGeometry;
Discussion Rigid Disk Geometry Mode Page (PAGE CODE 0x04) format. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
SPCModePagePowerCondition
typedef struct SPCModePagePowerCondition { ModePageFormatHeader header; UInt8 RESERVED; UInt8 IDLE_STANDBY; UInt32 IDLE_CONDITION_TIMER;
1242
Discussion Power Conditions Mode Page (PAGE CODE 0x1A) format. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
SPCModeParameterHeader10
typedef struct SPCModeParameterHeader10 { UInt16 MODE_DATA_LENGTH; UInt8 MEDIUM_TYPE; UInt8 DEVICE_SPECIFIC_PARAMETER; UInt8 LONGLBA; UInt8 RESERVED; UInt16 BLOCK_DESCRIPTOR_LENGTH; } SPCModeParameterHeader10;
Discussion Mode Parameter Header for the MODE_SENSE_10 command. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
SPCModeParameterHeader6
typedef struct SPCModeParameterHeader6 { UInt8 MODE_DATA_LENGTH; UInt8 MEDIUM_TYPE; UInt8 DEVICE_SPECIFIC_PARAMETER; UInt8 BLOCK_DESCRIPTOR_LENGTH; } SPCModeParameterHeader6;
1243
Discussion Mode Parameter Header for the MODE_SENSE_6 command. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_MODE_Definitions.h
Constants
See the Overview for header-level documentation.
enum { kSBCModePageCaching_RCD_Bit = 0, kSBCModePageCaching_MF_Bit = 1, kSBCModePageCaching_WCE_Bit = 2, kSBCModePageCaching_SIZE_Bit = 3, kSBCModePageCaching_DISC_Bit = 4, kSBCModePageCaching_CAP_Bit = 5, kSBCModePageCaching_ABPF_Bit = 6, kSBCModePageCaching_IC_Bit = 7, kSBCModePageCaching_RCD_Mask = ( 1 << kSBCModePageCaching_RCD_Bit), kSBCModePageCaching_MF_Mask = ( 1 << kSBCModePageCaching_MF_Bit), kSBCModePageCaching_WCE_Mask = ( 1 << kSBCModePageCaching_WCE_Bit), kSBCModePageCaching_SIZE_Mask = ( 1 << kSBCModePageCaching_SIZE_Bit), kSBCModePageCaching_DISC_Mask = ( 1 << kSBCModePageCaching_DISC_Bit), kSBCModePageCaching_CAP_Mask = ( 1 << kSBCModePageCaching_CAP_Bit), kSBCModePageCaching_ABPF_Mask = ( 1 << kSBCModePageCaching_ABPF_Bit), kSBCModePageCaching_IC_Mask = ( 1 << kSBCModePageCaching_IC_Bit) };
1244
Constants
kSBCModePageCaching_RCD_Bit
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
1245
kSBCModePageCaching_MF_Mask
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_WCE_Mask
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_SIZE_Mask
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_DISC_Mask
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_CAP_Mask
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_ABPF_Mask
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_IC_Mask
Mask for use with flags field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Bit field definitions and masks for Caching flags field.
1246
kSBCModePageCaching_VS1_Bit = 3, kSBCModePageCaching_VS2_Bit = 4, kSBCModePageCaching_DRA_Bit = 5, kSBCModePageCaching_LBCSS_Bit = 6, kSBCModePageCaching_FSW_Bit = 7, kSBCModePageCaching_VS1_Mask = ( 1 << kSBCModePageCaching_VS1_Bit), kSBCModePageCaching_VS2_Mask = ( 1 << kSBCModePageCaching_VS2_Bit), kSBCModePageCaching_DRA_Mask = ( 1 << kSBCModePageCaching_DRA_Bit), kSBCModePageCaching_LBCSS_Mask = ( 1 << kSBCModePageCaching_LBCSS_Bit), kSBCModePageCaching_FSW_Mask = ( 1 << kSBCModePageCaching_FSW_Bit) };
Constants
kSBCModePageCaching_VS1_Bit
1247
kSBCModePageCaching_VS1_Mask
Mask for use with flags2 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_VS2_Mask
Mask for use with flags2 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_DRA_Mask
Mask for use with flags2 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_LBCSS_Mask
Mask for use with flags2 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCaching_FSW_Mask
Mask for use with flags2 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Bit field definitions and masks for Caching flags2 field.
Constants
kSBCModePageCaching_DEMAND_WRITE_Mask
Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
1248
kSBCModePageCaching_DEMAND_READ_Mask
Mask for the DEMAND_READ_WRITE_RETENTION_PRIORITY field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Demand Read/Write Retention masks.
Constants
kModeSenseSBCDeviceSpecific_DPOFUABit
Bit to indicate DPO and FUA bits are accepted by the device server. Available in OS X v10.6 and later. Declared in SCSICmds_MODE_Definitions.h.
kModeSenseSBCDeviceSpecific_WriteProtectBit
Bit to indicate medium is write protected. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kModeSenseSBCDeviceSpecific_DPOFUAMask
Mask to test for kModeSenseSBCDeviceSpecific_DPOFUABit. Available in OS X v10.6 and later. Declared in SCSICmds_MODE_Definitions.h.
kModeSenseSBCDeviceSpecific_WriteProtectMask
Mask to test for kModeSenseSBCDeviceSpecific_WriteProtectBit. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion SBC definitions for Device Specific Parameter in the Mode Sense Header Block.
1249
Constants
kModeSenseParameterHeader10_LongLBABit
Bit to indicate Long LBA block descriptors follow. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kModeSenseParameterHeader10_LongLBAMask
Mask to test for kModeSenseParameterHeader10_LongLBABit. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Long LBA Bitfield definitions for Mode Parameter Header for MODE_SENSE_10 command.
Constants
kModePageFormat_PS_Bit
Bit to indicate Parameters Saveable. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kModePageFormat_PAGE_CODE_Mask
Mask to obtain the PAGE_CODE from the PS_PAGE_CODE field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
1250
kModePageFormat_PS_Mask
Mask to test for kModePageFormat_PS_Bit. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Mode Page Format bit definitions.
PIN_34_PIN_2 bitfields
Constants
kSBCModePageFlexibleDisk_PIN_2_Mask
Mask for use with PIN_34_PIN_2 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageFlexibleDisk_PIN_34_Mask
Mask for use with PIN_34_PIN_2 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Bit field definitions and masks for Flexible Disk PIN_34_PIN_2 field.
PIN_4_PIN_1 bitfields
1251
Constants
kSBCModePageFlexibleDisk_PIN_1_Mask
Mask for use with PIN_4_PIN_1 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageFlexibleDisk_PIN_4_Mask
Mask for use with PIN_4_PIN_1 field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Bit field definitions and masks for Flexible Disk PIN_4_PIN_1 field.
Constants
kSBCModePageRigidDiskGeometry_RPL_Mask
Mask for use with the RPL field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Bit field masks for Rigid Disk Geometry structure fields.
1252
Constants
kSBCModePageFormatDeviceCode
Format Device Mode Page value. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageRigidDiskGeometryCode
Rigid Disk Geometry Page value. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageFlexibleDiskCode
Flexible Disk Page value. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageCachingCode
Caching Page value. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion SBC Mode Page definitions.
SPC bitfields
Constants
kSBCModePageFlexibleDisk_SPC_Mask
Mask for use with SPC field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Bit field definitions and masks for Flexible Disk SPC field.
1253
Constants
kSPCModePagePowerConditionCode
Power Conditions Mode Page value. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSPCModePageAllPagesCode
All Mode Pages value. Available in OS X v10.5 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion SPC Mode Page definitions.
TRDY_SSN_MO bitfields
enum { // Bits 0:4 Reserved kSBCModePageFlexibleDisk_MO_Bit = 5, kSBCModePageFlexibleDisk_SSN_Bit = 6, kSBCModePageFlexibleDisk_TRDY_Bit = 7, kSBCModePageFlexibleDisk_MO_Mask = ( 1 << kSBCModePageFlexibleDisk_MO_Bit), kSBCModePageFlexibleDisk_SSN_Mask = ( 1 << kSBCModePageFlexibleDisk_SSN_Bit), kSBCModePageFlexibleDisk_TRDY_Mask = ( 1 << kSBCModePageFlexibleDisk_TRDY_Bit) };
Constants
kSBCModePageFlexibleDisk_MO_Bit
1254
kSBCModePageFlexibleDisk_SSN_Bit
Mask for use with TRDY_SSN_MO field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageFlexibleDisk_SSN_Mask
Mask for use with TRDY_SSN_MO field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h.
kSBCModePageFlexibleDisk_TRDY_Mask
Mask for use with TRDY_SSN_MO field. Available in OS X v10.3 and later. Declared in SCSICmds_MODE_Definitions.h. Discussion Bit field definitions and masks for Flexible Disk TRDY_SSN_MO field.
1255
Overview
This file contains all definitions for the data returned from the READ CAPACITY 10 (0x25) and READ CAPACITY 16 (0x9E) commands.
Included Headers
<IOKit/IOTypes.h> <CoreFoundation/CoreFoundation.h>
Data Types
See the Overview for header-level documentation.
SCSI_Capacity_Data
Discussion Capacity return structure for READ CAPACITY 10 command. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_READ_CAPACITY_Definitions.h
1256
SCSI_Capacity_Data_Long
typedef struct SCSI_Capacity_Data_Long { UInt64 RETURNED_LOGICAL_BLOCK_ADDRESS; UInt32 BLOCK_LENGTH_IN_BYTES; UInt8 RTO_EN_PROT_EN; UInt8 Reserved[19]; } SCSI_Capacity_Data_Long;
Discussion Capacity return structure for READ CAPACITY 16 command. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_READ_CAPACITY_Definitions.h
Constants
See the Overview for header-level documentation.
Defines
Constants
kREPORT_CAPACITY_16_MaximumLBA
Maximum LBA supported via READ CAPACITY 16 command. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h.
kREPORT_CAPACITY_MaximumLBA
Maximum LBA supported via READ CAPACITY 10 command. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h.
1257
Constants
kREAD_CAPACITY_PROT_Enabled
Mask to use when checking the RTO_EN_PROT_EN field. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h. Discussion Values for the PROTECTION INFORMATION (PROT_EN) bit in the READ CAPACITY Long Data structure.
Constants
kREPORT_CAPACITY_DataSize
Data size for a READ_CAPACITY command. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h.
1258
kREPORT_CAPACITY_16_DataSize
Data size for a READ_CAPACITY_16 command. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h. Discussion Sizes of the payload for the READ CAPACITY 10 and READ CAPACITY 16 commands.
RTO_EN definitions
Constants
kREAD_CAPACITY_RTO_Enabled
Reference Tag Own enabled. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h.
kREAD_CAPACITY_RTO_Disabled
Reference Tag Own disabled. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h.
kREAD_CAPACITY_RTO_Mask
Mask to use when checking the RTO_EN_PROT_EN field. Available in OS X v10.3 and later. Declared in SCSICmds_READ_CAPACITY_Definitions.h. Discussion Values for the REFERENCE TAG OWN (RTO_EN) bit in the READ CAPACITY Long Data structure.
1259
Overview
This file contains all definitions for the data returned from the REPORT_LUNS (0xA0) command.
Included Headers
<IOKit/IOTypes.h> <CoreFoundation/CoreFoundation.h>
Data Types
See the Overview for header-level documentation.
REPORT_LUNS_LOGICAL_UNIT_ADDRESSING
typedef struct REPORT_LUNS_LOGICAL_UNIT_ADDRESSING { #ifdef __LITTLE_ENDIAN__ UInt16 LUN : 5; UInt16 BUS_NUMBER : 3; UInt16 TARGET : 6; UInt16 reserved2 : 1; UInt16 reserved : 1; #else /* !__LITTLE_ENDIAN__ */ UInt16 reserved : 1; UInt16 reserved2 : 1; UInt16 TARGET : 6; UInt16 BUS_NUMBER : 3; UInt16 LUN : 5; #endif /* !__LITTLE_ENDIAN__ */ } REPORT_LUNS_LOGICAL_UNIT_ADDRESSING;
1260
Discussion This structure represents a LUN Addressing scheme. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_REPORT_LUNS_Definitions.h
REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING
typedef struct REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING { #ifdef __LITTLE_ENDIAN__ UInt16 TARGET_LUN : 8; UInt16 BUS_IDENTIFIER : 6; UInt16 reserved2 : 1; UInt16 reserved : 1; #else /* !__LITTLE_ENDIAN__ */ UInt16 reserved : 1; UInt16 reserved2 : 1; UInt16 BUS_IDENTIFIER : 6; UInt16 TARGET_LUN : 8; #endif /* !__LITTLE_ENDIAN__ */ } REPORT_LUNS_PERIPHERAL_DEVICE_ADDRESSING;
Discussion This structure represents a Peripheral Device Addressing scheme. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_REPORT_LUNS_Definitions.h
SCSICmd_REPORT_LUNS_LUN_ENTRY
typedef struct SCSICmd_REPORT_LUNS_LUN_ENTRY { UInt16 FIRST_LEVEL_ADDRESSING; UInt16 SECOND_LEVEL_ADDRESSING; UInt16 THIRD_LEVEL_ADDRESSING; UInt16 FOURTH_LEVEL_ADDRESSING; } SCSICmd_REPORT_LUNS_LUN_ENTRY;
1261
Discussion This structure represents a single LUN entry in a LUN list returned via the REPORT_LUNS command. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_REPORT_LUNS_Definitions.h
SCSICmd_REPORT_LUNS_Header
typedef struct SCSICmd_REPORT_LUNS_Header { UInt32 LUN_LIST_LENGTH; // LUN list length in bytes. UInt32 RESERVED; SCSICmd_REPORT_LUNS_LUN_ENTRY LUN[1]; // Variable length list. Must have at least LUN 0 if } SCSICmd_REPORT_LUNS_Header; // Target supports REPORT_LUNS command.
Discussion This structure defines the format of the data that is returned for the REPORT_LUNS command. Availability Available in OS X v10.3 and later. Declared in
SCSICmds_REPORT_LUNS_Definitions.h
Constants
See the Overview for header-level documentation.
Defines
#define kREPORT_LUNS_HeaderSize 8
1262
Constants
kREPORT_LUNS_HeaderSize
Size of the REPORT_LUNS header as defined in the SPC-3 specification. Available in OS X v10.3 and later. Declared in SCSICmds_REPORT_LUNS_Definitions.h.
Constants
kREPORT_LUNS_ADDRESS_METHOD_PERIPHERAL_DEVICE
Peripheral Device Addressing Method. Available in OS X v10.3 and later. Declared in SCSICmds_REPORT_LUNS_Definitions.h.
kREPORT_LUNS_ADDRESS_DEVICE_TYPE_SPECIFIC
Device Type Specific Addressing Method. Available in OS X v10.3 and later. Declared in SCSICmds_REPORT_LUNS_Definitions.h.
kREPORT_LUNS_ADDRESS_METHOD_LOGICAL_UNIT
Logical Unit Specific Addressing Method. Available in OS X v10.3 and later. Declared in SCSICmds_REPORT_LUNS_Definitions.h.
kREPORT_LUNS_ADDRESS_METHOD_OFFSET
Offset to the address method data. Available in OS X v10.3 and later. Declared in SCSICmds_REPORT_LUNS_Definitions.h. Discussion REPORT_LUNS addressing methods described in SAM-2 documents.
1263
Overview
This file contains all definitions for the data returned from the REQUEST SENSE (0x03) command and from auto sense on protocols that support it.
Included Headers
<IOKit/IOTypes.h> <CoreFoundation/CoreFoundation.h>
Data Types
See the Overview for header-level documentation.
SCSI_Sense_Data
typedef struct SCSI_Sense_Data { UInt8 VALID_RESPONSE_CODE; // 7 = Valid. 6-0 = Response Code. UInt8 SEGMENT_NUMBER; // Segment number UInt8 SENSE_KEY; // 7 = FILEMARK, 6 = EOM, 5 = ILI, 3-0 = SENSE KEY. UInt8 INFORMATION_1; // INFORMATION. UInt8 INFORMATION_2; // INFORMATION. UInt8 INFORMATION_3; // INFORMATION. UInt8 INFORMATION_4; // INFORMATION. UInt8 ADDITIONAL_SENSE_LENGTH; // Number of additional bytes available in sense data UInt8 COMMAND_SPECIFIC_INFORMATION_1; // Command Specific Information UInt8 COMMAND_SPECIFIC_INFORMATION_2; // Command Specific Information UInt8 COMMAND_SPECIFIC_INFORMATION_3; // Command Specific Information UInt8 COMMAND_SPECIFIC_INFORMATION_4; // Command Specific Information UInt8 ADDITIONAL_SENSE_CODE; // Additional Sense Code UInt8 ADDITIONAL_SENSE_CODE_QUALIFIER; // Additional Sense Code Qualifier
1264
UInt8 FIELD_REPLACEABLE_UNIT_CODE; // Field Replaceable Unit Code UInt8 SKSV_SENSE_KEY_SPECIFIC_MSB; // 7 = Sense Key Specific Valid bit, 6-0 Sense Key Specific MSB UInt8 SENSE_KEY_SPECIFIC_MID; // Sense Key Specific Middle UInt8 SENSE_KEY_SPECIFIC_LSB; // Sense Key Specific LSB } SCSI_Sense_Data;
Discussion The basic SCSI Request Sense data structure. Availability Available in OS X v10.0 and later. Declared in
SCSICmds_REQUEST_SENSE_Defs.h
Constants
See the Overview for header-level documentation.
Constants
kSENSE_EOM_Set
End Of Medium bit is set. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_EOM_Not_Set
End Of Medium bit is not set. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_EOM_Mask
Mask to use when checking the SENSE_KEY field for the EOM bit. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
1265
Discussion Masks and values to determine the End Of Medium bit field.
Constants
kSENSE_FILEMARK_Set
Filemark bit is not set. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_FILEMARK_Mask
Mask to use when checking the SENSE_KEY field for the FILEMARK bit. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h. Discussion Masks and values to determine the FileMark bit field.
1266
Constants
kSENSE_ILI_Set
Incorrect Length Indicator bit is set. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_ILI_Not_Set
Incorrect Length Indicator bit is not set. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_ILI_Mask
Mask to use when checking the SENSE_KEY field for the ILI bit. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h. Discussion Masks and values to determine the Incorrect Length Indicator bit field.
kSenseDefaultSize
enum { kSenseDefaultSize = 18 };
enum { kSENSE_KEY_NO_SENSE = 0x00, kSENSE_KEY_RECOVERED_ERROR = 0x01, kSENSE_KEY_NOT_READY = 0x02, kSENSE_KEY_MEDIUM_ERROR = 0x03, kSENSE_KEY_HARDWARE_ERROR = 0x04, kSENSE_KEY_ILLEGAL_REQUEST = 0x05, kSENSE_KEY_UNIT_ATTENTION = 0x06, kSENSE_KEY_DATA_PROTECT = 0x07, kSENSE_KEY_BLANK_CHECK = 0x08, kSENSE_KEY_VENDOR_SPECIFIC = 0x09,
1267
kSENSE_KEY_COPY_ABORTED = 0x0A, kSENSE_KEY_ABORTED_COMMAND = 0x0B, /* SENSE KEY x0C is obsoleted */ kSENSE_KEY_VOLUME_OVERFLOW = 0x0D, kSENSE_KEY_MISCOMPARE = 0x0E, /* SENSE KEY x0F is reserved */ kSENSE_KEY_Mask = 0x0F };
Constants
kSENSE_KEY_NO_SENSE
A recovered error has occurred. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_NOT_READY
Device server is not ready. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_MEDIUM_ERROR
Device server detected a medium error. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_HARDWARE_ERROR
Device server detected a hardware error. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_ILLEGAL_REQUEST
Device server detected an illegal request. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_UNIT_ATTENTION
Device server indicates a unit attention condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
1268
kSENSE_KEY_DATA_PROTECT
Device server indicates a data protect condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_BLANK_CHECK
Device server indicates a blank check condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_VENDOR_SPECIFIC
Device server indicates a vendor specific condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_COPY_ABORTED
Device server indicates a copy aborted condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_ABORTED_COMMAND
Device server indicates an aborted command condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_VOLUME_OVERFLOW
Device server indicates a volume overflow condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_MISCOMPARE
Device server indicates a miscompare condition. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_KEY_Mask
Mask to use when checking the SENSE_KEY field for the SENSE_KEY value. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h. Discussion Masks and values to determine the SENSE_KEY.
1269
Constants
kSENSE_RESPONSE_CODE_Current_Errors
Response code indicating current errors are reported. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_RESPONSE_CODE_Deferred_Errors
Response code indicating deferred errors are reported. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_RESPONSE_CODE_Mask
Mask to use when checking the VALID_RESPONSE_CODE field. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h. Discussion Masks and values to determine the Response Code.
Sense Valid
Constants
kSENSE_DATA_VALID
1270
kSENSE_NOT_DATA_VALID
Sense data is not valid. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h.
kSENSE_DATA_VALID_Mask
Validity mask to use when checking the VALID_RESPONSE_CODE field. Available in OS X v10.0 and later. Declared in SCSICmds_REQUEST_SENSE_Defs.h. Discussion Masks to use to determine if sense data is valid or not.
1271
Declared in
SCSICommandDefinitions.h
Overview
This file contains all the definitions for types and constants that are used by the command set classes for building CDBs. The field type definitions are used for the parameters passed to a method that builds and sends any SCSI defined command to clearly identify the type of value expected for a parameter. The command methods will then use the appropriate mask to verify that the value passed into a parameter is of the specified type. Currently only types and masks are defined for 8 bytes and smaller fields. If a command is defined that uses a larger field, these should be expanded to include those sizes.
Included Headers
<IOKit/IOTypes.h> <CoreFoundation/CoreFoundation.h>
Data Types
See the Overview for header-level documentation.
SCSICmdField10Bit
1272
Declared in
SCSICommandDefinitions.h
SCSICmdField11Bit
SCSICmdField12Bit
SCSICmdField13Bit
SCSICmdField14Bit
1273
SCSICmdField15Bit
SCSICmdField17Bit
SCSICmdField18Bit
1274
SCSICmdField19Bit
SCSICmdField1Bit
SCSICmdField1Byte
SCSICmdField20Bit
1275
SCSICmdField21Bit
SCSICmdField22Bit
SCSICmdField23Bit
SCSICmdField25Bit
1276
Declared in
SCSICommandDefinitions.h
SCSICmdField26Bit
SCSICmdField27Bit
SCSICmdField28Bit
SCSICmdField29Bit
1277
SCSICmdField2Bit
SCSICmdField2Byte
SCSICmdField30Bit
1278
SCSICmdField31Bit
SCSICmdField33Bit
SCSICmdField34Bit
SCSICmdField35Bit
1279
SCSICmdField36Bit
SCSICmdField37Bit
SCSICmdField38Bit
SCSICmdField39Bit
1280
Declared in
SCSICommandDefinitions.h
SCSICmdField3Bit
SCSICmdField3Byte
SCSICmdField41Bit
SCSICmdField42Bit
1281
SCSICmdField43Bit
SCSICmdField44Bit
SCSICmdField45Bit
1282
SCSICmdField46Bit
SCSICmdField47Bit
SCSICmdField49Bit
SCSICmdField4Bit
1283
SCSICmdField4Byte
SCSICmdField50Bit
SCSICmdField51Bit
SCSICmdField52Bit
1284
Declared in
SCSICommandDefinitions.h
SCSICmdField53Bit
SCSICmdField54Bit
SCSICmdField55Bit
SCSICmdField57Bit
1285
SCSICmdField58Bit
SCSICmdField59Bit
SCSICmdField5Bit
1286
SCSICmdField5Byte
SCSICmdField60Bit
SCSICmdField61Bit
SCSICmdField62Bit
1287
SCSICmdField63Bit
SCSICmdField6Bit
SCSICmdField6Byte
SCSICmdField7Bit
1288
Declared in
SCSICommandDefinitions.h
SCSICmdField7Byte
SCSICmdField8Byte
SCSICmdField9Bit
Constants
See the Overview for header-level documentation.
1289
Defines
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kSCSICmdFieldMask10Bit 0x03FF kSCSICmdFieldMask11Bit 0x07FF kSCSICmdFieldMask12Bit 0x0FFF kSCSICmdFieldMask13Bit 0x1FFF kSCSICmdFieldMask14Bit 0x3FFF kSCSICmdFieldMask15Bit 0x7FFF kSCSICmdFieldMask17Bit 0x01FFFF kSCSICmdFieldMask18Bit 0x03FFFF kSCSICmdFieldMask19Bit 0x07FFFF kSCSICmdFieldMask1Bit 0x01 kSCSICmdFieldMask20Bit 0x0FFFFF kSCSICmdFieldMask21Bit 0x1FFFFF kSCSICmdFieldMask22Bit 0x3FFFFF kSCSICmdFieldMask23Bit 0x7FFFFF kSCSICmdFieldMask25Bit 0x01FFFFFFUL kSCSICmdFieldMask26Bit 0x03FFFFFFUL kSCSICmdFieldMask27Bit 0x07FFFFFFUL kSCSICmdFieldMask28Bit 0x0FFFFFFFUL kSCSICmdFieldMask29Bit 0x1FFFFFFFUL kSCSICmdFieldMask2Bit 0x03 kSCSICmdFieldMask2Byte 0xFFFF kSCSICmdFieldMask30Bit 0x3FFFFFFFUL kSCSICmdFieldMask31Bit 0x7FFFFFFFUL kSCSICmdFieldMask33Bit 0x01FFFFFFFFULL kSCSICmdFieldMask34Bit 0x03FFFFFFFFULL kSCSICmdFieldMask35Bit 0x07FFFFFFFFULL kSCSICmdFieldMask36Bit 0x0FFFFFFFFFULL kSCSICmdFieldMask37Bit 0x1FFFFFFFFFULL kSCSICmdFieldMask38Bit 0x3FFFFFFFFFULL kSCSICmdFieldMask39Bit 0x7FFFFFFFFFULL kSCSICmdFieldMask3Bit 0x07 kSCSICmdFieldMask3Byte 0xFFFFFF kSCSICmdFieldMask41Bit 0x01FFFFFFFFFFULL kSCSICmdFieldMask42Bit 0x03FFFFFFFFFFULL kSCSICmdFieldMask43Bit 0x07FFFFFFFFFFULL kSCSICmdFieldMask44Bit 0x0FFFFFFFFFFFULL kSCSICmdFieldMask45Bit 0x1FFFFFFFFFFFULL kSCSICmdFieldMask46Bit 0x3FFFFFFFFFFFULL kSCSICmdFieldMask47Bit 0x7FFFFFFFFFFFULL kSCSICmdFieldMask49Bit 0x01FFFFFFFFFFFFULL kSCSICmdFieldMask4Bit 0x0F kSCSICmdFieldMask4Byte 0xFFFFFFFFUL kSCSICmdFieldMask50Bit 0x03FFFFFFFFFFFFULL kSCSICmdFieldMask51Bit 0x07FFFFFFFFFFFFULL
1290
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kSCSICmdFieldMask52Bit 0x0FFFFFFFFFFFFFULL kSCSICmdFieldMask53Bit 0x1FFFFFFFFFFFFFULL kSCSICmdFieldMask54Bit 0x3FFFFFFFFFFFFFULL kSCSICmdFieldMask55Bit 0x7FFFFFFFFFFFFFULL kSCSICmdFieldMask57Bit 0x01FFFFFFFFFFFFFFULL kSCSICmdFieldMask58Bit 0x03FFFFFFFFFFFFFFULL kSCSICmdFieldMask59Bit 0x07FFFFFFFFFFFFFFULL kSCSICmdFieldMask5Bit 0x1F kSCSICmdFieldMask5Byte 0xFFFFFFFFFFULL kSCSICmdFieldMask60Bit 0x0FFFFFFFFFFFFFFFULL kSCSICmdFieldMask61Bit 0x1FFFFFFFFFFFFFFFULL kSCSICmdFieldMask62Bit 0x3FFFFFFFFFFFFFFFULL kSCSICmdFieldMask63Bit 0x7FFFFFFFFFFFFFFFULL kSCSICmdFieldMask6Bit 0x3F kSCSICmdFieldMask6Byte 0xFFFFFFFFFFFFULL kSCSICmdFieldMask7Bit 0x7F kSCSICmdFieldMask7Byte 0xFFFFFFFFFFFFFFULL kSCSICmdFieldMask8Byte 0xFFFFFFFFFFFFFFFFULL kSCSICmdFieldMask9Bit 0x01FF
Constants
kSCSICmdFieldMask10Bit
1291
kSCSICmdFieldMask18Bit
1292
kSCSICmdFieldMask2Bit
1293
kSCSICmdFieldMask3Byte
1294
kSCSICmdFieldMask51Bit
1295
kSCSICmdFieldMask62Bit
1296
Declared in
SCSITask.h
Overview
SCSITask typedefs and constants used inside the kernel and user space. Note that the SCSITaskIdentifier is an opaque object and that directly casting the SCSITaskIdentifier to any other type is discouraged. The SCSITask implementation changes when necessary to accomodate architectural changes, performance improvements, and bug fixes. Device and protocol layer drivers that need to access information contained in a SCSITask should use the appropriate accessor methods in IOSCSIPrimaryCommandsDevice.h or IOSCSIProtocolServices.h
Included Headers
Callbacks
See the Overview for header-level documentation.
SCSITaskCompletion
Discussion This is the typedef for completion routines that work with SCSITaskIdentifiers.
1297
Data Types
See the Overview for header-level documentation.
SCSIDeviceIdentifier
64-bit number to represent a SCSI Device.
Discussion If the identifier can either be that of an initiator or a target, SCSIDeviceIdentifier should be used. Availability Available in OS X v10.2 and later. Declared in
SCSITask.h
SCSIInitiatorIdentifier
64-bit number to represent a SCSI Initiator Device.
Discussion If the identifier is for an initiator only and not a target, then SCSIInitiatorIdentifier should be used. Availability Available in OS X v10.2 and later. Declared in
SCSITask.h
1298
SCSIServiceResponse
Attributes for task service response.
typedef enum SCSIServiceResponse { /*! */ kSCSIServiceResponse_Request_In_Process = 0, /*! */ kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE = 1, /*! */ kSCSIServiceResponse_TASK_COMPLETE = 2, /*! */ kSCSIServiceResponse_LINK_COMMAND_COMPLETE = 3, /*! */ kSCSIServiceResponse_FUNCTION_COMPLETE = 4, /*! */ kSCSIServiceResponse_FUNCTION_REJECTED = 5 } SCSIServiceResponse;
Constants
kSCSIServiceResponse_Request_In_Process
Not defined in SAM specification, but is a service response used for asynchronous commands that are not yet completed. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE
The service request failed because of a delivery or target failure. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSIServiceResponse_TASK_COMPLETE
The linked command completed. Available in OS X v10.0 and later. Declared in SCSITask.h.
1299
kSCSIServiceResponse_FUNCTION_COMPLETE
The task management function completed. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSIServiceResponse_FUNCTION_REJECTED
The task management function was rejected. Available in OS X v10.0 and later. Declared in SCSITask.h. Discussion The Service Response represents the execution status of a service request made to a Protocol Services Driver. The Service Response can only be modified by the SCSI Protocol Layer. The SCSI Application Layer can only read the state. Availability Available in OS X v10.0 and later. Declared in
SCSITask.h
SCSITaggedTaskIdentifier
64-bit number to represent a unique task identifier.
Discussion The Tagged Task Identifier is used when a Task has a Task Attribute other than SIMPLE. The SCSI Application Layer client that controls the Logical Unit for which a Task is intended is required to guarantee that the Task Tag Identifier is unique. Zero cannot be used a a Tag value as this is used to when a Tagged Task Identifier value is needed for a Task with a SIMPLE attribute. Availability Available in OS X v10.2 and later. Declared in
SCSITask.h
1300
SCSITargetIdentifier
64-bit number to represent a SCSI Target Device.
Discussion If the identifier is for a target only and not an initiator, then SCSITargetIdentifier should be used. Availability Available in OS X v10.2 and later. Declared in
SCSITask.h
SCSITaskAttribute
Attributes for task delivery.
Constants
kSCSITask_SIMPLE
The task has a simple attribute. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITask_ORDERED
The task has an ordered attribute. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITask_HEAD_OF_QUEUE
The task has a head-of-queue attribute. Available in OS X v10.0 and later. Declared in SCSITask.h.
1301
kSCSITask_ACA
The task has an auto-contingent-allegiance attribute. Available in OS X v10.0 and later. Declared in SCSITask.h. Discussion The Task Attribute defines how this task should be managed when determing order for queueing and submission to the appropriate device server. The Task Attribute is set by the SCSI Application Layer and cannot be modified by the SCSI Protocol Layer. Availability Available in OS X v10.0 and later. Declared in
SCSITask.h
SCSITaskIdentifier
Discussion This is an opaque object that represents a task. This is used so that drivers for both the SCSI Protocol Layer and the SCSI Application Layer cannot modify the SCSITask object directly but must instead use the inherited methods to do so. This allows the implementation of SCSITask to change without directly impacting device and protocol layer drivers. In addition, it prevents changing of properties that are not allowed to be changed by a given layer. Availability Available in OS X v10.7 through OS X v10.7. Declared in
SCSITask.h
SCSITaskMode
1302
Discussion The SCSI Task mode is used by the SCSI Protocol Layer to indicate what mode the task is executing. Availability Available in OS X v10.7 through OS X v10.7. Declared in
SCSITask.h
SCSITaskState
Attributes for task state.
Constants
kSCSITaskState_NEW_TASK
The task state is new task. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskState_ENABLED
The task is enabled and queued. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskState_BLOCKED
1303
kSCSITaskState_ENDED
The task is complete. Available in OS X v10.0 and later. Declared in SCSITask.h. Discussion The Task State represents the current state of the task. The state is set to NEW_TASK when the task is created. The SCSI Protocol Layer will then adjust the state as the task is queued and during execution. The SCSI Application Layer can examine the state to monitor the progress of a task. The Task State can only be modified by the SCSI Protocol Layer. The SCSI Application Layer can only read the state. Availability Available in OS X v10.0 and later. Declared in
SCSITask.h
SCSITaskStatus
Attributes for task status.
typedef enum SCSITaskStatus { /*! */ kSCSITaskStatus_GOOD = 0x00, /*! */ kSCSITaskStatus_CHECK_CONDITION = 0x02, /*! */ kSCSITaskStatus_CONDITION_MET = 0x04, /*! */ kSCSITaskStatus_BUSY = 0x08, /*! */ kSCSITaskStatus_INTERMEDIATE = 0x10, /*! */ kSCSITaskStatus_INTERMEDIATE_CONDITION_MET = 0x14, /*! */ kSCSITaskStatus_RESERVATION_CONFLICT = 0x18,
1304
/*! */ kSCSITaskStatus_TASK_SET_FULL = 0x28, /*! */ kSCSITaskStatus_ACA_ACTIVE = 0x30, /*! */ kSCSITaskStatus_TaskTimeoutOccurred = 0x01, /*! */ kSCSITaskStatus_ProtocolTimeoutOccurred = 0x02, /*! */ kSCSITaskStatus_DeviceNotResponding = 0x03, /*! */ kSCSITaskStatus_DeviceNotPresent = 0x04, /*! */ kSCSITaskStatus_DeliveryFailure = 0x05, /*! */ kSCSITaskStatus_No_Status = 0xFF } SCSITaskStatus;
Constants
kSCSITaskStatus_GOOD
The task completed with a status of GOOD. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_CHECK_CONDITION
The task completed with a status of CHECK_CONDITION. Additional information about the condition should be available in the sense data. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_CONDITION_MET
The task completed with a status of CONDITION_MET. Available in OS X v10.0 and later. Declared in SCSITask.h.
1305
kSCSITaskStatus_BUSY
The task completed with a status of BUSY. The device server might need time to process a request and a delay may be required. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_INTERMEDIATE
The task completed with a status of INTERMEDIATE. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_INTERMEDIATE_CONDITION_MET
The task completed with a status of INTERMEDIATE_CONDITION_MET. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_RESERVATION_CONFLICT
The task completed with a status of RESERVATION_CONFLICT. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_TASK_SET_FULL
The task completed with a status of TASK_SET_FULL. The device server may need to complete a task before the initiator sends another. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_ACA_ACTIVE
The task completed with a status of ACA_ACTIVE. The device server may need the initiator to clear the Auto-Contingent Allegiance condition before it will respond to new commands. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSITaskStatus_TaskTimeoutOccurred
If a task is aborted by the SCSI Protocol Layer due to it exceeding the timeout value specified by the task, the task status shall be set to kSCSITaskStatus_TaskTimeoutOccurred. Available in OS X v10.3 and later. Declared in SCSITask.h.
1306
kSCSITaskStatus_ProtocolTimeoutOccurred
If a task is aborted by the SCSI Protocol Layer due to it exceeding a timeout value specified by the support for the protocol or a related specification, the task status shall be set to kSCSITaskStatus_ProtocolTimeoutOccurred. Available in OS X v10.3 and later. Declared in SCSITask.h.
kSCSITaskStatus_DeviceNotResponding
If a task is unable to be delivered due to a failure of the device not accepting the task or the device acknowledging the attempt to send it the device the task status shall be set to kSCSITaskStatus_DeviceNotResponding. This will allow the SCSI Application driver to perform the necessary steps to try to recover the device. This shall only be reported after the SCSI Protocol Layer driver has attempted all protocol specific attempts to recover the device. Available in OS X v10.3 and later. Declared in SCSITask.h.
kSCSITaskStatus_DeviceNotPresent
If the task is unable to be delivered because the device has been detached, the task status shall be set to kSCSITaskStatus_DeviceNotPresent. This will allow the SCSI Application Layer to halt the sending of tasks to the device and, if supported, perform any device failover or system cleanup. Available in OS X v10.3 and later. Declared in SCSITask.h.
kSCSITaskStatus_DeliveryFailure
If the task is unable to be delivered to the device due to a failure in the SCSI Protocol Layer, such as a bus reset or communications error, but the device is is known to be functioning properly, the task status shall be set to kSCSITaskStatus_DeliveryFailure. This can also be reported if the task could not be delivered due to a protocol error that has since been corrected. Available in OS X v10.3 and later. Declared in SCSITask.h.
kSCSITaskStatus_No_Status
This status is not defined by the SCSI specifications, but is here to provide a status that can be returned in cases where there is not status available from the device or protocol, for example, when the service response is neither TASK_COMPLETED nor LINK_COMMAND_COMPLETE or when the service response is SERVICE_DELIVERY_OR_TARGET_FAILURE and the reason for failure could not be determined. Available in OS X v10.0 and later. Declared in SCSITask.h. Discussion The Task Status represents the completion status of the task which provides the SCSI Application Layer with additional information about how to procede in handling a completed task.
1307
The SCSI Architecture Model specification only defines task status values for when a task completes with a service response of either TASK_COMPLETED or LINK_COMMAND_COMPLETE. Since additional information will aid in error recovery when a task fails to be completed by a device due to a service response of kSCSIServiceResponse_SERVICE_DELIVERY_OR_TARGET_FAILURE, additional values have been defined that can be returned by the SCSI Protocol Layer to inform the SCSI Application Layer of the cause of the delivery failure. The Task Status can only be modified by the SCSI Protocol Layer. The SCSI Application Layer can only read the status Availability Available in OS X v10.0 and later. Declared in
SCSITask.h
Constants
See the Overview for header-level documentation.
enum { /*! */ kSCSICDBSize_Maximum = 16, /*! */ kSCSICDBSize_6Byte = 6, /*! */ kSCSICDBSize_10Byte = 10, /*! */ kSCSICDBSize_12Byte = 12, /*! */ kSCSICDBSize_16Byte = 16 };
1308
Constants
kSCSICDBSize_Maximum
This is the largest size a Command Descriptor Block can be as specified in SPC-2. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSICDBSize_6Byte
Use this for a 6-byte CDB. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSICDBSize_10Byte
Use this for a 10-byte CDB. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSICDBSize_12Byte
Use this for a 12-byte CDB. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSICDBSize_16Byte
Use this for a 16-byte CDB. Available in OS X v10.0 and later. Declared in SCSITask.h. Discussion Command Descriptor Block Size constants.
enum { /*! */ kSCSIDataTransfer_NoDataTransfer = 0x00, /*! */ kSCSIDataTransfer_FromInitiatorToTarget = 0x01, /*! */ kSCSIDataTransfer_FromTargetToInitiator = 0x02 };
1309
Constants
kSCSIDataTransfer_NoDataTransfer
Use this for tasks that transfer no data. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSIDataTransfer_FromInitiatorToTarget
Use this for tasks that transfer data from the initiator to the target. Available in OS X v10.0 and later. Declared in SCSITask.h.
kSCSIDataTransfer_FromTargetToInitiator
Use this for tasks that transfer data from the target to the initiator. Available in OS X v10.0 and later. Declared in SCSITask.h. Discussion DataTransferDirection constants.
enum { kSCSIUntaggedTaskIdentifier = 0 };
Constants
kSCSIUntaggedTaskIdentifier
This value means the task is untagged. Available in OS X v10.2 and later. Declared in SCSITask.h. Discussion The Untagged Task Identifier is used to indicate no unique tag is associated with the Task.
1310
SCSITaskLib.h Reference
Declared in
SCSITaskLib.h
Overview
SCSITaskLib implements non-kernel task access to specific IOKit object types, namely any SCSI Peripheral Device for which there isn't an in-kernel driver and for authoring devices such as CD-R/W and DVD-R/W drives.
Included Headers
Callbacks
See the Overview for header-level documentation.
SCSITaskCallbackFunction
Asynchronous callback routine definition.
1311
Parameters
serviceResponse
The refCon passed when the task was executed. Discussion Asynchronous callback routine definition. Any function which is used as a callback routine for SCSITasks must conform to this function definition. Availability Available in OS X v10.1 and later. Declared in
SCSITaskLib.h
Constants
See the Overview for header-level documentation.
Defines
#define kIOMMCDeviceInterfaceID \ CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x1F, 0x65, 0x11, 0x06, 0x23, 0xCC, 0x11,
1312
0xD5, \ 0xBB, 0xDB, 0x00, 0x30, 0x65, 0x70, 0x48, 0x66) #define kIOMMCDeviceUserClientTypeID \ CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x97, 0xAB, 0xCF, 0x2C, 0x23, 0xCC, 0x11, 0xD5, \ 0xA0, 0xE8, 0x00, 0x30, 0x65, 0x70, 0x48, 0x66) #define kIOPropertySCSITaskAuthoringDevice "SCSITaskAuthoringDevice" #define kIOPropertySCSITaskDeviceCategory "SCSITaskDeviceCategory" #define kIOPropertySCSITaskUserClientDevice "SCSITaskUserClientDevice" #define kIOPropertySCSITaskUserClientInstanceGUID "SCSITaskUserClient GUID" #define kIOSCSITaskDeviceInterfaceID \ CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x1B, 0xBC, 0x41, 0x32, 0x08, 0xA5, 0x11, 0xD5, \ 0x90, 0xED, 0x00,
1313
0x30, 0x65, 0x7D, 0x05, 0x2A) #define kIOSCSITaskDeviceUserClientTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x7D, 0x66, 0x67, 0x8E, 0x08, 0xA2, 0x11, 0xD5, \ 0xA1, 0xB8, 0x00, 0x30, 0x65, 0x7D, 0x05, 0x2A) #define kIOSCSITaskInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x0B, 0x85, 0xB6, 0x3C, 0x46, 0x2E, 0x11, 0xD5, \ 0xA9, 0xD6, 0x00, 0x30, 0x65, 0x70, 0x48, 0x66) #define kIOSCSITaskLibFactoryID CFUUIDGetConstantUUIDWithBytes(NULL, \ 0x63, 0x32, 0x6D, 0x72,
1314
0x08, 0xA2, 0x11, 0xD5, \ 0x86, 0x5F, 0x00, 0x30, 0x65, 0x7D, 0x05, 0x2A)
Constants
kIOMMCDeviceInterfaceID
Factory ID for creating an MMC Device User Client. Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
kIOPropertySCSITaskAuthoringDevice
IORegistry property for the SCSI Task User Client. This property identifies an SCSITask enabled device capable of authoring. Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
kIOPropertySCSITaskDeviceCategory
IORegistry property for the SCSITaskUserClient. This category identifies which type of device and interface to the device is used in conjunction with the SCSITaskUserClient. Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
kIOPropertySCSITaskUserClientDevice
IORegistry property for the SCSI Task User Client. This property identifies an SCSITask enabled device. Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
1315
kIOPropertySCSITaskUserClientInstanceGUID
IORegistry property for the SCSITaskUserClient GUID. This GUID helps uniquely identify and track SCSITask enabled devices Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
kIOSCSITaskDeviceInterfaceID
Factory ID for creating an SCSITask Device User Client. Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
kIOSCSITaskInterfaceID
UUID for the SCSITaskLib Factory. Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
MMCDeviceTrayState
Used to identify the state of an MMCDevice's tray (if applicable).
Constants
kMMCDeviceTrayClosed
This value means the tray is closed. Available in OS X v10.1 and later. Declared in SCSITaskLib.h.
1316
kMMCDeviceTrayOpen
This value means the tray is open. Available in OS X v10.1 and later. Declared in SCSITaskLib.h. Discussion Used to identify the state of an MMCDevice's tray (if applicable).
1317
Declared in
USB.h
Overview
Included Headers
Functions by Task
See the Overview for header-level documentation.
UNKNOWN OBJECT
iokit_usb_err (page 1319)
Miscellaneous
EncodeRequest (page 1319)
1318
Functions
EncodeRequest
#define EncodeRequest(request, direction, type, recipient) \ (((UInt16)request << 8) + \ ((UInt16)recipient + \ ((UInt16)type << kUSBRqTypeShift) + \ ((UInt16)direction << kUSBRqDirnShift)))
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. Availability Available in OS X v10.0 and later. Declared in
USB.h
iokit_usb_err
Discussion Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Availability Available in OS X v10.0 and later. See Also
IOUSBFamily error codes
Declared in
USB.h
iokit_usb_msg
1319
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. Availability Available in OS X v10.1 and later. See Also
IOUSBFamily message codes
Declared in
USB.h
USBmakebmRequestType
#define USBmakebmRequestType(direction, type, recipient) \ (((direction & kUSBRqDirnMask) << kUSBRqDirnShift) | \ ((type & kUSBRqTypeMask) << kUSBRqTypeShift) | \ (recipient & kUSBRqRecipientMask))
Discussion Macro to encode the bRequest field of a Device Request. It is used when constructing an IOUSBDevRequest. Availability Available in OS X v10.0 and later.
Related Sample Code Deva_Example
Declared in
USB.h
Callbacks
See the Overview for header-level documentation.
IOUSBCompletionAction
1320
Parameters
target
Completion status.
bufferSizeRemaining
Bytes left to be transferred. Discussion Function called when USB I/O completes. Availability Available in OS X v10.0 and later. Declared in
USB.h
IOUSBCompletionActionWithTimeStamp
typedef void ( *IOUSBCompletionActionWithTimeStamp)( void *target, void *parameter, IOReturn status, UInt32 bufferSizeRemaining, AbsoluteTime timeStamp);
Parameters
target
Completion status.
bufferSizeRemaining
1321
timeStamp
Time at which the transaction was processed. Discussion Function called when USB I/O completes. Availability Available in OS X v10.3 and later. Declared in
USB.h
IOUSBIsocCompletionAction
typedef void ( *IOUSBIsocCompletionAction)( void *target, void *parameter, IOReturn status, IOUSBIsocFrame *pFrames);
Parameters
target
Completion status.
pFrames
Pointer to the frame list containing the status for each frame transferred. Discussion Function called when Isochronous USB I/O completes. Availability Available in OS X v10.0 and later. Declared in
USB.h
1322
IOUSBLowLatencyIsocCompletionAction
typedef void ( *IOUSBLowLatencyIsocCompletionAction)( void *target, void *parameter, IOReturn status, IOUSBLowLatencyIsocFrame *pFrames);
Parameters
target
Completion status.
pFrames
Pointer to the low latency frame list containing the status for each frame transferred. Discussion Function called when Low Latency Isochronous USB I/O completes. Availability Available in OS X v10.2 and later. Declared in
USB.h
Data Types
See the Overview for header-level documentation.
IOUSBBOSDescriptor
Discussion BOS Descriptor for a USB Device. . Availability Available in OS X v10.8 and later.
1323
See Also
IOUSBBOSDescriptor (page 1342)
Declared in
USB.h
IOUSBCompletion
typedef struct IOUSBCompletion { void *target; IOUSBCompletionAction action; void *parameter; } IOUSBCompletion;
Discussion Struct specifying action to perform when a USB I/O completes. Availability Available in OS X v10.0 and later. Declared in
USB.h
IOUSBCompletionWithTimeStamp
typedef struct IOUSBCompletionWithTimeStamp { void *target; IOUSBCompletionActionWithTimeStamp action; void *parameter; } IOUSBCompletionWithTimeStamp;
Discussion Struct specifying action to perform when a USB I/O completes. Availability Available in OS X v10.3 and later. Declared in
USB.h
1324
IOUSBConfigurationDescHeader
Discussion Header of a IOUSBConfigurationDescriptor. Used to get the total length of the descriptor. Availability Available in OS X v10.1 and later. See Also
IOUSBConfigurationDescHeader (page 1342)
Declared in
USB.h
IOUSBConfigurationDescriptor
Discussion Standard USB Configuration Descriptor. It is variable length, so this only specifies the known fields. We use the wTotalLength field to read the whole descriptor. See the USB Specification at http://www.usb.org. Availability Available in OS X v10.0 and later. See Also
IOUSBConfigurationDescriptor (page 1343)
Declared in
USB.h
IOUSBDescriptorHeader
Discussion Standard header used for all USB descriptors. Used to read the length of a descriptor so that we can allocate storage for the whole descriptor later on.
1325
Declared in
USB.h
IOUSBDeviceCapabilityContainerID
Discussion Device Capability Container ID Availability Available in OS X v10.8 and later. See Also
IOUSBDeviceCapabilityContainerID (page 1343)
Declared in
USB.h
IOUSBDeviceCapabilityDescriptorHeader
Discussion Header for a Device Capability Descriptor for a USB Device. . Availability Available in OS X v10.8 and later. See Also
IOUSBDeviceCapabilityDescriptorHeader (page 1344)
Declared in
USB.h
1326
IOUSBDeviceCapabilitySuperSpeedUSB
Discussion Device Capability SuperSpeed USB Availability Available in OS X v10.8 and later. See Also
IOUSBDeviceCapabilitySuperSpeedUSB (page 1344)
Declared in
USB.h
IOUSBDeviceCapabilityUSB2Extension
Discussion Device Capability USB 2.0 Extension Availability Available in OS X v10.8 and later. See Also
IOUSBDeviceCapabilityUSB2Extension (page 1345)
Declared in
USB.h
IOUSBDeviceDescriptor
Discussion Descriptor for a USB Device. See the USB Specification at http://www.usb.org.
1327
Declared in
USB.h
IOUSBDeviceQualifierDescriptor
Discussion USB Device Qualifier Descriptor. See the USB Specification at http://www.usb.org. Availability Available in OS X v10.2 and later. See Also
IOUSBDeviceQualifierDescriptor (page 1346)
Declared in
USB.h
IOUSBDevRequest
typedef struct { UInt8 bmRequestType; UInt8 bRequest; UInt16 wValue; UInt16 wIndex; UInt16 wLength; void *pData; UInt32 wLenDone; } IOUSBDevRequest;
Discussion Parameter block for control requests, using a simple pointer for the data to be transferred.
1328
IOUSBDevRequestDesc
typedef struct { UInt8 bmRequestType; UInt8 bRequest; UInt16 wValue; UInt16 wIndex; UInt16 wLength; IOMemoryDescriptor *pData; UInt32 wLenDone; } IOUSBDevRequestDesc;
Discussion Parameter block for control requests, using a memory descriptor for the data to be transferred. Only available in the kernel. Availability Available in OS X v10.7 through OS X v10.7. Declared in
USB.h
IOUSBDevRequestTO
typedef struct { UInt8 bmRequestType; UInt8 bRequest; UInt16 wValue; UInt16 wIndex; UInt16 wLength; void *pData; UInt32 wLenDone; UInt32 noDataTimeout; UInt32 completionTimeout; } IOUSBDevRequestTO;
1329
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. Availability Available in OS X v10.1 and later. Declared in
USB.h
IOUSBDFUDescriptor
Discussion USB Device Firmware Update Descriptor. See the USB Device Firmware Update Specification at http://www.usb.org. Availability Available in OS X v10.2 and later. See Also
IOUSBDFUDescriptor (page 1346)
Declared in
USB.h
IOUSBEndpointDescriptor
Discussion Descriptor for a USB Endpoint. See the USB Specification at http://www.usb.org. Availability Available in OS X v10.0 and later. See Also
IOUSBEndpointDescriptor (page 1346)
1330
Declared in
USB.h
IOUSBFindEndpointRequest
typedef struct { UInt8 type; UInt8 direction; UInt16 maxPacketSize; UInt8 interval; } 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. Availability Available in OS X v10.0 and later. Declared in
USB.h
IOUSBFindInterfaceRequest
typedef struct { UInt16 bInterfaceClass; // requested class UInt16 bInterfaceSubClass; // requested subclass UInt16 bInterfaceProtocol; // requested protocol UInt16 bAlternateSetting; // requested alt setting } IOUSBFindInterfaceRequest;
Discussion Structure used with FindNextInterface. Availability Available in OS X v10.0 and later. Declared in
USB.h
1331
IOUSBGetFrameStruct
Discussion Structure used from user space to return the frame number and a timestamp on when the frame register was read. Availability Available in OS X v10.0 and later. Declared in
USB.h
IOUSBHIDDescriptor
Discussion USB HID Descriptor. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment. Availability Available in OS X v10.0 and later. See Also
IOUSBHIDDescriptor (page 1347)
Declared in
USB.h
IOUSBHIDReportDesc
1332
Discussion USB HID Report Descriptor header. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment. Availability Available in OS X v10.0 and later. See Also
IOUSBHIDReportDesc (page 1347)
Declared in
USB.h
IOUSBInterfaceAssociationDescriptor
Discussion USB Inerface Association Descriptor. ECN to the USB 2.0 Spec. See the USB Specification at http://www.usb.org. Availability Available in OS X v10.3 and later. See Also
IOUSBInterfaceAssociationDescriptor (page 1348)
Declared in
USB.h
IOUSBInterfaceDescriptor
Discussion Descriptor for a USB Interface. See the USB Specification at http://www.usb.org. Availability Available in OS X v10.0 and later. See Also
IOUSBInterfaceDescriptor (page 1348)
1333
Declared in
USB.h
IOUSBIsocCompletion
typedef struct IOUSBIsocCompletion { void *target; IOUSBIsocCompletionAction action; void *parameter; } IOUSBIsocCompletion;
Discussion Struct specifying action to perform when an Isochronous USB I/O completes. Availability Available in OS X v10.0 and later. Declared in
USB.h
IOUSBIsocFrame
typedef struct IOUSBIsocFrame { IOReturn frStatus; UInt16 frReqCount; UInt16 frActCount; } IOUSBIsocFrame;
Discussion Structure used to encode information about each isoc frame. Availability Available in OS X v10.0 and later. Declared in
USB.h
1334
IOUSBLowLatencyIsocCompletion
typedef struct IOUSBLowLatencyIsocCompletion { void *target; IOUSBLowLatencyIsocCompletionAction action; void *parameter; } IOUSBLowLatencyIsocCompletion;
Discussion Struct specifying action to perform when an Low Latency Isochronous USB I/O completes. Availability Available in OS X v10.2 and later. Declared in
USB.h
IOUSBLowLatencyIsocFrame
Discussion Structure used to encode information about each isoc frame that is processed at hardware interrupt time (low latency). Availability Available in OS X v10.2 and later. See Also
IOUSBLowLatencyIsocFrame (page 1349)
Declared in
USB.h
IOUSBSuperSpeedEndpointCompanionDescriptor
Discussion Descriptor for a SuperSpeed USB Endpoint Cpmpanion. See the USB Specification at http://www.usb.org.
1335
Declared in
USB.h
USBDeviceInformationBits
typedef enum { kUSBInformationDeviceIsCaptiveBit = 0, kUSBInformationDeviceIsAttachedToRootHubBit = 1, kUSBInformationDeviceIsInternalBit = 2, kUSBInformationDeviceIsConnectedBit = 3, kUSBInformationDeviceIsEnabledBit = 4, kUSBInformationDeviceIsSuspendedBit = 5, kUSBInformationDeviceIsInResetBit = 6, kUSBInformationDeviceOvercurrentBit = 7, kUSBInformationDevicePortIsInTestModeBit = 8, kUSBInformationDeviceIsRootHub = 9, kUSBInformationRootHubisBuiltIn = 10, kUSBInformationDeviceIsRemote = 11, kUSBInformationDeviceIsAttachedToEnclosure = 12, kUSBInformationDeviceIsCaptiveMask = ( 1 << kUSBInformationDeviceIsCaptiveBit), kUSBInformationDeviceIsAttachedToRootHubMask = ( 1 << kUSBInformationDeviceIsAttachedToRootHubBit), kUSBInformationDeviceIsInternalMask = ( 1 << kUSBInformationDeviceIsInternalBit), kUSBInformationDeviceIsConnectedMask = ( 1 << kUSBInformationDeviceIsConnectedBit), kUSBInformationDeviceIsEnabledMask = ( 1 << kUSBInformationDeviceIsEnabledBit), kUSBInformationDeviceIsSuspendedMask = ( 1 << kUSBInformationDeviceIsSuspendedBit), kUSBInformationDeviceIsInResetMask = ( 1 << kUSBInformationDeviceIsInResetBit), kUSBInformationDeviceOvercurrentMask = ( 1 << kUSBInformationDeviceOvercurrentBit), kUSBInformationDevicePortIsInTestModeMask = ( 1 << kUSBInformationDevicePortIsInTestModeBit), kUSBInformationDeviceIsRootHubMask = ( 1 << kUSBInformationDeviceIsRootHub),
1336
kUSBInformationRootHubisBuiltInMask = ( 1 << kUSBInformationRootHubisBuiltIn), kUSBInformationDeviceIsRemoteMask = ( 1 << kUSBInformationDeviceIsRemote), kUSBInformationDeviceIsAttachedToEnclosureMask = ( 1 << kUSBInformationDeviceIsAttachedToEnclosure) } USBDeviceInformationBits;
Constants
kUSBInformationDeviceIsCaptiveBit
The USB device is directly attached to its hub and cannot be removed. Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsAttachedToRootHubBit
The USB device is directly attached to the root hub Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsInternalBit
The USB device is internal to the computer (all the hubs it attaches to are captive) Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsConnectedBit
The USB device is connected to its hub Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsEnabledBit
The hub port to which the USB device is attached is enabled Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsSuspendedBit
The hub port to which the USB device is attached is suspended Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsInResetBit
The hub port to which the USB device is attached is being reset Available in OS X v10.6 and later. Declared in USB.h.
1337
kUSBInformationDeviceOvercurrentBit
The USB device generated an overcurrent Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDevicePortIsInTestModeBit
The hub port to which the USB device is attached is in test mode Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsRootHub
The device is actually the root hub simulation Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationRootHubisBuiltIn
If this is a root hub simulation and it's built into the machine, this bit is set. If it's on an expansion card, it will be cleared Available in OS X v10.6 and later. Declared in USB.h.
kUSBInformationDeviceIsRemote
This device is "attached" to the controller through a remote connection Available in OS X v10.7 and later. Declared in USB.h.
kUSBInformationDeviceIsAttachedToEnclosure
The hub port to which the USB device is connected has a USB connector on the CPU enclosure Available in OS X v10.8 and later. Declared in USB.h. 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 Availability Available in OS X v10.6 and later. Declared in
USB.h
1338
USBLowLatencyBufferType
Constants
kUSBLowLatencyWriteBuffer
The buffer will be used to write data out to a device. Available in OS X v10.2 and later. Declared in USB.h.
kUSBLowLatencyReadBuffer
The buffer will be used to read data from a device. Available in OS X v10.2 and later. Declared in USB.h.
kUSBLowLatencyFrameListBuffer
The buffer will be used for a low latency isoch frame list. Available in OS X v10.2 and later. Declared in USB.h. Discussion Used to specify what kind of buffer to create when calling LowLatencyCreateBuffer(). Availability Available in OS X v10.2 and later. Declared in
USB.h
USBPowerRequestTypes
1339
kUSBPowerDuringWakeRevokable = 6 } USBPowerRequestTypes;
Constants
kUSBPowerDuringSleep
The power is to be used during sleep. Available in OS X v10.6 and later. Declared in USB.h.
kUSBPowerDuringWake
The power is to be used while the system is awake (i.e not sleeping) Available in OS X v10.6 and later. Declared in USB.h.
kUSBPowerRequestWakeRelease
When used with ReturnExtraPower(), it will send a message to all devices to return any extra wake power if possible. Available in OS X v10.7 and later. Declared in USB.h.
kUSBPowerRequestSleepRelease
When used with ReturnExtraPower(), it will send a message to all devices to return any sleep power if possible. Available in OS X v10.7 and later. Declared in USB.h.
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. Available in OS X v10.7 and later. Declared in USB.h.
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. Available in OS X v10.7 and later. Declared in USB.h.
1340
kUSBPowerDuringWakeRevokable
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. Available in OS X v10.8 and later. Declared in USB.h. Discussion Used to specify what kind of power will be reserved using the IOUSBDevice RequestExtraPower and ReturnExtraPower APIs. Availability Available in OS X v10.6 and later. Declared in
USB.h
USBReEnumerateOptions
Constants
kUSBAddExtraResetTimeBit
Setting this bit will cause the Hub driver to wait 100ms before addressing the device after the reset following the re-enumeration. Available in OS X v10.3 and later. Declared in USB.h. Discussion Options used when calling ReEnumerateDevice. Availability Available in OS X v10.3 and later. Declared in
USB.h
1341
USBStatus
Discussion Type used to get a DeviceStatus as a single quantity. Availability Available in OS X v10.0 and later. Declared in
USB.h
IOUSBBOSDescriptor
struct IOUSBBOSDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 wTotalLength; UInt8 bNumDeviceCaps; };
IOUSBConfigurationDescHeader
Discussion Header of a IOUSBConfigurationDescriptor. Used to get the total length of the descriptor. See Also
IOUSBConfigurationDescHeader (page 1325)
1342
IOUSBConfigurationDescriptor
struct IOUSBConfigurationDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 wTotalLength; UInt8 bNumInterfaces; UInt8 bConfigurationValue; UInt8 iConfiguration; UInt8 bmAttributes; UInt8 MaxPower; };
Discussion Standard USB Configuration Descriptor. It is variable length, so this only specifies the known fields. We use the wTotalLength field to read the whole descriptor. See the USB Specification at http://www.usb.org. See Also
IOUSBConfigurationDescriptor (page 1325)
IOUSBDescriptorHeader
Discussion Standard header used for all USB descriptors. Used to read the length of a descriptor so that we can allocate storage for the whole descriptor later on. See Also
IOUSBDescriptorHeader (page 1325)
IOUSBDeviceCapabilityContainerID
struct IOUSBDeviceCapabilityContainerID { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt8 bReservedID;
1343
UInt8 containerID[16]; };
IOUSBDeviceCapabilityDescriptorHeader
struct IOUSBDeviceCapabilityDescriptorHeader { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt8 bNumDeviceCaps; };
Discussion Header for a Device Capability Descriptor for a USB Device. . See Also
IOUSBDeviceCapabilityDescriptorHeader (page 1326)
IOUSBDeviceCapabilitySuperSpeedUSB
struct IOUSBDeviceCapabilitySuperSpeedUSB { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt8 bmAttributes; UInt16 wSpeedsSupported; UInt8 bFunctionalitySupport; UInt8 bU1DevExitLat; UInt16 wU2DevExitLat; };
1344
IOUSBDeviceCapabilityUSB2Extension
struct IOUSBDeviceCapabilityUSB2Extension { UInt8 bLength; UInt8 bDescriptorType; UInt8 bDevCapabilityType; UInt32 bmAttributes; };
IOUSBDeviceDescriptor
struct IOUSBDeviceDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 bcdUSB; UInt8 bDeviceClass; UInt8 bDeviceSubClass; UInt8 bDeviceProtocol; UInt8 bMaxPacketSize0; UInt16 idVendor; UInt16 idProduct; UInt16 bcdDevice; UInt8 iManufacturer; UInt8 iProduct; UInt8 iSerialNumber; UInt8 bNumConfigurations; };
Discussion Descriptor for a USB Device. See the USB Specification at http://www.usb.org. See Also
IOUSBDeviceDescriptor (page 1327)
1345
IOUSBDeviceQualifierDescriptor
struct IOUSBDeviceQualifierDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt16 bcdUSB; UInt8 bDeviceClass; UInt8 bDeviceSubClass; UInt8 bDeviceProtocol; UInt8 bMaxPacketSize0; UInt8 bNumConfigurations; UInt8 bReserved; };
Discussion USB Device Qualifier Descriptor. See the USB Specification at http://www.usb.org. See Also
IOUSBDeviceQualifierDescriptor (page 1328)
IOUSBDFUDescriptor
struct IOUSBDFUDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bmAttributes; UInt16 wDetachTimeout; UInt16 wTransferSize; };
Discussion USB Device Firmware Update Descriptor. See the USB Device Firmware Update Specification at http://www.usb.org. See Also
IOUSBDFUDescriptor (page 1330)
IOUSBEndpointDescriptor
1346
UInt8 bDescriptorType; UInt8 bEndpointAddress; UInt8 bmAttributes; UInt16 wMaxPacketSize; UInt8 bInterval; };
Discussion Descriptor for a USB Endpoint. See the USB Specification at http://www.usb.org. See Also
IOUSBEndpointDescriptor (page 1330)
IOUSBHIDDescriptor
struct IOUSBHIDDescriptor { UInt8 descLen; UInt8 descType; UInt16 descVersNum; UInt8 hidCountryCode; UInt8 hidNumDescriptors; UInt8 hidDescriptorType; UInt8 hidDescriptorLengthLo; UInt8 hidDescriptorLengthHi; };
Discussion USB HID Descriptor. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment. See Also
IOUSBHIDDescriptor (page 1332)
IOUSBHIDReportDesc
1347
Discussion USB HID Report Descriptor header. See the USB HID Specification at http://www.usb.org. (This structure should have used the #pragma pack(1) compiler directive to get byte alignment. See Also
IOUSBHIDReportDesc (page 1332)
IOUSBInterfaceAssociationDescriptor
struct IOUSBInterfaceAssociationDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bFirstInterface; UInt8 bInterfaceCount; UInt8 bFunctionClass; UInt8 bFunctionSubClass; UInt8 bFunctionProtocol; UInt8 iFunction; };
Discussion USB Inerface Association Descriptor. ECN to the USB 2.0 Spec. See the USB Specification at http://www.usb.org. See Also
IOUSBInterfaceAssociationDescriptor (page 1333)
IOUSBInterfaceDescriptor
struct IOUSBInterfaceDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bInterfaceNumber; UInt8 bAlternateSetting; UInt8 bNumEndpoints; UInt8 bInterfaceClass; UInt8 bInterfaceSubClass; UInt8 bInterfaceProtocol; UInt8 iInterface; };
Discussion Descriptor for a USB Interface. See the USB Specification at http://www.usb.org.
1348
See Also
IOUSBInterfaceDescriptor (page 1333)
IOUSBLowLatencyIsocFrame
struct IOUSBLowLatencyIsocFrame { IOReturn frStatus; UInt16 frReqCount; UInt16 frActCount; AbsoluteTime frTimeStamp; };
Fields
frStatus
Time stamp that indicates time when frame was procesed. Discussion Structure used to encode information about each isoc frame that is processed at hardware interrupt time (low latency). See Also
IOUSBLowLatencyIsocFrame (page 1335)
IOUSBSuperSpeedEndpointCompanionDescriptor
struct IOUSBSuperSpeedEndpointCompanionDescriptor { UInt8 bLength; UInt8 bDescriptorType; UInt8 bMaxBurst; UInt8 bmAttributes; UInt16 wBytesPerInterval; };
1349
Discussion Descriptor for a SuperSpeed USB Endpoint Cpmpanion. See the USB Specification at http://www.usb.org. See Also
IOUSBSuperSpeedEndpointCompanionDescriptor (page 1335)
Constants
See the Overview for header-level documentation.
Constants
HostToUSBLong
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. Available in OS X v10.0 and later. Declared in USB.h.
HostToUSBWord
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. Available in OS X v10.0 and later. Declared in USB.h.
1350
USBToHostLong
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. Available in OS X v10.0 and later. Declared in USB.h.
USBToHostWord
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. Available in OS X v10.0 and later. Declared in USB.h. Discussion This header file contains definitions and structures that are used in the different USB API's in OS X, both in the kernel and in the user space.
#define kIOUSBClearPipeStallNotRecursive // 0xe0004048 IOUSBPipe::ClearPipeStall should not be called recursively #define kIOUSBConfigNotFound // 0xe0004056 Configuration Not found #define kIOUSBDeviceCountExceeded // 0xe0004045 The device cannot be enumerated because the controller cannot support more devices #define kIOUSBDeviceNotHighSpeed // 0xe0004049 Name is deprecated, see below #define kIOUSBDevicePortWasNotSuspended // 0xe0004047 Port was not suspended #define kIOUSBDeviceTransferredToCompanion // 0xe0004049 The device has been tranferred to another controller for enumeration #define kIOUSBEndpointCountExceeded // 0xe0004046 The endpoint was not created because the controller cannot support more endpoints #define kIOUSBEndpointNotFound // 0xe0004057 Endpoint Not found #define kIOUSBHighSpeedSplitError // 0xe000404b Error to hub on high speed bus trying to do split transaction #define kIOUSBInterfaceNotFound // 0xe000404e Interface ref not recognized #define kIOUSBLowLatencyBufferNotPreviouslyAllocated // 0xe000404d Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the data buffer) first #define kIOUSBLowLatencyFrameListNotPreviouslyAllocated // 0xe000404c Attempted to use user land low latency isoc calls w/out calling PrepareBuffer (on the frame list) first
1351
#define kIOUSBNoAsyncPortErr // 0xe000405f no async port #define kIOUSBNotEnoughPipesErr // 0xe000405e not enough pipes in interface #define kIOUSBNotEnoughPowerErr // 0xe000405d not enough power for selected configuration #define kIOUSBPipeStalled // 0xe000404f Pipe has stalled, error needs to be cleared #define kIOUSBStreamsNotSupported // 0xe0004044 The request cannot be completed because the XHCI controller does not support streams #define kIOUSBSyncRequestOnWLThread // 0xe000404a A synchronous USB request was made on the workloop thread (from a callback?). Only async requests are permitted in that case #define kIOUSBTooManyPipesErr // 0xe0004060 Too many pipes #define kIOUSBTransactionReturned // 0xe0004050 The transaction has been returned to the caller #define kIOUSBTransactionTimeout // 0xe0004051 Transaction timed out #define kIOUSBUnknownPipeErr // 0xe0004061 Pipe ref not recognized
Constants
kIOUSBClearPipeStallNotRecursive
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.7 and later. Declared in USB.h.
kIOUSBConfigNotFound
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBDeviceCountExceeded
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.8 and later. Declared in USB.h.
kIOUSBDeviceNotHighSpeed
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.4 and later. Declared in USB.h.
1352
kIOUSBDevicePortWasNotSuspended
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.6 and later. Declared in USB.h.
kIOUSBDeviceTransferredToCompanion
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.8 and later. Declared in USB.h.
kIOUSBEndpointCountExceeded
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.8 and later. Declared in USB.h.
kIOUSBEndpointNotFound
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBHighSpeedSplitError
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.3 and later. Declared in USB.h.
kIOUSBInterfaceNotFound
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBLowLatencyBufferNotPreviouslyAllocated
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.2 and later. Declared in USB.h.
1353
kIOUSBLowLatencyFrameListNotPreviouslyAllocated
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.2 and later. Declared in USB.h.
kIOUSBNoAsyncPortErr
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBNotEnoughPipesErr
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBNotEnoughPowerErr
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBPipeStalled
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBStreamsNotSupported
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.8 and later. Declared in USB.h.
kIOUSBSyncRequestOnWLThread
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.3 and later. Declared in USB.h.
1354
kIOUSBTooManyPipesErr
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
kIOUSBTransactionReturned
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBTransactionTimeout
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBUnknownPipeErr
Errors specific to the IOUSBFamily. Note that the iokit_usb_err(x) translates to 0xe0004xxx, where xxx is the value in parenthesis as a hex number. Available in OS X v10.0 and later. Declared in USB.h.
#define kIOUSBBitstufErr // 0xe0004002 Pipe stall, bitstuffing #define kIOUSBBufferOverrunErr // 0xe000400c Buffer Overrun (Host hardware failure on data out, PCI busy?) #define kIOUSBBufferUnderrunErr // 0xe000400d Buffer Underrun (Host hardware failure on data out, PCI busy?) #define kIOUSBCRCErr // 0xe0004001 Pipe stall, bad CRC #define kIOUSBDataToggleErr // 0xe0004003 Pipe stall, Bad data toggle #define kIOUSBLinkErr // 0xe0004010 #define kIOUSBNotSent1Err // 0xe000400e Transaction not sent #define kIOUSBNotSent2Err // 0xe000400f Transaction not sent #define kIOUSBPIDCheckErr // 0xe0004006 Pipe stall, PID CRC error
1355
#define kIOUSBReserved1Err // 0xe000400a Reserved #define kIOUSBReserved2Err // 0xe000400b Reserved #define kIOUSBWrongPIDErr // 0xe0004007 Pipe stall, Bad or wrong PID
Constants
kIOUSBBitstufErr
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
1356
kIOUSBBufferUnderrunErr
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
1357
kIOUSBDataToggleErr
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
1358
kIOUSBNotSent1Err
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
1359
kIOUSBPIDCheckErr
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
1360
kIOUSBReserved2Err
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
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.
Completion Code Error Returned 9 kIOReturnUnderrun data than max packet size 8 kIOReturnOverrun more data than buffer 5 kIOReturnNotResponding 4 kIOUSBPipeStalled Description (Data Underrun) EP returned less (Data Overrun) Packet too large or Device Not responding Endpoint returned a STALL PID
#define kIOUSBMessageCompositeDriverReconfigured // 0xe0004011 Message from the composite driver indicating that it has finished re-configuring the device after a reset #define kIOUSBMessageController // 0xe0004015 Generic message sent from controller user client to controllers #define kIOUSBMessageDeviceCountExceeded // 0xe000401a Message sent by a hub when a device cannot be enumerated because the USB controller ran out of resources #define kIOUSBMessageEndpointCountExceeded // 0xe0004019 Message sent to a device when endpoints cannot be created because the USB controller ran out of resources #define kIOUSBMessageExpressCardCantWake // 0xe0004010 Message from a driver to a bus that
1361
an express card will disconnect on sleep and thus shouldn't wake #define kIOUSBMessageFromThirdParty // 0xe000400e Message sent from a third party. Uses IOUSBThirdPartyParam to encode the sender's ID #define kIOUSBMessageHubIsDeviceConnected // 0xe0004004 Message sent to a hub to inquire whether a particular port has a device connected or not #define kIOUSBMessageHubIsPortEnabled // 0xe0004005 Message sent to a hub to inquire whether a particular port is enabled or not #define kIOUSBMessageHubPortClearTT // 0xe000400c Message sent to a hub to clear the transaction translator #define kIOUSBMessageHubPortDeviceDisconnected // 0xe000401b Message sent by a built-in hub when a device was disconnected #define kIOUSBMessageHubReEnumeratePort // 0xe0004006 Message sent to a hub to reenumerate the device attached to a particular port #define kIOUSBMessageHubResetPort // 0xe0004001 Message sent to a hub to reset a particular port #define kIOUSBMessageHubResumePort // 0xe0004003 Message sent to a hub to resume a particular port #define kIOUSBMessageHubSetPortRecoveryTime // 0xe0004012 Message sent to a hub to set the # of ms required when resuming a particular port #define kIOUSBMessageHubSuspendPort // 0xe0004002 Message sent to a hub to suspend a particular port #define kIOUSBMessageNotEnoughPower // 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 #define kIOUSBMessageOvercurrentCondition // 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 #define kIOUSBMessagePortHasBeenReset // 0xe000400a Message sent to a device indicating that the port it is attached to has been reset #define kIOUSBMessagePortHasBeenResumed // 0xe000400b Message sent to a device indicating that the port it is attached to has been resumed #define kIOUSBMessagePortHasBeenSuspended // 0xe000400d Message sent to a device indicating that the port it is attached to has been suspended #define kIOUSBMessagePortWasNotSuspended // 0xe000400f Message indicating that the hub driver received a resume request for a port that was not suspended #define kIOUSBMessageReallocateExtraCurrent // 0xe0004018 Message to ask any clients using extra current to attempt to allocate it some more #define kIOUSBMessageReleaseExtraCurrent // 0xe0004017 Message to ask any clients using extra current to release it if possible #define kIOUSBMessageRootHubWakeEvent // 0xe0004016 Message from the HC Wakeup code indicating that a Root Hub port has a wake event
1362
Constants
kIOUSBMessageCompositeDriverReconfigured
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. Available in OS X v10.4 and later. Declared in USB.h.
kIOUSBMessageController
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. Available in OS X v10.7 and later. Declared in USB.h.
kIOUSBMessageDeviceCountExceeded
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. Available in OS X v10.8 and later. Declared in USB.h.
kIOUSBMessageEndpointCountExceeded
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. Available in OS X v10.8 and later. Declared in USB.h.
kIOUSBMessageExpressCardCantWake
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. Available in OS X v10.4 and later. Declared in USB.h.
kIOUSBMessageFromThirdParty
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. Available in OS X v10.3 and later. Declared in USB.h.
kIOUSBMessageHubIsDeviceConnected
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. Available in OS X v10.1 and later. Declared in USB.h.
1363
kIOUSBMessageHubIsPortEnabled
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. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBMessageHubPortClearTT
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. Available in OS X v10.3 and later. Declared in USB.h.
kIOUSBMessageHubPortDeviceDisconnected
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. Available in OS X v10.8 and later. Declared in USB.h.
kIOUSBMessageHubReEnumeratePort
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. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBMessageHubResetPort
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. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBMessageHubResumePort
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. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBMessageHubSetPortRecoveryTime
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. Available in OS X v10.5 and later. Declared in USB.h.
1364
kIOUSBMessageHubSuspendPort
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. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBMessageNotEnoughPower
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. Available in OS X v10.6 and later. Declared in USB.h.
kIOUSBMessageOvercurrentCondition
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. Available in OS X v10.6 and later. Declared in USB.h.
kIOUSBMessagePortHasBeenReset
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. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBMessagePortHasBeenResumed
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. Available in OS X v10.1 and later. Declared in USB.h.
kIOUSBMessagePortHasBeenSuspended
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. Available in OS X v10.3 and later. Declared in USB.h.
kIOUSBMessagePortWasNotSuspended
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. Available in OS X v10.4 and later. Declared in USB.h.
1365
kIOUSBMessageReallocateExtraCurrent
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. Available in OS X v10.7 and later. Declared in USB.h.
kIOUSBMessageReleaseExtraCurrent
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. Available in OS X v10.7 and later. Declared in USB.h.
kIOUSBMessageRootHubWakeEvent
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. Available in OS X v10.7 and later. Declared in USB.h.
Property Definitions
#define #define #define #define #define #define #define #define #define #define #define #define #define #define #define
kConfigurationDescriptorOverride "ConfigurationDescriptorOverride" kOverrideIfAtLocationID "OverrideIfAtLocationID" kUSBControllerNeedsContiguousMemoryForIsoch "Need contiguous memory for isoch" kUSBDevicePropertyAddress "USB Address" kUSBDevicePropertyBusPowerAvailable "Bus Power Available" kUSBDevicePropertyLocationID "locationID" kUSBDevicePropertySpeed "Device Speed" kUSBDeviceResumeRecoveryTime "kUSBDeviceResumeRecoveryTime" kUSBExpressCardCantWake "ExpressCardCantWake" kUSBHubDontAllowLowPower "kUSBHubDontAllowLowPower" kUSBOutOfSpecMPSOK "Out of spec MPS OK" kUSBPreferredConfiguration "Preferred Configuration" kUSBProductIDMask "idProductMask" kUSBProductIdsArrayName "idProductArray" kUSBSuspendPort "kSuspendPort"
Constants
kConfigurationDescriptorOverride
Useful property names in USB land. Available in OS X v10.7 and later. Declared in USB.h.
1366
kOverrideIfAtLocationID
Useful property names in USB land. Available in OS X v10.7 and later. Declared in USB.h.
kUSBControllerNeedsContiguousMemoryForIsoch
Useful property names in USB land. Available in OS X v10.4 and later. Declared in USB.h.
kUSBDevicePropertyAddress
Useful property names in USB land. Available in OS X v10.0 and later. Declared in USB.h.
kUSBDevicePropertyBusPowerAvailable
Useful property names in USB land. Available in OS X v10.0 and later. Declared in USB.h.
kUSBDevicePropertyLocationID
Useful property names in USB land. Available in OS X v10.0 and later. Declared in USB.h.
kUSBDevicePropertySpeed
Useful property names in USB land. Available in OS X v10.0 and later. Declared in USB.h.
kUSBDeviceResumeRecoveryTime
Useful property names in USB land. Available in OS X v10.5 and later. Declared in USB.h.
kUSBExpressCardCantWake
Useful property names in USB land. Available in OS X v10.4 and later. Declared in USB.h.
kUSBHubDontAllowLowPower
Useful property names in USB land. Available in OS X v10.5 and later. Declared in USB.h.
1367
kUSBOutOfSpecMPSOK
Useful property names in USB land. Available in OS X v10.6 and later. Declared in USB.h.
kUSBPreferredConfiguration
Useful property names in USB land. Available in OS X v10.4 and later. Declared in USB.h.
kUSBProductIDMask
Useful property names in USB land. Available in OS X v10.4 and later. Declared in USB.h.
kUSBProductIdsArrayName
Useful property names in USB land. Available in OS X v10.7 and later. Declared in USB.h.
kUSBSuspendPort
Useful property names in USB land. Available in OS X v10.4 and later. Declared in USB.h.
Miscellaneous Defines
Constants
kCallInterfaceOpenWithGate
If the USB Device has this property, drivers for any of its interfaces will have their handleOpen method called while holding the workloop gate. Available in OS X v10.3 and later. Declared in USB.h.
1368
Discussion These are used to create the macro to encode the bRequest filed of a Device Request
IOUSBFamilyIOOptionBit
enum { kIOUSBInterfaceOpenAlt = 0x00010000, kIOUSBInterfaceOpenAlternateInterfaceBit = 16, kUSBOptionBitOpenExclusivelyBit = 17, kIOUSBInterfaceOpenAlternateInterfaceMask = ( 1 << kIOUSBInterfaceOpenAlternateInterfaceBit), kUSBOptionBitOpenExclusivelyMask = ( 1 << kUSBOptionBitOpenExclusivelyBit) };
Constants
kIOUSBInterfaceOpenAlt
Open the alternate interface specified when creating the interface. Available in OS X v10.7 through OS X v10.7. Declared in USB.h.
1369
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 Available in OS X v10.7 through OS X v10.7. Declared in USB.h. Discussion Options used exclusively by the USB Family when calling calling IOService APIs, such as open() and close().
kIOUSBFindInterfaceDontCare
Discussion Constant that can be used for the fields of IOUSBFindInterfaceRequest to specify that they should not be matched.
kIOUSBVendorIDAppleComputer
kUSBMaxIsocFrameReqCount
enum { 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 };
1370
MicrosecondsInFrame
Constants
kUSBFullSpeedMicrosecondsInFrame
The device is attached to a bus running at full speed (1 ms / frame). Available in OS X v10.2 and later. Declared in USB.h.
kUSBHighSpeedMicrosecondsInFrame
The device is attached to a bus running at high speed (125 microseconds / frame). Available in OS X v10.2 and later. Declared in USB.h. Discussion Returns the number of microseconds in a USB frame.
Miscellaneous Constants
enum { kUSBDeviceIDShift = 7, kUSBMaxDevices = 128, kUSBMaxDevice = kUSBMaxDevices-1, kUSBDeviceIDMask = 0x7f, kUSBPipeIDMask = 0xf, kUSBMaxPipes = 32, // In and Out pipes can have same pipe number. kUSBInterfaceIDShift = 8, kUSBMaxInterfaces = 1 << kUSBInterfaceIDShift, kUSBInterfaceIDMask = kUSBMaxInterfaces-1, kUSBEndPtShift = 7, kUSBDeviceMask = ( ( 1 << kUSBEndPtShift) -1), kUSBNoPipeIdx = -1, // Constants for streams
1371
enum { kClearDeviceFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) + ( UInt16) kUSBOut << kUSBRqDirnShift))), kClearInterfaceFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) + ( UInt16) kUSBOut << kUSBRqDirnShift))), kClearEndpointFeature = ( ( ( UInt16)kUSBRqClearFeature << 8) + ( ( UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) + ( UInt16) kUSBOut << kUSBRqDirnShift))), kGetConfiguration = ( ( ( UInt16)kUSBRqGetConfig << 8) + ( ( UInt16) kUSBDevice + (
1372
( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBIn << kUSBRqDirnShift))), kGetDescriptor = ( ( ( UInt16)kUSBRqGetDescriptor << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBIn << kUSBRqDirnShift))), kGetInterface = ( ( ( UInt16)kUSBRqGetInterface << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBIn << kUSBRqDirnShift))), kGetDeviceStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBIn << kUSBRqDirnShift))), kGetInterfaceStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBIn << kUSBRqDirnShift))), kGetEndpointStatus = ( ( ( UInt16)kUSBRqGetStatus << 8) + ( (
1373
UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBIn << kUSBRqDirnShift))), kSetAddress = ( ( ( UInt16)kUSBRqSetAddress << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBOut << kUSBRqDirnShift))), kSetConfiguration = ( ( ( UInt16)kUSBRqSetConfig << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBOut << kUSBRqDirnShift))), kSetDescriptor = ( ( ( UInt16)kUSBRqSetDescriptor << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBOut << kUSBRqDirnShift))), kSetDeviceFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + ( ( UInt16) kUSBDevice + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBOut << kUSBRqDirnShift))), kSetInterfaceFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + (
1374
( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBOut << kUSBRqDirnShift))), kSetEndpointFeature = ( ( ( UInt16)kUSBRqSetFeature << 8) + ( ( UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBOut << kUSBRqDirnShift))), kSetInterface = ( ( ( UInt16)kUSBRqSetInterface << 8) + ( ( UInt16) kUSBInterface + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBOut << kUSBRqDirnShift))), kSyncFrame = ( ( ( UInt16)kUSBRqSyncFrame << 8) + ( ( UInt16) kUSBEndpoint + ( ( UInt16) kUSBStandard << kUSBRqTypeShift) ( UInt16) kUSBIn << kUSBRqDirnShift))), };
wLength Data Zero Zero Zero None (device) None (Interface) None (Endpoint)
1375
GET_STATUS
SET_ADDRESS
Address
Zero
SET_FEATURE
00000001B 10000010B
SET_INTERFACE SYNCH_FRAME
Alternate Zero
Interface Endpoint
Zero Two
USBDeviceSpeed
Constants
kUSBDeviceSpeedLow
The device is a low speed device. Available in OS X v10.0 and later. Declared in USB.h.
1376
kUSBDeviceSpeedFull
The device is a full speed device. Available in OS X v10.0 and later. Declared in USB.h.
kUSBDeviceSpeedHigh
The device is a high speed device. Available in OS X v10.2 and later. Declared in USB.h.
kUSBDeviceSpeedSuper
The device is a SuperSpeed device Available in OS X v10.8 and later. Declared in USB.h. Discussion Returns the speed of a particular USB device.
1377
Declared in
USBSpec.h
Overview Constants
See the Overview for header-level documentation.
#define kUSB1284DeviceID "1284 Device ID" #define kUSBAlternateSetting "bAlternateSetting" #define kUSBConfigurationValue "bConfigurationValue" #define kUSBDeviceClass "bDeviceClass" #define kUSBDeviceMaxPacketSize "bMaxPacketSize0" #define kUSBDeviceNumConfigs "bNumConfigurations" #define kUSBDeviceProtocol "bDeviceProtocol" #define kUSBDeviceReleaseNumber "bcdDevice" #define kUSBDeviceSubClass "bDeviceSubClass" #define kUSBInterfaceClass "bInterfaceClass" #define kUSBInterfaceNumber "bInterfaceNumber" #define kUSBInterfaceProtocol "bInterfaceProtocol" #define kUSBInterfaceStringIndex "iInterface" #define kUSBInterfaceSubClass "bInterfaceSubClass" #define kUSBManufacturerStringIndex "iManufacturer" #define kUSBNumEndpoints "bNumEndpoints" #define kUSBProductID "idProduct" // good name #define kUSBProductName "idProduct" /* good name \ */ // bad name - keep for backward compatibility #define kUSBProductString "USB Product Name" #define kUSBProductStringIndex "iProduct"
1378
#define kUSBSerialNumberString "USB Serial Number" #define kUSBSerialNumberStringIndex "iSerialNumber" #define kUSBVendorID "idVendor" // good name #define kUSBVendorName "idVendor" /* good name \ */ // bad name - keep for backward compatibility #define kUSBVendorString "USB Vendor Name"
Constants
kUSB1284DeviceID
IORegistry key for the 1284 Device ID of a printer Available in OS X v10.6 and later. Declared in USBSpec.h.
kUSBAlternateSetting
The field in the USB Configuration Descriptor corresponding to the number of configurations Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBConfigurationValue
The field in the USB Interface Descriptor corresponding to the configuration Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBDeviceClass
The field in the USB Device Descriptor corresponding to the device class Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBDeviceMaxPacketSize
The field in the USB Device Descriptor corresponding to the maximum packet size for endpoint 0 Available in OS X v10.1 and later. Declared in USBSpec.h.
kUSBDeviceNumConfigs
The field in the USB Configuration Descriptor corresponding to the number of configurations Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBDeviceProtocol
The field in the USB Device Descriptor corresponding to the device protocol Available in OS X v10.0 and later. Declared in USBSpec.h.
1379
kUSBDeviceReleaseNumber
The field in the USB Device Descriptor corresponding to the device release version Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBDeviceSubClass
The field in the USB Device Descriptor corresponding to the device sub class Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBInterfaceClass
The field in the USB Interface Descriptor corresponding to the interface class Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBInterfaceNumber
The field in the USB Configuration Descriptor corresponding to the number of configurations Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBInterfaceProtocol
The field in the USB Interface Descriptor corresponding to the interface protocol Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBInterfaceStringIndex
The field in the USB Interface Descriptor corresponding to the index for the interface name's string Available in OS X v10.1 and later. Declared in USBSpec.h.
kUSBInterfaceSubClass
The field in the USB Interface Descriptor corresponding to the interface sub class Available in OS X v10.0 and later. Declared in USBSpec.h.
kUSBManufacturerStringIndex
The field in the USB Device Descriptor corresponding to the index for the manufacturer's string Available in OS X v10.1 and later. Declared in USBSpec.h.
kUSBNumEndpoints
The field in the USB Configuration Descriptor corresponding to the number of configurations Available in OS X v10.0 and later. Declared in USBSpec.h.
1380
kUSBProductID
The field in the USB Device Descriptor corresponding to the device USB Product ID Available in OS X v10.1 and later. Declared in USBSpec.h.
kUSBProductName
IORegistry key for the device's USB Product string Available in OS X v10.6 and later. Declared in USBSpec.h.
kUSBProductStringIndex
The field in the USB Device Descriptor corresponding to the index for the product name's string Available in OS X v10.1 and later. Declared in USBSpec.h.
kUSBSerialNumberString
IORegistry key for the device's USB serial number string Available in OS X v10.6 and later. Declared in USBSpec.h.
kUSBSerialNumberStringIndex
The field in the USB Device Descriptor corresponding to the index for the serial number's string Available in OS X v10.1 and later. Declared in USBSpec.h.
kUSBVendorID
The field in the USB Device Descriptor corresponding to the device USB Vendor ID Available in OS X v10.1 and later. Declared in USBSpec.h.
kUSBVendorName
IORegistry key for the device's USB manufacturer string Available in OS X v10.6 and later. Declared in USBSpec.h.
1381
enum { kUSBCompositeClass = 0, kUSBCommClass = 2, // Deprecated kUSBCommunicationClass = 2, kUSBHubClass = 9, kUSBDataClass = 10, kUSBPersonalHealthcareClass = 15, kUSBDiagnosticClass = 220, kUSBWirelessControllerClass = 224, kUSBMiscellaneousClass = 239, kUSBApplicationSpecificClass = 254, kUSBVendorSpecificClass = 255 };
1382
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, kUSBSetSel = 48, kUSBSetIsochDelay = 49 };
Discussion 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.
1383
kUSBVendor = 2 };
Discussion This type is encoded in the bmRequestType field of a Device Request. It specifies the type of request: standard, class or vendor specific.
enum { kUSBbEndpointAddressMask = 0x0f, kUSBbEndpointDirectionBit = 7, kUSBbEndpointDirectionMask = ( 1 << kUSBbEndpointDirectionBit ), kUSBEndpointDirectionOut = 0x00, kUSBEndpointDirectionIn = 0x80, kUSBEndpointbmAttributesTransferTypeMask = 0x03, kUSBEndpointbmAttributesSynchronizationTypeMask = 0x0c, kUSBEndpointbmAttributesSynchronizationTypeShift = 2, kUSBEndpointbmAttributesUsageTypeMask = 0x30, kUSBEndpointbmAttributesUsageTypeShift = 4 };
Endpoint direction
1384
kUSBNone = 2, kUSBAnyDirn = 3 };
Endpoint type
Feature Selectors
enum { kUSBFeatureEndpointStall = 0, // Endpoint kUSBFeatureDeviceRemoteWakeup = 1, // Device kUSBFeatureTestMode = 2, // Device kUSBFeatureFunctionSuspend = 0, // Interface kUSBFeatureU1Enable = 48, // Device kUSBFeatureU2Enable = 49, // Device kUSBFeatureLTMEnable = 50 // Device };
HID Protocol
1385
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
1386
kUSBPrintingInterfaceClass = 7, kUSBMassStorageClass = 8, // Deprecated kUSBMassStorageInterfaceClass = 8, kUSBChipSmartCardInterfaceClass = 11, kUSBContentSecurityInterfaceClass = 13, kUSBVideoInterfaceClass = 14, kUSBPersonalHealthcareInterfaceClass = 15, kUSBDiagnosticDeviceInterfaceClass = 220, kUSBWirelessControllerInterfaceClass = 224, kUSBApplicationSpecificInterfaceClass = 254, kUSBVendorSpecificInterfaceClass = 255 };
Interface Protocol
enum { // For kUSBHubClass kHubSuperSpeedProtocol = 3, // For kUSBHIDInterfaceClass // kHIDNoInterfaceProtocol = 0, kHIDKeyboardInterfaceProtocol = 1, kHIDMouseInterfaceProtocol = 2, kUSBVendorSpecificProtocol = 0xff, // For kUSBDiagnosticDeviceInterfaceClass // kUSB2ComplianceDeviceProtocol = 0x01, // For kUSBWirelessControllerInterfaceClass // kUSBBluetoothProgrammingInterfaceProtocol = 0x01, // For kUSBMiscellaneousClass // KUSBInterfaceAssociationDescriptorProtocol = 0x01, // For Mass Storage // kMSCProtocolControlBulkInterrupt = 0x00, kMSCProtocolControlBulk = 0x01, kMSCProtocolBulkOnly = 0x50, kMSCProtocolUSBAttachedSCSI = 0x62 };
1387
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,
1388
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, kUSBBOSDescriptor = 15, kUSBDeviceCapability = 16, kUSBSuperSpeedEndpointCompanion = 48, kUSB3HUBDesc = 0x2A, kUSBHIDDesc = 0x21, kUSBReportDesc = 0x22, kUSBPhysicalDesc = 0x23, kUSBHUBDesc = 0x29, };
1389
enum { kUSB20ExtensionLPMSupported = 1, // Bit 1 of bmAttributes of USB 2.0 Extension Device Capability kUSBSuperSpeedLTMCapable = 1, // Bit 1 of bmAttributes of SuperSpeed USB Device Capability kUSBSuperSpeedSupportsLS supports low speed kUSBSuperSpeedSupportsFS supports full speed kUSBSuperSpeedSupportsHS supports high speed kUSBSuperSpeedSupportsSS supports 5 Gbps }; = 0, // Value of wSpeedSupported indicating that the device = 1, // Value of wSpeedSupported indicating that the device = 2, // Value of wSpeedSupported indicating that the device = 3, // Value of wSpeedSupported indicating that the device
Discussion Bit definitions and constants for different values of USB Device Capability types
enum { kUSB100mAAvailable = 50, kUSB500mAAvailable = 250, kUSB100mA = 50, kUSBAtrBusPowered = 0x80, kUSBAtrSelfPowered = 0x40, kUSBAtrRemoteWakeup = 0x20, kUSB2MaxPowerPerPort = kUSB500mAAvailable * 2, kUSB150mAAvailable = 75, kUSB900mAAvailable = 450, kUSB150mA = 75, kUSB3MaxPowerPerPort = kUSB900mAAvailable * 2 };
1390
= = = =
Discussion Constants relating to USB releases as found in the bcdUSB field of the Device Descriptor.
1391
Apple Inc. 2011 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Inc., with the following exceptions: Any person is hereby authorized to store documentation on a single computer for personal use only and to print copies of documentation for personal use provided that the documentation contains Apples copyright notice. No licenses, express or implied, are granted with respect to any of the technology described in this document. Apple retains all intellectual property rights associated with the technology described in this document. This document is intended to assist application developers to develop applications only for Apple-labeled computers. Apple Inc. 1 Infinite Loop Cupertino, CA 95014 408-996-1010 Apple, the Apple logo, Aperture, FireWire, iPod, Logic, Mac, Mac OS, Numbers, OS X, Pages, Quartz, SuperDrive, and Tiger are trademarks of Apple Inc., registered in the U.S. and other countries. .Mac is a service mark of Apple Inc., registered in the U.S. and other countries. CDB is a trademark of Third Eye Software, Inc. Intel and Intel Core are registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. SPEC is a registered trademark of the Standard Performance Evaluation Corporation (SPEC).
Even though Apple has reviewed this document, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS DOCUMENT, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS DOCUMENT IS PROVIDED AS IS, AND YOU, THE READER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS DOCUMENT, even if advised of the possibility of such damages. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty. Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state.