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.
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.
Name Description scsiDevice Always specify kIOSCSIDevice. clientDataSize The 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.
public:
void close( IOService *client, IOOptionBits options = 0 );
A client must close a IOSCSIDevice if the client plans no further accesses to it.
Name Description client Pointer to the IOSCSI device the client is closing. options There are currently no options defined by the SCSI Family.
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().
Name Description queueType Perform action on the indicated queue. See enum SCSIQueueType in IOSCSICommand. rc The return code of any flushed commands is set to (rc).
public:
void getInquiryData( void *inquiryBuffer, UInt32 inquiryBufSize, UInt32 *inquiryDataSize );
Inquiry data returned is from the results of the last SCSI bus probe.
Name Description inquiryBuffer Pointer to a buffer to receive the Inquiry data. inquiryBufSize Size of the buffer supplied. inquiryDataSize Pointer to a UInt32 to receive the size of the Inquiry data actually returned.
public:
void getLunParms( SCSILunParms *lunParms );
Returns the parameters currently in effect for the SCSI target/lun.
Name Description lunParms Pointer to structure of type SCSITargetParms
public:
void getTargetParms( SCSITargetParms *targetParms );
Returns the parameters currently in effect for the SCSI target. See setTargetParms().
Name Description targetParms Pointer to structure of type SCSITargetParms.
public:
IOWorkloop *getWorkLoop();
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()
Name Description queueType Perform action on the indicated queue. See enum SCSIQueueType in IOSCSICommand.
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.
Name Description id Message id's for IOSCSIDevice are defined by enum SCSIClientMessage provider Pointer to the IOSCSIDevice reporting the event. argument Unused.
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.
Name Description target Object to receive the notification. Normally the client's (this) pointer. callback Pointer to a callback routine of type CallbackFn. refcon Pointer to client's private data.
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.
Name Description client Pointer to the IOSCSI device the client is opening. options There are currently no options defined by the SCSI Family. arg Unused. Omit or specify 0.
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.
Name Description queueType Perform action on the indicated queue. See enum SCSIQueueType in IOSCSICommand.
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.
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.
Name Description lunParms Pointer to structure of type SCSILunParms
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.
Name Description targetParms Pointer to structure of type SCSITargetParms.
© 2000 Apple Computer, Inc. (Last Updated 2/23/2000)