IOATAStandardCommand.h [plain text]
#ifndef _IOATASTANDARDCOMMAND_H
#define _IOATASTANDARDCOMMAND_H
class IOATAStandardDevice;
class IOATAStandardCommand;
class IOSyncer;
class IOATAStandardDriver;
class IOATAStandardCommand : public IOATACommand
{
OSDeclareDefaultStructors(IOATAStandardCommand)
friend class IOATAStandardController;
friend class IOATAStandardDevice;
friend class IOATAStandardDriver;
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 setTaskfile( ATATaskfile *taskfile );
void getTaskfile( ATATaskfile *taskfile );
ATAProtocol getProtocol();
UInt32 getResultMask();
UInt32 getFlags();
void setCDB( ATACDBInfo *ataCmd );
void getCDB( ATACDBInfo *ataCmd );
IOReturn getResults( ATAResults *results );
void setResults( ATAResults *results );
IOATAStandardDevice *getDevice( IOATAStandardDevice *deviceType );
ATAUnit getUnit();
void setQueueInfo( UInt32 forQueueType = kATAQTypeNormalQ, UInt32 forQueuePosition = kATAQPositionTail );
void getQueueInfo( UInt32 *forQueueType, UInt32 *forQueuePosition = 0 );
UInt32 getCmdType();
IOATAStandardCommand *getOriginalCmd();
public:
IOATADevice *getDevice( IOATADevice *deviceType );
void free();
private:
ATACommandType cmdType;
IOATAStandardController *controller;
IOATAStandardDevice *device;
queue_head_t *list;
queue_chain_t nextCommand;
ATATaskfile taskfile;
ATAResults results;
ATACDBInfo ataCmd;
UInt32 timeout;
UInt32 timer;
UInt8 queueType;
UInt8 queuePosition;
IOMemoryDescriptor *xferDesc;
UInt32 xferCount;
UInt32 xferDirection;
UInt32 senseLength;
IOMemoryDescriptor *senseData;
IOATAStandardCommand *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