Mac OS X Reference Library Apple Developer
Search

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

The byte count on the ending result, as best as can be determined by the controller. May be zero, but partial transfer may have occurred on error in some cases.

getBuffer

the IOMemoryDescriptor used in this transaction.

getCommandInUse

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

getCylHi

Taskfile access. Registers are named in accordance with ATA Standards conventions

getCylLo

Taskfile access. Registers are named in accordance with ATA Standards conventions

getDevice_Head

Taskfile access. Registers are named in accordance with ATA Standards conventions

getEndErrorReg

If the error bit was set in the status register, the value of the error register is returned at the end of a command.

getEndStatusReg

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

getErrorReg

Taskfile access. Registers are named in accordance with ATA Standards conventions

getResult

IOReturn value of the result of this command. ATA family errors are defined in IOATATypes.h

getSectorCount

Taskfile access. Registers are named in accordance with ATA Standards conventions

getSectorNumber

Taskfile access. Registers are named in accordance with ATA Standards conventions

getStatus

Taskfile access. Registers are named in accordance with ATA Standards conventions

setBuffer

set the IIOMemoryDescriptor for this transaction.

setByteCount

set the byte count for this transaction. Should agree with the device command and the memory descriptor in use.

setCallbackPtr

set the function pointer to call when this command completes.

setCommand

Taskfile access. Registers are named in accordance with ATA Standards conventions

setCylHi

Taskfile access. Registers are named in accordance with ATA Standards conventions

setCylLo

Taskfile access. Registers are named in accordance with ATA Standards conventions

setDevice_Head

Taskfile access. Registers are named in accordance with ATA Standards conventions

setFeatures

Taskfile access. Registers are named in accordance with ATA Standards conventions

setFlags

set 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. return err if param out of range, return kIOSuccess (kATANoErr) = 0 on return if successful

setOpcode

command opcode as defined in IOATATypes.

setPacketCommand

ATAPI command packet max size is 16 bytes. Makes deep copy of data.

setPosition

used to set an offset into the memory descriptor for this transfer.

setRegMask

used when accessing registers or reading registers on an error result. Mask is defined in IOATATypes.h

setSectorCount

Taskfile access. Registers are named in accordance with ATA Standards conventions

setSectorNumber

Taskfile access. Registers are named in accordance with ATA Standards conventions

setTimeoutMS

how long to allow this command to complete, in milliseconds, once issued to the hardware. if the time period expires, this command will return with a timeout error.

setTransferChunkSize

set the size of transfer between intervening interrupts. necessary when doing PIO Read/Write Multiple, etc. so the controller knows when to expect an interrupt during multi-sector data transfers.

setUnit

set the unit number for this command.

zeroCommand

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


getActualTransfer


The byte count on the ending result, as best as can be determined by the controller. May be zero, but partial transfer may have occurred on error in some cases.

public

virtual IOByteCount getActualTransfer ( void );

getBuffer


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


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual UInt8 getCylHi ( void );

getCylLo


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual UInt8 getCylLo ( void );

getDevice_Head


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual UInt8 getDevice_Head ( void );

getEndErrorReg


If the error bit was set in the status register, the value of the error register is returned at the end of a command.

public

virtual UInt8 getEndErrorReg( void );

getEndStatusReg


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

public

virtual UInt8 getEndStatusReg ( void);

getErrorReg


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual UInt8 getErrorReg ( void );

getResult


IOReturn value of the result of this command. ATA family errors are defined in IOATATypes.h

public

virtual IOReturn getResult ( void);

getSectorCount


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual UInt8 getSectorCount ( void );

getSectorNumber


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual UInt8 getSectorNumber ( void );

getStatus


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual UInt8 getStatus ( void );

setBuffer


set the IIOMemoryDescriptor for this transaction.

public

virtual void setBuffer ( IOMemoryDescriptor *inDesc);

setByteCount


set the byte count for this transaction. Should agree with the device command and the memory descriptor in use.

public

virtual void setByteCount ( IOByteCount numBytes);

setCallbackPtr


set the function pointer to call when this command completes.

public

virtual void setCallbackPtr ( IOATACompletionFunction *inCompletion);

setCommand


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual void setCommand ( UInt8 in);

setCylHi


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual void setCylHi( UInt8 in);

setCylLo


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual void setCylLo ( UInt8 in);

setDevice_Head


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual void setDevice_Head( UInt8 in);

setFeatures


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual void setFeatures( UInt8 in);

setFlags


set 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. return err if param out of range, return kIOSuccess (kATANoErr) = 0 on return if successful

public

virtual IOReturn setLBA28( UInt32 lba, ataUnitID inUnit);

setOpcode


command opcode as defined in IOATATypes.

public

virtual void setOpcode( ataOpcode inCode);

setPacketCommand


ATAPI command packet max size is 16 bytes. Makes deep copy of data.

public

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

setPosition


used to set 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. Mask is defined in IOATATypes.h

public

virtual void setRegMask( ataRegMask mask);

setSectorCount


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual void setSectorCount( UInt8 in);

setSectorNumber


Taskfile access. Registers are named in accordance with ATA Standards conventions

public

virtual void setSectorNumber( UInt8 in);

setTimeoutMS


how long to allow this command to complete, in milliseconds, once issued to the hardware. if the time period expires, this command will return with a timeout error.

public

virtual void setTimeoutMS( UInt32 inMs);

setTransferChunkSize


set the size of transfer between intervening interrupts. necessary when doing PIO Read/Write Multiple, etc. so the controller knows when to expect an interrupt during multi-sector data transfers.

public

virtual void setTransferChunkSize( IOByteCount chunk = kATADefaultSectorSize);

setUnit


set the unit number for this command.

public

virtual void setUnit( ataUnitID inUnit);

zeroCommand


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

public

virtual void zeroCommand( void);

Structs and Unions

ExpansionData

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
refCon

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

refCon2

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

reserved

fExpansionData


protected

ExpansionData *fExpansionData;
Discussion

Reserved for future use. (Internal use only)

See Also


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


protected

ExpansionData *fExpansionData;
Discussion

Reserved for future use. (Internal use only)

See Also

 

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

Last Updated: 2010-07-29