Mac Developer Library

Developer

IOATADevConfig Class Reference

Options
Deployment Target:

On This Page
Language:

IOATADevConfig

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.

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Kernel;

Availability


Available in OS X v10.0 and later.
  • static creator function.

    Declaration

    C++

    static IOATADevConfig* atadevconfig( void);

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

    Declaration

    C++

    virtual UInt8 bitSigToNumeric( UInt16binary);

    Parameters

    binary

    the bit significant field.

    Return Value

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

  • Declaration

    C++

    UInt16 getDMACycleTime( void );

    Return Value

    Reported multiword DMA cycle time in nanoseconds.

  • Declaration

    C++

    UInt8 getDMAMode( void );

    Return Value

    bit-significant map of DMA mode

  • Declaration

    C++

    atapiConfig getPacketConfig( void );

    Return Value

    atapiConfig as defined in IOATATypes.h

  • Declaration

    C++

    UInt16 getPIOCycleTime( void );

    Return Value

    reported PIO CycleTime in nanoseconds.

  • Declaration

    C++

    UInt8 getPIOMode( void );

    Return Value

    bit-significant map of PIO mode

  • Declaration

    C++

    UInt8 getUltraMode( void );

    Return Value

    bit-significant map of Ultra mode

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

    Declaration

    C++

    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.

  • Declaration

    C++

    void setDMACycleTime( UInt16inNS );

    Parameters

    inNS

    reported multiword DMA Cycle time in nanoseconds.

  • Declaration

    C++

    void setDMAMode( UInt8inModeBitMap );

    Parameters

    inModeBitMap

    bit-significant map of DMA mode

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

    Declaration

    C++

    void setPacketConfig ( atapiConfigpacketConfig);

    Parameters

    packetConfig
  • Declaration

    C++

    void setPIOCycleTime( UInt16inNS );

    Parameters

    inNS

    PIO cycle time in nanoseconds.

  • Declaration

    C++

    void setPIOMode( UInt8inModeBitMap);

    Parameters

    inModeBitMap

    bit-significant map of PIO mode

  • Declaration

    C++

    void setUltraMode( UInt8inModeBitMap );

    Parameters

    inModeBitMap

    bit-significant map of Ultra mode

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;