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

 


IOATACommand

Inherits from:
Declared In:

Overview

Command structure superclass, created and freed only by IOATADevice objects populated by disk device drivers with command parameters then submitted for operation to their IOATADevice provider for execution.

IOATACommand is a virtual class, a concrete subclass contains the methods and fields needed by IOATAControllers. Subclasses may be specific to particular controller hardware. Disk device drivers will only have visibility to this interface and may not subclass this object. Disk device drivers should instead make use of the void* refcon field which the controllers will not touch



Functions

getActualTransfer

Returns the byte count on the ending result, as best as can be determined by the controller.

getBuffer

Returns the IOMemoryDescriptor used in this transaction.

getCommandInUse

Returns true if IOATAController is still in control of the command.

getCylHi

Performs taskfile access.

getCylLo

Performs taskfile access.

getDevice_Head

Performs taskfile access.

getEndErrorReg

Returns the value of the error register at the end of a command if the error bit was set in the status register.

getEndStatusReg

Returns the value of the status register on the end of the command.

getErrorReg

Performs taskfile access.

getResult

IOReturn value of the result of this command.

getSectorCount

Performs taskfile access.

getSectorNumber

Performs taskfile access.

getStatus

Performs taskfile access.

setBuffer

Sets the IIOMemoryDescriptor for this transaction.

setByteCount

Sets the byte count for this transaction.

setCallbackPtr

Sets the function pointer to call when this command completes.

setCommand

Performs taskfile access.

setCylHi

Performs taskfile access.

setCylLo

Performs taskfile access.

setDevice_Head

Performs taskfile access.

setFeatures

Performs taskfile access.

setFlags

Sets the flags for this command, as defined in IOATATypes.

setLBA28

Convenience method that sets the taskfile registers into a 28-bit LBA address, with unit selected and LBA bit set.

setOpcode

Sets command opcode as defined in IOATATypes.

setPacketCommand

Makes deep copy of data.

setPosition

Sets an offset into the memory descriptor for this transfer.

setRegMask

Used when accessing registers or reading registers on an error result.

setSectorCount

Performs taskfile access.

setSectorNumber

Performs taskfile access.

setTimeoutMS

Sets how long to allow this command to complete, in milliseconds, once issued to the hardware.

setTransferChunkSize

Sets the size of transfer between intervening interrupts.

setUnit

Sets the unit number for this command.

zeroCommand

Sets to blank state.


getActualTransfer


Returns the byte count on the ending result, as best as can be determined by the controller.

public

virtual IOByteCount getActualTransfer ( void );
Discussion

May be zero, but partial transfer may have occurred on error in some cases.


getBuffer


Returns the IOMemoryDescriptor used in this transaction.

public

virtual IOMemoryDescriptor* getBuffer ( void );


getCommandInUse


Returns true if IOATAController is still in control of the command.

public

virtual bool getCommandInUse( void );


getCylHi


Performs taskfile access.

public

virtual UInt8 getCylHi ( void );
Discussion

Registers are named in accordance with ATA Standards conventions.


getCylLo


Performs taskfile access.

public

virtual UInt8 getCylLo ( void );
Discussion

Registers are named in accordance with ATA Standards conventions.


getDevice_Head


Performs taskfile access.

public

virtual UInt8 getDevice_Head ( void );
Discussion

Registers are named in accordance with ATA Standards conventions.


getEndErrorReg


Returns the value of the error register at the end of a command if the error bit was set in the status register.

public

virtual UInt8 getEndErrorReg( void );


getEndStatusReg


Returns the value of the status register on the end of the command.

public

virtual UInt8 getEndStatusReg ( void);


getErrorReg


Performs taskfile access.

public

virtual UInt8 getErrorReg ( void );
Discussion

Registers are named in accordance with ATA Standards conventions.


getResult


IOReturn value of the result of this command.

public

virtual IOReturn getResult ( void);
Discussion

ATA family errors are defined in IOATATypes.h


getSectorCount


Performs taskfile access.

public

virtual UInt8 getSectorCount ( void );
Discussion

Registers are named in accordance with ATA Standards conventions.


getSectorNumber


Performs taskfile access.

public

virtual UInt8 getSectorNumber ( void );
Discussion

Registers are named in accordance with ATA Standards conventions.


