Functions



abort

Abstract: Aborts all outstanding requests for the target/lun pair.
public:

void abort();

If any I/O requests are currently active for the target/lun, an abort command is sent to the device and any active requests are completed.

Prior to abort processing beginning, the client will be notified via:

message( kClientMsgDeviceAbort );

When abort processing is completed, the client will be notified via:

message( kClientMsgDeviceAbort | kClientMsgDone );

The client is responsible for managing the pending work queue for the device when an abort request occurs. See holdQueue(), flushQueue(), notifyIdle() functions.


allocCommand

Abstract: Allocates a IOSCSICommand object for this device.
public:

IOSCSICommand *allocCommand( IOSCSIDevice *scsiDevice, UInt32 clientDataSize = 0 );

The client uses the allocCommand() member function to allocate IOSCSICommand(s) for a IOSCSIDevice. The client then uses the member functions of the IOSCSICommand to initialize it and send it to the device. A completed IOSCSICommand may be reused for subsequent I/O requests or returned to the SCSI Family.

Parameters

NameDescription
scsiDeviceAlways specify kIOSCSIDevice.
clientDataSizeThe client may indicate the size of a per-command data area for its own use.

Note: The amount of per-command storage allowed is under review. We anticipate that typical SCSI clients will need not more than 1024 bytes per command.

close

Abstract: IOService close function
public:

void close( IOService *client, IOOptionBits options = 0 );

A client must close a IOSCSIDevice if the client plans no further accesses to it.

Parameters

NameDescription
clientPointer to the IOSCSI device the client is closing.
optionsThere are currently no options defined by the SCSI Family.

flushQueue

Abstract: Returns any commands on the IOSCSIDevice's pending work queue.
public:

void flushQueue( UInt32 queueType, IOReturn rc );

flushQueue() may only be called from the IOSCSIDevice workloop. This is guaranteed to be the case after a IOSCSICommand completion of after a message() notification.

All pending command are completed prior to flushQueue() returning to the caller.

flushQueue() has no effect on commands already passed to the host adapter. One or more commands may complete after the queue is flushed. See notifyIdle().

Parameters

NameDescription
queueTypePerform action on the indicated queue. See enum SCSIQueueType in IOSCSICommand.
rcThe return code of any flushed commands is set to (rc).

getInquiryData

Abstract: Returns SCSI Inquiry data for the IOSCSIDevice.
public:

void getInquiryData( void *inquiryBuffer, UInt32 inquiryBufSize, UInt32 *inquiryDataSize );

Inquiry data returned is from the results of the last SCSI bus probe.

Parameters

NameDescription
inquiryBufferPointer to a buffer to receive the Inquiry data.
inquiryBufSizeSize of the buffer supplied.
inquiryDataSizePointer to a UInt32 to receive the size of the Inquiry data actually returned.

getLunParms

Abstract: Gets the current logical unit parameters.
public:

void getLunParms( SCSILunParms *lunParms );

Returns the parameters currently in effect for the SCSI target/lun.

Parameters

NameDescription
lunParmsPointer to structure of type SCSITargetParms

getTargetParms

Abstract: Gets the current target parameters.
public:

void getTargetParms( SCSITargetParms *targetParms );

Returns the parameters currently in effect for the SCSI target. See setTargetParms().

Parameters

NameDescription
targetParmsPointer to structure of type SCSITargetParms.

getWorkLoop

Abstract: Returns the IOWorkLoop object that services this IOSCSIDevice.
public:

IOWorkloop *getWorkLoop();


holdQueue

Abstract: Suspends sending additional IOSCSICommands to the target/lun.
public:

holdQueue( UInt32 queueType );

holdQueue() may only be called from the IOSCSIDevice workloop. The client is guaranteed to be running in this context during a message() notification.

holdQueue() has no effect on commands already passed to the host adapter. One or more commands may complete after the queue is held. See notifyIdle()

Parameters

NameDescription
queueTypePerform action on the indicated queue. See enum SCSIQueueType in IOSCSICommand.

message

Abstract: IOService message function.
public:

IOReturn message( UInt32 type, IOService * provider, void * argument = 0 );

IOSCSIDevice notifies its client of significant 'events' by the IOService::message() api. When possible the client is notified of the event prior to any action taken. The client is responsible for managing the device queue for the IOSCSIDevice via the holdQueue(), releaseQueue(), flushQueue() and notifyIdle() api's.

Any return codes provided by the client are ignored.

Parameters

NameDescription
idMessage id's for IOSCSIDevice are defined by enum SCSIClientMessage
providerPointer to the IOSCSIDevice reporting the event.
argumentUnused.

notifyIdle

Abstract: Notifies the client when all active commands on a SCSI device have completed.
public:

void notifyIdle( void *target, Callback callback, void *refcon );

notifyIdle() may only be called from the IOSCSIDevice workloop. This is guaranteed to be the case after a IOSCSICommand completion of after a message() notification.

Only one notifyIdle() call may be active. Any outstanding notifyIdle() calls may be cancelled by calling notifyIdle() with no parameters.

Parameters

NameDescription
targetObject to receive the notification. Normally the client's (this) pointer.
callbackPointer to a callback routine of type CallbackFn.
refconPointer to client's private data.

open

Abstract: IOService open function
public:

bool open( IOService *client, IOOptionBits options = 0, void *arg = 0 );

A client should open a IOSCSIDevice prior to accessing it. Only one open is allowed per device.

Parameters

NameDescription
clientPointer to the IOSCSI device the client is opening.
optionsThere are currently no options defined by the SCSI Family.
argUnused. Omit or specify 0.

releaseQueue

Abstract: Resumes sending IOSCSICommands to the IOSCSIDevice.
public:

void releaseQueue( UInt32 queueType );

If the device queue was not held, releaseQueue() has no effect.

releaseQueue() may only be called from the IOSCSIDevice workloop. This is guaranteed to be the case after a IOSCSICommand completion of after a message() notification.

Parameters

NameDescription
queueTypePerform action on the indicated queue. See enum SCSIQueueType in IOSCSICommand.

reset

Abstract: Resets the SCSI target.
public:

void reset();

Since a SCSI target may have multiple logical units (lun(s)) the reset() function may affect multiple IOSCSIDevice instances. Processing for each lun is similar.

Prior to reset processing beginning, the client will be notified via:

message( kClientMsgDeviceReset );

When reset processing is completed, the client will be notified via:

message( kClientMsgDeviceReset | kClientMsgDone );

The client is responsible for managing the pending work queue for the device when an abort request occurs. See holdQueue(), flushQueue(), notifyIdle() functions.


setLunParms

Abstract: Sets the logical unit parameters for this device.
public:

bool setLunParms( SCSILunParms *lunParms );

This function will block until we attempt to set the requested parameters. It may not be called from the device's workloop context.

The SCSI Family will serialize accesses to the SCSI target/lun so as not to disrupt commands in progress prior to processing a change of lun parameters.

Parameters

NameDescription
lunParmsPointer to structure of type SCSILunParms

setTargetParms

Abstract: Sets SCSI parameters that apply to all luns on a SCSI target device.
public:

bool setTargetParms( SCSITargetParms *targetParms );

This function will block until we attempt to set the requested parameters. It may not be called from the device's workloop context.

The SCSI Family will serialize accesses to the SCSI target so as not to disrupt commands in progress prior to processing a change of target parameters.

Parameters

NameDescription
targetParmsPointer to structure of type SCSITargetParms.

© 2000 Apple Computer, Inc. — (Last Updated 2/23/2000)