ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference

 


SCSITaskDeviceInterface

Declared In:

Overview

Basic interface for a SCSITask Device.

Discussion

After rendezvous with a SCSITask Device in the I/O Registry 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.



Functions

AddCallbackDispatcherToRunLoop

Convenience method to add asynchronous callback mechanisms to the CFRunLoop of choice.

CreateSCSITask

Method to create SCSITasks.

IsExclusiveAccessAvailable

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.

ReleaseExclusiveAccess

Method to release exclusive access to the device so that other clients can send commands to it.

RemoveCallbackDispatcherFromRunLoop

Convenience method to remove asynchronous callback mechanisms from the CFRunLoop.


AddCallbackDispatcherToRunLoop


Convenience method to add asynchronous callback mechanisms to the CFRunLoop of choice.

IOReturn ( *AddCallbackDispatcherToRunLoop ) (
    void *self,
    CFRunLoopRef cfRunLoopRef );  
Parameters
self

Pointer to a SCSITaskDeviceInterface instance.

cfRunLoopRef

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.

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.


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.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2009-02-23