ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


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 that creates an instance of this class used by subclasses of IOATADevice.

executeCallback

Calls the completion callback function.

getBuffer

Gets pointer to the memory descriptor for this transaction.

getByteCount

Returns the byte count for this transaction to transfer.

getCallbackPtr

Returns the callback pointer.

getFlags

Returns the flags for this command.

getOpcode

Returns the command opcode.

getPacketData

Returns pointer to the array of packet data.

getPacketSize

Returns the size of ATAPI packet if any.

getPosition

Gets the position within the memory buffer for the transaction.

getRegMask

Gets the register mask for desired regs

getTaskFilePtr

Returns the taskfile structure pointer.

getTimeoutMS

Returns the timeout value for this command.

getTransferChunkSize

Returns the number of bytes between interrupts.

getUnit

Returns the unit ID (0 master, 1 slave).

init

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

setActualTransfer

Sets the byte count of bytes actually transferred.

setCommandInUse

Marks the command as being in progress.

setResult

Sets the result code.

zeroCommand

Sets to blank state.


allocateCmd


Factory method that creates an instance of this class used by subclasses of IOATADevice.

public

static IOATABusCommand* allocateCmd( void);


executeCallback


Calls the completion callback function.

public

virtual void executeCallback( void);


getBuffer


Gets pointer to the memory descriptor for this transaction.

public

virtual IOMemoryDescriptor* getBuffer ( void);


getByteCount


Returns the byte count for this transaction to transfer.

public

virtual IOByteCount getByteCount ( void);


getCallbackPtr


Returns the callback pointer.

public

virtual IOATACompletionFunction* getCallbackPtr ( void );


getFlags


Returns the flags for this command.

public

virtual ataFlags getFlags ( void );


getOpcode


Returns the command opcode.

public

virtual ataOpcode getOpcode( void );


getPacketData


Returns pointer to the array of packet data.

public

virtual UInt16* getPacketData( void);


getPacketSize


Returns the size of ATAPI packet if any.

public

virtual UInt16 getPacketSize( void);


getPosition


Gets the position within the memory buffer for the transaction.

public

virtual IOByteCount getPosition ( void);


getRegMask


Gets the register mask for desired regs

public

virtual ataRegMask getRegMask( void );


getTaskFilePtr


Returns the taskfile structure pointer.

public

virtual ataTaskFile* getTaskFilePtr( void);


getTimeoutMS


Returns the timeout value for this command.

public

virtual UInt32 getTimeoutMS ( void );


getTransferChunkSize


Returns the number of bytes between interrupts.

public

virtual IOByteCount getTransferChunkSize( void);


getUnit


Returns 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


Sets the byte count of bytes actually transferred.

public

virtual void setActualTransfer ( IOByteCount bytesTransferred );


setCommandInUse


Marks the command as being in progress.

public

virtual void setCommandInUse( bool inUse = true);


setResult


Sets the result code.

public

virtual void setResult( IOReturn );


zeroCommand


Sets to blank state.

public

virtual void zeroCommand( void);
Discussion

Call this method prior to re-use of this object.

Structs and Unions


ExpansionData


protected

struct ExpansionData { };
Discussion

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

Member Data


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: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19