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

 


IOATADevConfig

Inherits from:
Declared In:

Overview

Used for configuring and communicating the desired transfer modes of a device.

Discussion

A disk driver would typically use this object in conjunction with the 512-bytes of identification data from the drive and the IOATABusInfo object for the bus it is connected to. This object will determine the best matching transfer speeds available. The device driver will then send a series of Set Features commands to configure the drive and this object to the bus through the IOATADevice nub in order to configure the optimum transfer mode. The driver for the disk drive may choose to populate this object with whatever transfer mode desired, in the event that a different mode is required. Usually use the initWithBestSelection to make a best mode match. The Mode accessors use bit significance to indicate a selected mode or supported modes(s) ie, 00000001b indicates Mode-0, 00000010b indicates mode 1, etc. Selected mode is indicated by a single set bit. No bit set indicates no mode in that class is selected. In other words, a bus will support multiple possible modes, but will only have one mode selected at that time.



Functions

atadevconfig

Static creator function.

bitSigToNumeric

Converts a bit-significant field to a numerical value.

getDMACycleTime
getDMAMode
getPacketConfig
getPIOCycleTime
getPIOMode
getUltraMode
initWithBestSelection

Handy initializer.

setDMACycleTime
setDMAMode
setPacketConfig

Tells the bus controller whether to wait for packet acceptance or set pending interrupt.

setPIOCycleTime
setPIOMode
setUltraMode

atadevconfig


Static creator function.

public

static IOATADevConfig* atadevconfig( void);


bitSigToNumeric


Converts a bit-significant field to a numerical value.

public

virtual UInt8 bitSigToNumeric( UInt16 binary);
Parameters
binary

the bit significant field.

Return Value

Returns the numerical value of the highest bit set in the field.

Discussion

Note that a bit field of 0x00 has no defined result.


getDMACycleTime


public

UInt16 getDMACycleTime( void );
Return Value

Returns reported multiword DMA cycle time in nanoseconds.


getDMAMode


public

UInt8 getDMAMode( void );
Return Value

Returns bit-significant map of DMA mode.


getPacketConfig


public

atapiConfig getPacketConfig( void );
Return Value

Returns atapiConfig as defined in IOATATypes.h


getPIOCycleTime


public

UInt16 getPIOCycleTime( void );
Return Value

Returns reported PIO CycleTime in nanoseconds.


getPIOMode


public

UInt8 getPIOMode( void );
Return Value

Returns bit-significant map of PIO mode.


getUltraMode


public

UInt8 getUltraMode( void );
Return Value

Returns bit-significant map of Ultra mode.


initWithBestSelection


Handy initializer.

public

IOReturn initWithBestSelection( const UInt16* identifyData, IOATABusInfo* busInfo);
Parameters
identifyData

512 Bytes of data obtained from the device via IDENTIFY DEVICE or IDENTIFY PACKET DEVICE command.

busInfo

Pointer to an IOATAbusInfo object obtained from a previous atanub->provideBusInfo() call.

Return Value

Returns kIOSuccess (0) when a matching transfer mode is available between the device and controller.

Discussion

Pass the 512-byte result of the Identify Device or Identify Packet Device in endian-order for your platform (byte-swapped on PPC) and the IOATABusInfo object for the bus. The object will initialize all fields and select the best transfer modes that match on bus and device. If the return value was 0 (success or noErr), then a matching mode is supported. Examine the PIO and UDMA/DMA fields and to generate the apropriate SET FEATURES parameters for your drive and send this initialized object to the IOATAController when requesting a speed configuration. Failure of this method means no supported transfer modes matched between bus and device info.


setDMACycleTime


public

void setDMACycleTime( UInt16 inNS );
Parameters
inNS

Reported multiword DMA Cycle time in nanoseconds.


setDMAMode


public

void setDMAMode( UInt8 inModeBitMap );
Parameters
inModeBitMap

Bit-significant map of DMA mode.


setPacketConfig


Tells the bus controller whether to wait for packet acceptance or set pending interrupt.

public

void setPacketConfig ( atapiConfig packetConfig);
Parameters
packetConfig
Discussion

For ATAPI devices, if the device asserts interrupt after the Packet Command when it is ready to accept the packet, set this value to true (mostly older devices). If the device accepts the packet only by asserting DRQ bit in status, then set this value false.


setPIOCycleTime


public

void setPIOCycleTime( UInt16 inNS );
Parameters
inNS

PIO cycle time in nanoseconds.


setPIOMode


public

void setPIOMode( UInt8 inModeBitMap);
Parameters
inModeBitMap

Bit-significant map of PIO mode.


setUltraMode


public

void setUltraMode( UInt8 inModeBitMap );
Parameters
inModeBitMap

Bit-significant map of Ultra mode.

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