|
ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOFireWireAVCLibUnitInterface |
| Declared In: |
Initial interface discovered for all AV/C unit drivers.
The IOFireWireAVCLibUnitInterface is the initial interface discovered by most drivers. It supplies the methods that control the operation of the AV/C 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.
In Mac OS X v10.4 and later, the IOFireWireAVCLibUnitInterface contains functions to create and send asynchronous AV/C commands and receive responses.
Adds a dispatcher for kernel callbacks to the specified run loop.
Cancels a submitted command.
Reinitializes an existing IOFireWireAVCLibAsynchronousCommand object, preserving the existing command.
Reinitializes an existing IOFireWireAVCLibAsynchronousCommand object, replacing the existing command with a new one.
Releases an IOFireWireAVCLibAsynchronousCommand object.
Issues the asynchronous command on the bus.
Sends an AV/C command to the device and returns the response.
Sends an AV/C command to the device and returns the response.
Decrements the point-to-point connection count of a unit input plug.
Decrements the point-to-point connection count of a unit output plug.
Decrements the point-to-point connection count of a unit input plug.
Decrements the point-to-point connection count of a unit output plug.
Closes an exclusive access to the device.
Creates an IOFireWireAVCLibAsynchronousCommand object to use with the asynchronous AV/C command functions.
Creates a plug-in object for an ancestor (in the I/O Registry) of the AV/C unit and returns an interface to it.
Gets the number of plugs in the producer.
Creates a plug-in object for a protocol driver for the FireWire bus the AV/C unit is connected to and returns an interface to it.
Opens a connection to a device that is not already open.
Increments the point-to-point connection count of a unit output plug.
Increments the point-to-point connection count of a unit input plug.
Increments the point-to-point connection count of a unit output plug.
Exclusively opens a connection to the in-kernel device.
Opens a connection to a device that is not already open.
Removes a dispatcher for kernel callbacks to the specified run loop.
Sets callback for user space message routine.
Updates an AVCCommand's timeout back to 10 seconds.
addCallbackDispatcherToRunLoop |
Adds a dispatcher for kernel callbacks to the specified run loop.
IOReturn ( *addCallbackDispatcherToRunLoop)( void *self, CFRunLoopRef cfRunLoopRef );
selfPointer to IOFireWireAVCLibUnitInterface.
cfRunLoopRefReference to a run loop.
Returns kIOReturnSuccess on success.
The user space portions of the AV/C 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 AV/C response. If you do this the dispatcher will never get to run and you will wait forever.
AVCAsynchronousCommandCancel |
Cancels a submitted command.
IOReturn ( *AVCAsynchronousCommandCancel)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
selfPointer to an IOFireWireAVCLibUnitInterface.
pCommandObjectPointer to an IOFireWireAVCLibAsynchronousCommand object passed back in createAVCAsynchronousCommand.
AVCAsynchronousCommandReinit |
Reinitializes an existing IOFireWireAVCLibAsynchronousCommand object, preserving the existing command.
IOReturn ( *AVCAsynchronousCommandReinit)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
selfPointer to an IOFireWireAVCLibUnitInterface.
pCommandObjectPointer to an IOFireWireAVCLibAsynchronousCommand object passed back in createAVCAsynchronousCommand.
AVCAsynchronousCommandReinitWithCommandBytes |
Reinitializes an existing IOFireWireAVCLibAsynchronousCommand object, replacing the existing command with a new one.
IOReturn ( *AVCAsynchronousCommandReinitWithCommandBytes)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject, const UInt8 * command, UInt32 cmdLen);
selfPointer to an IOFireWireAVCLibUnitInterface.
pCommandObjectPointer to an IOFireWireAVCLibAsynchronousCommand object passed back in createAVCAsynchronousCommand.
commandPointer to the command buffer.
cmdLenLength of the command buffer.
AVCAsynchronousCommandRelease |
Releases an IOFireWireAVCLibAsynchronousCommand object.
IOReturn ( *AVCAsynchronousCommandRelease)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
selfPointer to an IOFireWireAVCLibUnitInterface.
pCommandObjectPointer to an IOFireWireAVCLibAsynchronousCommand object passed back in createAVCAsynchronousCommand.
AVCAsynchronousCommandSubmit |
Issues the asynchronous command on the bus.
IOReturn ( *AVCAsynchronousCommandSubmit)( void *self, IOFireWireAVCLibAsynchronousCommand *pCommandObject);
selfPointer to an IOFireWireAVCLibUnitInterface.
pCommandObjectPointer to an IOFireWireAVCLibAsynchronousCommand object passed back in createAVCAsynchronousCommand.
AVCCommand |
Sends an AV/C command to the device and returns the response.
IOReturn ( *AVCCommand)( void *self, const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen);
selfPointer to IOFireWireAVCLibUnitInterface.
commandPointer to command to send.
cmdLenLength (in bytes) of command.
responsePointer to place to store the response sent by the device.
responseLenPointer to place to store the length of the response. On entry, this parameter contains the size of the response buffer in bytes; on exit, it contains the number of valid bytes in the response buffer.
This function will block until the device returns a response or the kernel driver times out.
AVCCommandInGeneration |
Sends an AV/C command to the device and returns the response.
IOReturn ( *AVCCommandInGeneration)( void *self, UInt32 busGeneration, const UInt8 * command, UInt32 cmdLen, UInt8 * response, UInt32 *responseLen);
selfPointer to IOFireWireAVCLibUnitInterface.
busGenerationFireWire bus generation that the command is valid in.
commandPointer to command to send.
cmdLenLength (in bytes) of command.
responsePointer to place to store the response sent by the device.
responseLenPointer to place to store the length of the response. On entry, this parameter contains the size of the response buffer in bytes; on exit, it contains the number of valid bytes in the response buffer.
Sends an AV/C command to the device and returns the response. The command must complete in the specified bus generation. This function will block until the device returns a response or the kernel driver times out.
breakLocalP2PInputConnection |
Decrements the point-to-point connection count of a unit input plug.
IOReturn ( *breakP2PInputConnection)( void *self, UInt32 inputPlug);
breakLocalP2POutputConnection |
Decrements the point-to-point connection count of a unit output plug.
IOReturn ( *breakP2POutputConnection)( void *self, UInt32 outputPlug);
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.
void ( *close)( void *self );
selfPointer to IOFireWireAVCLibUnitInterface.
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 |
Creates an IOFireWireAVCLibAsynchronousCommand object to use with the asynchronous AV/C command functions.
IOReturn ( *createAVCAsynchronousCommand)( void *self, const UInt8 * command, UInt32 cmdLen, IOFireWireAVCLibAsynchronousCommandCallback completionCallback, void *pRefCon, IOFireWireAVCLibAsynchronousCommand **ppCommandObject);
selfPointer to an IOFireWireAVCLibUnitInterface.
commandPointer to the command buffer.
cmdLenThe length of the command buffer.
completionCallbackThe address of the completion routine.
pRefConPointer to arbitrary data to be returned as the first argument of the callback routine.
ppCommandObjectPointer to pointer to an IOFireWireAVCLibAsynchronousCommand object to be passed in other asynchronous AV/C command functions.
getAncestorInterface |
Creates a plug-in object for an ancestor (in the I/O Registry) of the AV/C unit and returns an interface to it.
void * ( *getAncestorInterface)( void *self, char *object_class, REFIID pluginType, REFIID iid);
selfPointer to IOFireWireAVCLibUnitInterface.
object_classClass name of ancestor of the device to get an interface for.
pluginTypeAn ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of plug-in service to be returned for the ancestor.
iidAn ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created plug-in object.
Returns a COM-style interface pointer. Returns 0 upon failure.
getAsyncConnectionPlugCounts |
Gets the number of plugs in the producer.
IOReturn ( *getAsyncConnectionPlugCounts) ( void *self, UInt8 *inputPlugCount, UInt8 *outputPlugCount );
selfPointer to IOFireWireAVCLibUnitInterface.
inputPlugCountPointer to the number of input plugs.
outputPlugCountPointer to the number of output plugs.
getProtocolInterface |
Creates a plug-in object for a protocol driver for the FireWire bus the AV/C unit is connected to and returns an interface to it.
void * ( *getProtocolInterface)( void *self, REFIID pluginType, REFIID iid);
selfPointer to IOFireWireAVCLibUnitInterface.
pluginTypeAn ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of plug-in service to be returned for the created protocol object.
iidAn ID number, of type CFUUIDBytes (see CFUUID.h), identifying the type of interface to be returned for the created protocol device object.
Returns a COM-style interface pointer. Returns 0 upon failure.
getSessionRef |
Opens a connection to a device that is not already open.
IOFireWireSessionRef ( *getSessionRef)( void *self);
selfPointer to IOFireWireAVCLibUnitInterface.
Returns an IOFireWireSessionRef on success.
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 AV/C User Client
open at the same time. The technique to arbitrate this is as follows:
sessionRef with the getSessionRef call.
sessionRef returned from the call in step 2.
makeLocalP2POutputConnection |
Increments the point-to-point connection count of a unit output plug.
IOReturn ( *makeP2POutputConnection)( void *self, UInt32 outputPlug, UInt32 chan, IOFWSpeed speed);
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.
IOReturn ( *open)( void *self );
selfPointer to IOFireWireAVCLibUnitInterface.
Returns kIOReturnSuccess on success.
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 );
selfPointer to IOFireWireAVCLibUnitInterface.
sessionRefSessionRef returned from getSessionRef call.
Returns kIOReturnSuccess on success.
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 AV/C User Client
open at the same time. The technique to arbitrate this is as follows:
sessionRef with the getSessionRef call.
sessionRef returned from the call in step 2.
removeCallbackDispatcherFromRunLoop |
Removes a dispatcher for kernel callbacks to the specified run loop.
void ( *removeCallbackDispatcherFromRunLoop)( void *self );
selfPointer to IOFireWireAVCLibUnitInterface.
Undoes the work of addCallbackDispatcherToRunLoop.
setMessageCallback |
Sets callback for user space message routine.
void ( *setMessageCallback)( void *self, void *refCon, IOFWAVCMessageCallback callback);
selfPointer to IOFireWireAVCLibUnitInterface.
refConRefCon to be returned as first argument of completion routine.
callbackAddress of completion routine.
In FireWire and AV/C, bus status messages are delivered via IOKit's message routine. This routine is emulated in user space for AV/C and FireWire messages via this callback. You should register here for bus reset and reconnect messages.
updateAVCCommandTimeout |
Updates an AVCCommand's timeout back to 10 seconds.
IOReturn ( *updateAVCCommandTimeout)( void *self);
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.
|
Last Updated: 2009-02-23