getStatus


Performs taskfile access.

public

virtual UInt8 getStatus ( void );
Discussion

Registers are named in accordance with ATA Standards conventions.


setBuffer


Sets the IIOMemoryDescriptor for this transaction.

public

virtual void setBuffer ( IOMemoryDescriptor *inDesc);


setByteCount


Sets the byte count for this transaction.

public

virtual void setByteCount ( IOByteCount numBytes);
Discussion

Should agree with the device command and the memory descriptor in use.


setCallbackPtr


Sets the function pointer to call when this command completes.

public

virtual void setCallbackPtr ( IOATACompletionFunction *inCompletion);


setCommand


Performs taskfile access.

public

virtual void setCommand ( UInt8 in);
Discussion

Registers are named in accordance with ATA Standards conventions.


setCylHi


Performs taskfile access.

public

virtual void setCylHi( UInt8 in);
Discussion

Registers are named in accordance with ATA Standards conventions.


setCylLo


Performs taskfile access.

public

virtual void setCylLo ( UInt8 in);
Discussion

Registers are named in accordance with ATA Standards conventions.


setDevice_Head


Performs taskfile access.

public

virtual void setDevice_Head( UInt8 in);
Discussion

Registers are named in accordance with ATA Standards conventions.


setFeatures


Performs taskfile access.

public

virtual void setFeatures( UInt8 in);
Discussion

Registers are named in accordance with ATA Standards conventions.


setFlags


Sets the flags for this command, as defined in IOATATypes.

public

virtual void setFlags( UInt32 inFlags);


setLBA28


Convenience method that sets the taskfile registers into a 28-bit LBA address, with unit selected and LBA bit set.

public

virtual IOReturn setLBA28( UInt32 lba, ataUnitID inUnit);
Discussion

This method returns err if param out of range; returns kIOSuccess (kATANoErr) = 0 on return if successful.


setOpcode


Sets command opcode as defined in IOATATypes.

public

virtual void setOpcode( ataOpcode inCode);


setPacketCommand


Makes deep copy of data.

public

virtual IOReturn setPacketCommand( UInt16 packetSizeBytes, UInt8 *command);
Discussion

ATAPI command packet max size is 16 bytes.


setPosition


Sets an offset into the memory descriptor for this transfer.

public

virtual void setPosition ( IOByteCount fromPosition);


setRegMask


Used when accessing registers or reading registers on an error result.

public

virtual void setRegMask( ataRegMask mask);
Discussion

Mask is defined in IOATATypes.h


setSectorCount


Performs taskfile access.

public

virtual void setSectorCount( UInt8 in);
Discussion

Registers are named in accordance with ATA Standards conventions.


setSectorNumber


Performs taskfile access.

public

virtual void setSectorNumber( UInt8 in);
Discussion

Registers are named in accordance with ATA Standards conventions.


setTimeoutMS


Sets how long to allow this command to complete, in milliseconds, once issued to the hardware.

public

virtual void setTimeoutMS( UInt32 inMs);
Discussion

If the time period expires, this command will return with a timeout error.


setTransferChunkSize


Sets the size of transfer between intervening interrupts.

public

virtual void setTransferChunkSize( IOByteCount chunk = kATADefaultSectorSize);
Discussion

This is necessary when doing PIO Read/Write Multiple, etc. so the controller knows when to expect an interrupt during multi-sector data transfers.


setUnit


Sets the unit number for this command.

public

virtual void setUnit( ataUnitID inUnit);


zeroCommand


Sets to blank state.

public

virtual void zeroCommand( void);
Discussion

You MUST call this method prior to re-use of this object

Structs and Unions


ExpansionData


protected

struct ExpansionData { IOExtendedLBA *extLBA; };
Discussion

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

Member Data


fExpansionData


See Also:

reserved

protected

ExpansionData *fExpansionData;
Discussion

Reserved for future use. (Internal use only)


refCon


For use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner.

public

void* refCon;


refCon2


For use by disk drivers, clients of IOATADevice only. IOATADevice and IOATAControllers shall not use this field in any manner.

public

void* refCon2;


reserved


See Also:

fExpansionData

protected

ExpansionData *fExpansionData;
Discussion

Reserved for future use. (Internal use only)


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