|
Mac Dev Center
Mac OS X Reference Library Drivers, Kernel, & Hardware: User-Space Device Access I/O Kit Framework Reference
|
IOFireWireAVCLibUnitInterface |
| Declared In: |
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.
Adds a dispatcher for kernel callbacks to the specified runloop.
Sends an AVC command to the device and returns the response.
Sends an AVC 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 a plug-in object for an ancestor (in the I/O Registry) of the AVC unit and returns an interface to it.
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.
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.
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.
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 runloop.
IOReturn ( *addCallbackDispatcherToRunLoop)( void *self, CFRunLoopRef cfRunLoopRef );
selfPointer to IOFireWireAVCLibUnitInterface.
cfRunLoopRefReference to a run loop.
Returns kIOReturnSuccess on success.
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.
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.
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.
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);
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.
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.
breakLocalP2PInputConnection |
Decrements the point-to-point connection count of a unit input plug.
IOReturn ( *breakP2PInputConnection)( void *self, UInt32 inputPlug);
This function is only available if the interface version is > 3.
breakLocalP2POutputConnection |
Decrements the point-to-point connection count of a unit output plug.
IOReturn ( *breakP2POutputConnection)( void *self, UInt32 outputPlug);
This function is only available if the interface version is > 3.
breakP2PInputConnection |
Decrements the point-to-point connection count of a unit input plug.
IOReturn ( *breakP2PInputConnection)( void *self, UInt32 inputPlug);
This function is only available if the interface version is > 3.
breakP2POutputConnection |
Decrements the point-to-point connection count of a unit output plug.
IOReturn ( *breakP2POutputConnection)( void *self, UInt32 outputPlug);
This function is only available if the interface version is > 3.
close |
Closes an exclusive access to the device.
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 |
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.
selfPointer to IOFireWireAVCLibUnitInterface.
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.
This function is only available if the interface version is > 1 (MacOSX 10.2.0 or later?).
getBusProtocolInterface |
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.
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.
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.
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.
This function is only available if the interface version is > 1 (MacOSX 10.2.0 or later?).
getSessionRef |
Opens a connection to a device that is not already open.
IOFireWireSessionRef ( *getSessionRef)( void *self);
selfPointer to IOFireWireAVCLibUnitInterface.
Returns a sessionRef 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 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 IORegistry.
Second, get its sessionRef with the
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.
makeLocalP2POutputConnection |
Increments the point-to-point connection count of a unit output plug.
IOReturn ( *makeP2POutputConnection)( void *self, UInt32 outputPlug, UInt32 chan, IOFWSpeed speed);
This function is only available if the interface version is > 3.
makeP2PInputConnection |
Increments the point-to-point connection count of a unit input plug.
IOReturn ( *makeP2PInputConnection)( void *self, UInt32 inputPlug, UInt32 chan);
This function is only available if the interface version is > 3.
makeP2POutputConnection |
Increments the point-to-point connection count of a unit output plug.
IOReturn ( *makeP2POutputConnection)( void *self, UInt32 outputPlug, UInt32 chan, IOFWSpeed speed);
This function is only available if the interface version is > 3.
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(void *) |
Opens a connection to a device that is not already open.
IOFireWireSessionRef ( *getSessionRef)( void *self);
selfPointer to IOFireWireAVCLibUnitInterface.
Returns a sessionRef 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 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 IORegistry.
Second, get its sessionRef with the
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.
openWithSessionRef(void *, IOFireWireSessionRef) |
Opens a connection to a device that is not already open.
IOReturn ( *openWithSessionRef)( void *self, IOFireWireSessionRef sessionRef );
sessionRefSessionRef returned from getSessionRef call.
selfPointer to IOFireWireAVCLibUnitInterface.
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 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.
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.
selfPointer to IOFireWireAVCLibUnitInterface.
Undoes the work of addCallbackDispatcherToRunLoop.
setMessageCallback |
Sets callback for user space message routine.
selfPointer to IOFireWireAVCLibUnitInterface.
refConRefCon to be returned as first argument of completion routine.
callbackAddress of completion routine.
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.
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. This function is only available if the interface version is > 2.
Last Updated: 2009-10-15