Mac OS X Reference Library Apple Developer
Search

IOATABusCommand

Inherits from:
Declared In:

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.



Functions

allocateCmd

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

executeCallback

call the completion callback function

getBuffer

get pointer to the memory descriptor for this transaction

getByteCount

return the byte count for this transaction to transfer.

getCallbackPtr

return the callback pointer

getFlags

return the flags for this command.

getOpcode

return the command opcode

getPacketData

return pointer to the array of packet data.

getPacketSize

return the size of atapi packet if any.

getPosition

the position within the memory buffer for the transaction.

getRegMask

get the register mask for desired regs

getTaskFilePtr

return the taskfile structure pointer.

getTimeoutMS

return the timeout value for this command

getTransferChunkSize

number of bytes between interrupts.

getUnit

return the unit id (0 master, 1 slave)

init

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

setActualTransfer

set the byte count of bytes actually transferred.

setCommandInUse

mark the command as being in progress.

setResult

set the result code

zeroCommand

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


allocateCmd


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

public

static IOATABusCommand* allocateCmd( void);

executeCallback


call the completion callback function

public

virtual void executeCallback( void);

getBuffer


get pointer to the memory descriptor for this transaction

public

virtual IOMemoryDescriptor* getBuffer ( void);

getByteCount


return the byte count for this transaction to transfer.

public

virtual IOByteCount getByteCount ( void);

getCallbackPtr


return the callback pointer

public

virtual IOATACompletionFunction* getCallbackPtr ( void );

getFlags


return the flags for this command.

public

virtual ataFlags getFlags ( void );

getOpcode


return the command opcode

public

virtual ataOpcode getOpcode( void );

getPacketData


return pointer to the array of packet data.

public

virtual UInt16* getPacketData( void);

getPacketSize


return the size of atapi packet if any.

public

virtual UInt16 getPacketSize( void);

getPosition


the position within the memory buffer for the transaction.

public

virtual IOByteCount getPosition ( void);

getRegMask


get the register mask for desired regs

public

virtual ataRegMask getRegMask( void );

getTaskFilePtr


return the taskfile structure pointer.

public

virtual ataTaskFile* getTaskFilePtr( void);

getTimeoutMS


return the timeout value for this command

public

virtual UInt32 getTimeoutMS ( void );

getTransferChunkSize


number of bytes between interrupts.

public

virtual IOByteCount getTransferChunkSize( void);

getUnit


return the unit id (0 master, 1 slave)

public

virtual ataUnitID getUnit( void );

init


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

protected

virtual bool init();

setActualTransfer


set the byte count of bytes actually transferred.

public

virtual void setActualTransfer ( IOByteCount bytesTransferred );

setCommandInUse


mark the command as being in progress.

public

virtual void setCommandInUse( bool inUse = true);

setResult


set the result code

public

virtual void setResult( IOReturn );

zeroCommand


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

public

virtual void zeroCommand( void);

Structs and Unions

ExpansionData

ExpansionData


protected

struct ExpansionData { };
Discussion

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

Member Data

queueChain
reserved
state
syncer

queueChain


public

queue_chain_t queueChain;
Discussion

queue header for use by IOATAController.


reserved


protected

ExpansionData *reserved;
Discussion

Reserved for future use. (Internal use only)


state


public

UInt32 state;
Discussion

state-semaphore for use by IOATAController


syncer


public

IOSyncer* syncer;
Discussion

IOSyncer for use by IOATAController

 

Did this document help you? Yes It's good, but... Not helpful...

Last Updated: 2010-07-29