Mac Developer Library

Developer

IOATABusCommand Class Reference

Options
Deployment Target:

On This Page
Language:

IOATABusCommand

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Kernel;

Availability


Available in OS X v10.0 and later.

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.

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

    Declaration

    C++

    static IOATABusCommand* allocateCmd( void);

  • call the completion callback function

    Declaration

    C++

    virtual void executeCallback( void);

  • get pointer to the memory descriptor for this transaction

    Declaration

    C++

    virtual IOMemoryDescriptor* getBuffer ( void);

  • return the byte count for this transaction to transfer.

    Declaration

    C++

    virtual IOByteCount getByteCount ( void);

  • return the callback pointer

    Declaration

    C++

    virtual IOATACompletionFunction* getCallbackPtr ( void );

  • return the flags for this command.

    Declaration

    C++

    virtual ataFlags getFlags ( void );

  • return the command opcode

    Declaration

    C++

    virtual ataOpcode getOpcode( void );

  • return pointer to the array of packet data.

    Declaration

    C++

    virtual UInt16* getPacketData( void);

  • return the size of atapi packet if any.

    Declaration

    C++

    virtual UInt16 getPacketSize( void);

  • the position within the memory buffer for the transaction.

    Declaration

    C++

    virtual IOByteCount getPosition ( void);

  • get the register mask for desired regs

    Declaration

    C++

    virtual ataRegMask getRegMask( void );

  • return the taskfile structure pointer.

    Declaration

    C++

    virtual ataTaskFile* getTaskFilePtr( void);

  • return the timeout value for this command

    Declaration

    C++

    virtual UInt32 getTimeoutMS ( void );

  • number of bytes between interrupts.

    Declaration

    C++

    virtual IOByteCount getTransferChunkSize( void);

  • return the unit id (0 master, 1 slave)

    Declaration

    C++

    virtual ataUnitID getUnit( void );

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

    Declaration

    C++

    virtual bool init();

  • set the byte count of bytes actually transferred.

    Declaration

    C++

    virtual void setActualTransfer ( IOByteCount bytesTransferred );

  • mark the command as being in progress.

    Declaration

    C++

    virtual void setCommandInUse( bool inUse = true);

  • set the result code

    Declaration

    C++

    virtual void setResult( IOReturn );

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

    Declaration

    C++

    virtual void zeroCommand( void);

Data Types

  • Declaration

    C++

    struct ExpansionData { };

    Discussion

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

Instance Variables

  • IOSyncer for use by IOATAController

    Declaration

    C++

    IOSyncer* syncer;

  • state-semaphore for use by IOATAController

    Declaration

    C++

    UInt32 state;

  • Reserved for future use. (Internal use only)

    Declaration

    C++

    ExpansionData *reserved;

  • queue header for use by IOATAController.

    Declaration

    C++

    queue_chain_t queueChain;