IOATADevConfig

Inherits from
OSObject
Availability
Available in OS X v10.0 and later.
Declared in
IOATADevConfig.h

Overview

used for configuring and communicating the desired transfer modes of a device. 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. ie, a bus will support multiple possible modes, but will only have one mode selected at that time.

Tasks

Miscellaneous

Instance Methods

atadevconfig

static creator function.

static IOATADevConfig* atadevconfig( void);

bitSigToNumeric

converts a bit-significant field to a numerical value. Note that a bit field of 0x00 has no defined result.

virtual UInt8 bitSigToNumeric( UInt16 binary);
Parameters
binary

the bit significant field.

Return Value

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

getDMACycleTime

UInt16 getDMACycleTime( void );
Return Value

Reported multiword DMA cycle time in nanoseconds.

getDMAMode

UInt8 getDMAMode( void );
Return Value

bit-significant map of DMA mode

getPacketConfig

atapiConfig getPacketConfig( void );
Return Value

atapiConfig as defined in IOATATypes.h

getPIOCycleTime

UInt16 getPIOCycleTime( void );
Return Value

reported PIO CycleTime in nanoseconds.

getPIOMode

UInt8 getPIOMode( void );
Return Value

bit-significant map of PIO mode

getUltraMode

UInt8 getUltraMode( void );
Return Value

bit-significant map of Ultra mode

initWithBestSelection

Handy initializer: 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 initialised object to the IOATAController when requesting a speed configuration. failure means no supported transfer modes matched between bus and device info.

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

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

setDMACycleTime

void setDMACycleTime( UInt16 inNS );
Parameters
inNS

reported multiword DMA Cycle time in nanoseconds.

setDMAMode

void setDMAMode( UInt8 inModeBitMap );
Parameters
inModeBitMap

bit-significant map of DMA mode

setPacketConfig

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. Tells the bus controller whether to wait for packet acceptance or set pending interrupt.

void setPacketConfig ( atapiConfig packetConfig);
Parameters
packetConfig

setPIOCycleTime

void setPIOCycleTime( UInt16 inNS );
Parameters
inNS

PIO cycle time in nanoseconds.

setPIOMode

void setPIOMode( UInt8 inModeBitMap);
Parameters
inModeBitMap

bit-significant map of PIO mode

setUltraMode

void setUltraMode( UInt8 inModeBitMap );
Parameters
inModeBitMap

bit-significant map of Ultra mode

ExpansionData

struct ExpansionData {
};
Discussion

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

Instance Variables

reserved

ExpansionData *reserved;

Reserved for future use. (Internal use only)