Mac Developer Library

Developer

IOATACommand Class Reference

Options
Deployment Target:

On This Page
Language:

IOATACommand

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

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Kernel;

Availability


Available in OS X v10.0 and later.
  • 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.

    Declaration

    C++

    virtual IOByteCount getActualTransfer ( void );

  • the IOMemoryDescriptor used in this transaction.

    Declaration

    C++

    virtual IOMemoryDescriptor* getBuffer ( void );

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

    Declaration

    C++

    virtual bool getCommandInUse( void );

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

    Declaration

    C++

    virtual UInt8 getCylHi ( void );

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

    Declaration

    C++

    virtual UInt8 getCylLo ( void );

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

    Declaration

    C++

    virtual UInt8 getDevice_Head ( void );

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

    Declaration

    C++

    virtual UInt8 getEndErrorReg( void );

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

    Declaration

    C++

    virtual UInt8 getEndStatusReg ( void);

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

    Declaration

    C++

    virtual UInt8 getErrorReg ( void );

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

    Declaration

    C++

    virtual IOReturn getResult ( void);

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

    Declaration

    C++

    virtual UInt8 getSectorCount ( void );

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

    Declaration

    C++

    virtual UInt8 getSectorNumber ( void );

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

    Declaration

    C++

    virtual UInt8 getStatus ( void );

  • set the IIOMemoryDescriptor for this transaction.

    Declaration

    C++

    virtual void setBuffer ( IOMemoryDescriptor *inDesc);

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

    Declaration

    C++

    virtual void setByteCount ( IOByteCount numBytes);

  • set the function pointer to call when this command completes.

    Declaration

    C++

    virtual void setCallbackPtr ( IOATACompletionFunction *inCompletion);

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

    Declaration

    C++

    virtual void setCommand ( UInt8 in);

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

    Declaration

    C++

    virtual void setCylHi( UInt8 in);

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

    Declaration

    C++

    virtual void setCylLo ( UInt8 in);

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

    Declaration

    C++

    virtual void setDevice_Head( UInt8 in);

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

    Declaration

    C++

    virtual void setFeatures( UInt8 in);

  • set the flags for this command, as defined in IOATATypes.

    Declaration

    C++

    virtual void setFlags( UInt32 inFlags);

  • 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

    Declaration

    C++

    virtual IOReturn setLBA28( UInt32 lba, ataUnitID inUnit);

  • command opcode as defined in IOATATypes.

    Declaration

    C++

    virtual void setOpcode( ataOpcode inCode);

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

    Declaration

    C++

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

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

    Declaration

    C++

    virtual void setPosition ( IOByteCount fromPosition);

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

    Declaration

    C++

    virtual void setRegMask( ataRegMask mask);

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

    Declaration

    C++

    virtual void setSectorCount( UInt8 in);

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

    Declaration

    C++

    virtual void setSectorNumber( UInt8 in);

  • 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.

    Declaration

    C++

    virtual void setTimeoutMS( UInt32 inMs);

  • 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.

    Declaration

    C++

    virtual void setTransferChunkSize( IOByteCount chunk = kATADefaultSectorSize);

  • set the unit number for this command.

    Declaration

    C++

    virtual void setUnit( ataUnitID inUnit);

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

    Declaration

    C++

    virtual void zeroCommand( void);

Data Types

  • Declaration

    C++

    struct ExpansionData { IOExtendedLBA *extLBA; };

    Discussion

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

Instance Variables

  • Reserved for future use. (Internal use only)

    Declaration

    C++

    ExpansionData *fExpansionData;

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

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

    Declaration

    C++

    void* refCon2;

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

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

    Declaration

    C++

    void* refCon;

  • Reserved for future use. (Internal use only)

    Declaration

    C++

    ExpansionData *fExpansionData;