ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOFireWireSBP2LibLUNInterface |
Declared In: |
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 IOFireWireSBP2LibManagementORBInterface objects 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.
Adds a dispatcher for kernel callbacks to the specified run loop.
Opens a connection to a device that is not already open.
Creates a new IOFireWireSBP2LibLoginInterface object.
Creates a new IOFireWireSBP2LibMgmntORBInterface object.
Returns the refCon set with setRefCon.
Returns the session reference to an already open device.
Exclusively opens a connection to the in-kernel device.
Opens a connection to a device that is already open.
Removes a dispatcher for kernel callbacks from the specified run loop.
Set callback for user space message routine.
Sets the ORB refCon.
addCallbackDispatcherToRunLoop |
Adds a dispatcher for kernel callbacks to the specified run loop.
IOReturn ( *addCallbackDispatcherToRunLoop)( void *self, CFRunLoopRef cfRunLoopRef );
self
Pointer to IOFireWireSBP2LibLUNInterface.
cfRunLoopRef
Reference to a run loop
Returns kIOReturnSuccess on success.
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 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 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 );
self
Pointer to IOFireWireSBP2LibLUNInterface.
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 );
self
Pointer to IOFireWireSBP2LibLUNInterface.
iid
UUID for desired type of IOFireWireSBP2LibLoginInterface.
Returns a pointer to a new IOFireWireSBP2LibLoginInterface.
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.
createMgmtORB |
Creates a new IOFireWireSBP2LibMgmntORBInterface object.
IUnknownVTbl** ( *createMgmtORB)( void *self, REFIID iid );
self
Pointer to IOFireWireSBP2LibLUNInterface.
iid
UUID for desired type of IOFireWireSBP2LibMgmtORBInterface.
Returns a pointer to a new IOFireWireSBP2Login.
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);
self
Pointer to IOFireWireSBP2LibLUNInterface.
Returns the previously stored user defined value.
Returns the user defined value previously stored in the ORB with setRefCon.
getSessionRef |
Returns the session reference to an already open device.
IOFireWireSessionRef ( *getSessionRef)( void *self);
self
Pointer to IOFireWireSBP2LibLUNInterface.
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 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 );
self
Pointer to IOFireWireSBP2LibLUNInterface.
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 already open.
IOReturn ( *openWithSessionRef)( void *self, IOFireWireSessionRef sessionRef );
sessionRef
SessionRef returned from getSessionRef call.
self
Pointer to IOFireWireSBP2LibLUNInterface.
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 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 run loop.
void ( *removeCallbackDispatcherFromRunLoop)( void *self );
self
Pointer to IOFireWireSBP2LibLUNInterface.
Undoes the work of addCallbackDispatcherToRunLoop.
setMessageCallback |
Set callback for user space message routine.
void ( *setMessageCallback)( void *self, void *refCon, IOFWSBP2MessageCallback callback);
self
Pointer to IOFireWireSBP2LibLUNInterface.
refCon
RefCon to be returned as first argument of completion routine
callback
Address of completion routine.
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.
void ( *setRefCon)( void *self, void *refCon );
self
Pointer to IOFireWireSBP2LibLUNInterface.
refCon
a user defined value.
Sets a user defined value on the ORB that can be retrieved later with the method getRefCon.
|
Last Updated: 2009-02-23