ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference

 


IOATADevice

Inherits from:
Declared In:

Overview

Implements a relay to an ATA Bus where a drive is attached.

Discussion

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 subclasses should be implemented for particular types of IOATAController. In this manner, controller-specifc IOATACommands may be paired with the proper type of controller.



Functions

allocCommand

Creates IOATACommands.

executeCommand

Submits IO requests

freeCommand

Releases a command object that is no longer needed.

getDeviceType

Finds out what kind of device this nub is (ATA or ATAPI).

getUnitID

Determines whether this device is number 0 or 1 (ie, master/slave).

matchLocation

Matching method for IOBSDInit and so on.

matchPropertyTable(OSDictionary *)

Matching method for IOBSDInit and so on.

matchPropertyTable(OSDictionary *, SInt32 *)

Matching method for IOBSDInit and so on.

notifyEvent

Sends a message to client drivers.

provideBusInfo

Finds out the bus capability.

provideConfig

Finds out what speed the bus has configured for this unit.

selectConfig

Tells the bus what speed to use for your device.


allocCommand


Creates IOATACommands.

public

virtual IOATACommand* allocCommand( void );
Return Value

Returns null if allocation failed. Retain count is one.

Discussion

Device drivers should allocate command objects only through this method.


executeCommand


Submits IO requests

public

virtual IOReturn executeCommand( IOATACommand *command);
Parameters
command

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

Return Value

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


freeCommand


Releases a command object that is no longer needed.

public

virtual void freeCommand( IOATACommand *inCommand);
Parameters
inCommand

The command to be released.

Discussion

Do not free an object in use and do not release the object anymore times than you have retained it.


getDeviceType


Finds out what kind of device this nub is (ATA or ATAPI).

public

virtual ataDeviceType getDeviceType( void );
Return Value

Returns ataDeviceType as defined in IOATATypes.h


getUnitID


Determines whether this device is number 0 or 1 (ie, master/slave).

public

virtual ataUnitID getUnitID( void );
Return Value

Returns ataUnitID - 0 or 1.


matchLocation


Matching method for IOBSDInit and so on.

public

virtual IOService* matchLocation( IOService *client);


matchPropertyTable(OSDictionary *)


Matching method for IOBSDInit and so on.

public

virtual bool matchPropertyTable( OSDictionary *table);


matchPropertyTable(OSDictionary *, SInt32 *)


Matching method for IOBSDInit and so on.

public

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


notifyEvent


Sends a message to client drivers.

public

virtual void notifyEvent( UInt32 event );
Discussion

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


provideBusInfo


Finds out the bus capability.

public

virtual IOReturn provideBusInfo( IOATABusInfo *getInfo);
Parameters
getInfo

A pointer to a valid IOATABusInfo object.

Return Value

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

Discussion

This method finds out the bus capability so the client can choose the features to set and commands to run.


provideConfig


Finds out what speed the bus has configured for this unit.

public

virtual IOReturn provideConfig( IOATADevConfig *configRequest);
Parameters
configRequest

Pointer to a valid IOATADevConfig object.

Return Value

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


selectConfig


Tells the bus what speed to use for your device.

public

virtual IOReturn selectConfig( IOATADevConfig *configRequest);
Parameters
configRequest

Pointer to a valid and initialized IOATADevConfig object.

Return Value

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

Structs and Unions


ExpansionData


protected

struct ExpansionData { };
Discussion

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

Member Data


reserved


protected

ExpansionData *reserved;
Discussion

Reserved for future use. (Internal use only)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.

 

Last Updated: 2008-12-19