IOATABusCommand

Inherits from
IOATACommand
Availability
Available in OS X v10.0 and later.
Declared in
IOATABusCommand.h

Overview

ATA Device (disk) drivers should use the superclass, IOATACommand and may not derive or use any subclass of IOATACommand.

IOATABusCommand is the subclass of IOATACommand used by IOATAControllers. Controller classes may override this class to provide additional fields as their needs dictate or may use this as a concrete class if it is sufficient.

IOATAControllers are always paired with specific IOATADevices and each specific subclass of IOATADevice is in turn the factory method for IOATACommands for use by disk drivers.

In this manner, mass-storage device drivers (disk drivers, clients of ATA bus controllers) see only the generalized interface of IOATADevice and the generalized interface of IOATACommand. This provides isolation from specific bus details for disk drivers and offers flexibility to controllers to add per-command fields and state variables for their own internal use.

Tasks

Miscellaneous

Instance Methods

allocateCmd

factory method to create an instance of this class used by subclasses of IOATADevice

static IOATABusCommand* allocateCmd( void);

executeCallback

call the completion callback function

virtual void executeCallback( void);

getBuffer

get pointer to the memory descriptor for this transaction

virtual IOMemoryDescriptor* getBuffer ( void);

getByteCount

return the byte count for this transaction to transfer.

virtual IOByteCount getByteCount ( void);

getCallbackPtr

return the callback pointer

virtual IOATACompletionFunction* getCallbackPtr ( void );

getFlags

return the flags for this command.

virtual ataFlags getFlags ( void );

getOpcode

return the command opcode

virtual ataOpcode getOpcode( void );

getPacketData

return pointer to the array of packet data.

virtual UInt16* getPacketData( void);

getPacketSize

return the size of atapi packet if any.

virtual UInt16 getPacketSize( void);

getPosition

the position within the memory buffer for the transaction.

virtual IOByteCount getPosition ( void);

getRegMask

get the register mask for desired regs

virtual ataRegMask getRegMask( void );

getTaskFilePtr

return the taskfile structure pointer.

virtual ataTaskFile* getTaskFilePtr( void);

getTimeoutMS

return the timeout value for this command

virtual UInt32 getTimeoutMS ( void );

getTransferChunkSize

number of bytes between interrupts.

virtual IOByteCount getTransferChunkSize( void);

getUnit

return the unit id (0 master, 1 slave)

virtual ataUnitID getUnit( void );

init

Zeroes all data, returns false if allocation fails. protected.

virtual bool init();

setActualTransfer

set the byte count of bytes actually transferred.

virtual void setActualTransfer ( IOByteCount bytesTransferred );

setCommandInUse

mark the command as being in progress.

virtual void setCommandInUse( bool inUse = true);

setResult

set the result code

virtual void setResult( IOReturn );

zeroCommand

set to blank state, call prior to re-use of this object

virtual void zeroCommand( void);

ExpansionData

struct ExpansionData {
};
Discussion

This structure will be used to expand the capablilties of the IOWorkLoop in the future.

Instance Variables

queueChain

queue_chain_t queueChain;

queue header for use by IOATAController.

reserved

ExpansionData *reserved;

Reserved for future use. (Internal use only)

state

UInt32 state;

state-semaphore for use by IOATAController

syncer

IOSyncer* syncer;

IOSyncer for use by IOATAController