IOSCSIParallelCommand.h [plain text]
#ifndef _IOSCSIPARALLELCOMMAND_H
#define _IOSCSIPARALLELCOMMAND_H
#include "IOSCSICommand.h"
#include "SCSIParallelTarget.h"
class IOSCSIParallelDevice;
class IOSCSIParallelCommand;
class IOSyncer;
class IOSCSIParallelCommand : public IOSCSICommand
{
OSDeclareDefaultStructors(IOSCSIParallelCommand)
friend class IOSCSIParallelController;
friend class IOSCSIParallelDevice;
public:
void setPointers( IOMemoryDescriptor *desc,
UInt32 transferCount,
bool isWrite,
bool isSense = false );
void getPointers( IOMemoryDescriptor **desc,
UInt32 *transferCount,
bool *isWrite,
bool isSense = false );
void setTimeout( UInt32 timeoutmS );
UInt32 getTimeout();
void setCallback( void *target = 0, CallbackFn callback = 0, void *refcon = 0 );
void setCDB( CDBInfo *cdbInfo );
void getCDB( CDBInfo *cdbInfo );
IOReturn getResults( CDBResults *cdbResults );
IOCDBDevice *getDevice( IOCDBDevice *deviceType );
bool execute( UInt32 *sequenceNumber = 0 );
void abort( UInt32 sequenceNumber );
void complete();
void *getCommandData();
void *getClientData();
UInt32 getSequenceNumber();
public:
void setCDB( SCSICDBInfo *scsiCmd );
void getCDB( SCSICDBInfo *scsiCmd );
IOReturn getResults( SCSIResults *results );
void setResults( SCSIResults *results, SCSINegotiationResults *negotiationResults );
IOSCSIParallelDevice *getDevice( IOSCSIParallelDevice *deviceType );
void getTargetLun( SCSITargetLun *targetLun );
void setQueueInfo( UInt32 forQueueType = kQTypeNormalQ, UInt32 forQueuePosition = kQPositionTail );
void getQueueInfo( UInt32 *forQueueType, UInt32 *forQueuePosition = 0 );
UInt32 getCmdType();
IOSCSIParallelCommand *getOriginalCmd();
void zeroCommand();
public:
void free();
IOSCSIDevice *getDevice( IOSCSIDevice *deviceType );
void setResults( SCSIResults *results );
private:
IOReturn adapterStatusToIOReturnCode( SCSIAdapterStatus adapterStatus );
IOReturn scsiStatusToIOReturnCode( UInt8 scsiStatus );
private:
SCSICommandType cmdType;
IOSCSIParallelController *controller;
IOSCSIParallelDevice *device;
queue_head_t *list;
queue_chain_t nextCommand;
SCSICDBInfo scsiCmd;
SCSIResults results;
UInt32 timeout;
UInt32 timer;
UInt8 queueType;
UInt8 queuePosition;
IOMemoryDescriptor *xferDesc;
UInt32 xferCount;
UInt32 xferDirection;
UInt32 senseLength;
IOMemoryDescriptor *senseData;
IOSCSIParallelCommand *origCommand;
union
{
struct
{
UInt32 reserved;
IOSyncer * lock;
} sync;
struct
{
CallbackFn callback;
void *target;
void *refcon;
} async;
} completionInfo;
UInt32 dataSize;
void *dataArea;
void *commandPrivateData;
void *clientData;
UInt32 sequenceNumber;
};
#endif