Mac Developer Library

Developer

IOATABusCommand Class Reference

Options
Deployment Target:

On This Page

IOATABusCommand

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

    static IOATABusCommand* allocateCmd( void);

  • call the completion callback function

    Declaration

    virtual void executeCallback( void);

  • get pointer to the memory descriptor for this transaction

    Declaration

    virtual IOMemoryDescriptor* getBuffer ( void);

  • return the byte count for this transaction to transfer.

    Declaration

    virtual IOByteCount getByteCount ( void);

  • return the callback pointer

    Declaration

    virtual IOATACompletionFunction* getCallbackPtr ( void );

  • return the flags for this command.

    Declaration

    virtual ataFlags getFlags ( void );

  • return the command opcode

    Declaration

    virtual ataOpcode getOpcode( void );

  • return pointer to the array of packet data.

    Declaration

    virtual UInt16* getPacketData( void);

  • return the size of atapi packet if any.

    Declaration

    virtual UInt16 getPacketSize( void);

  • the position within the memory buffer for the transaction.

    Declaration

    virtual IOByteCount getPosition ( void);

  • get the register mask for desired regs

    Declaration

    virtual ataRegMask getRegMask( void );

  • return the taskfile structure pointer.

    Declaration

    virtual ataTaskFile* getTaskFilePtr( void);

  • return the timeout value for this command

    Declaration

    virtual UInt32 getTimeoutMS ( void );

  • number of bytes between interrupts.

    Declaration

    virtual IOByteCount getTransferChunkSize( void);

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

    Declaration

    virtual ataUnitID getUnit( void );

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

    Declaration

    virtual bool init();

  • set the byte count of bytes actually transferred.

    Declaration

    virtual void setActualTransfer ( IOByteCount bytesTransferred );

  • mark the command as being in progress.

    Declaration

    virtual void setCommandInUse( bool inUse = true);

  • set the result code

    Declaration

    virtual void setResult( IOReturn );

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

    Declaration

    virtual void zeroCommand( void);

Data Types

  • Declaration

    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

    IOSyncer* syncer;

  • state-semaphore for use by IOATAController

    Declaration

    UInt32 state;

  • Reserved for future use. (Internal use only)

    Declaration

    ExpansionData *reserved;

  • queue header for use by IOATAController.

    Declaration

    queue_chain_t queueChain;