Mac Developer Library

Developer

IOATADevice Class Reference

Options
Deployment Target:

On This Page
Language:

IOATADevice

Inheritance


  • IOATADevice

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Kernel;

Availability


Available in OS X v10.0 and later.

This object implements a relay to an ATA Bus where a drive is attached.

IOATADevice is the superclass which represents a particular device attached to a particular IOATAController (bus). IOATADevice is the provider for ATA mass-storage device drivers.IOATADevice is the factory for all IOATACommand objects and is responsible for creating and freeing IOATACommands. IOATAControllers will create an instance of IOATADevice for each device physically connected to the ata bus. IOATADevice is virtual and specific subclass should be implemented for particular types of IOATAController. In this manner, controller-specifc IOATACommands may be paired with the proper type of controller.

  • create IOATACommands. Device drivers should allocate command objects only through this method.

    Declaration

    C++

    virtual IOATACommand* allocCommand( void );

    Return Value

    null if allocation failed. Retain count is one.

  • Submit IO requests

    Declaration

    C++

    virtual IOReturn executeCommand( IOATACommand *command);

    Parameters

    command

    pointer to a valid IOATACommand with the command to be executed.

    Return Value

    kIOSuccess (0) if the command was successfully queued in the controller.

  • release a command object that is no longer needed. Do not free an object in use and do not release the object anymore times than you have retained it.

    Declaration

    C++

    virtual void freeCommand( IOATACommand *inCommand);

    Parameters

    inCommand

    the command to be released.

  • Find out what kind of device this nub is (ata or atapi)

    Declaration

    C++

    virtual ataDeviceType getDeviceType( void );

    Return Value

    ataDeviceType as defined in IOATATypes.h

  • Determine whether this device is number 0 or 1 (ie, master/slave)

    Declaration

    C++

    virtual ataUnitID getUnitID( void );

    Return Value

    ataUnitID - 0 or 1.

  • matching stuff for IOBSDInit and so on.

    Declaration

    C++

    virtual IOService* matchLocation( IOService *client);

  • matching stuff for IOBSDInit and so on.

    Declaration

    C++

    virtual bool matchPropertyTable( OSDictionary *table);

  • matching stuff for IOBSDInit and so on.

    Declaration

    C++

    virtual bool matchPropertyTable( OSDictionary *table, SInt32 *score);

  • called by controllers when they need to send a message to client (disk) drivers.

    Declaration

    C++

    virtual void notifyEvent( UInt32 event );

  • Find out the bus capability so the client can choose the features to set and commands to run.

    Declaration

    C++

    virtual IOReturn provideBusInfo( IOATABusInfo *getInfo);

    Parameters

    getInfo

    a pointer to a valid IOATABusInfo object.

    Return Value

    kIOSuccess (0) and the getInfo object will be filled out by the bus controller with information about the bus.

  • Find out what speed the bus has configured for this unit.

    Declaration

    C++

    virtual IOReturn provideConfig( IOATADevConfig *configRequest);

    Parameters

    configRequest

    pointer to a valid IOATADevConfig object.

    Return Value

    kIOSuccess (0) on successful completion and configRequest will contain the configuration information.

  • Tell the bus what speed to use for your device.

    Declaration

    C++

    virtual IOReturn selectConfig( IOATADevConfig *configRequest);

    Parameters

    configRequest

    pointer to a valid and initialized IOATADevConfig object.

    Return Value

    kIOSuccess (0) if the configuration was succesfully selected.

    Discussion

    This should only be called once during a disk drivers start method before registering its availability, and must be called prior to issuing any data IO transactions.

Data Types

  • Declaration

    C++

    struct ExpansionData { };

    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 *reserved;