ATASMARTLib.h

Includes:
<IOKit/IOReturn.h>
<IOKit/IOTypes.h>
<CoreFoundation/CFPlugIn.h>
<CoreFoundation/CFPlugInCOM.h>
<IOKit/IOCFPlugIn.h>
<IOKit/storage/ata/IOATAStorageDefines.h>

Overview

Use the links in the table of contents to the left to access the documentation.



Typedefs

GetATAIdentifyData

Reads the 512-byte data provided by the drive in response to the ATA IDENTIFY DEVICE command.


GetATAIdentifyData


Reads the 512-byte data provided by the drive in response to the ATA IDENTIFY DEVICE command.

typedef struct IOATASMARTInterface {  
    IUNKNOWN_C_GUTS;  
    UInt16 version; 
    UInt16 revision;  
    /*
         * MANDATORY API support. If the device claims SMART feature set compliance, it
         * must implement the following functions.
        */  
    IOReturn ( *SMARTEnableDisableOperations ) (
        void * interface, 
        Boolean enable );    
    IOReturn ( *SMARTEnableDisableAutosave ) (
        void * interface, 
        Boolean enable );    
    IOReturn ( *SMARTReturnStatus ) (
        void * interface, 
        Boolean * exceededCondition );   
    /*
         * OPTIONAL API support. If the device claims SMART feature set compliance, it
         * may implement one or more of the following functions. Please consult the
         * technical manual for the device to see what functions are supported.
        */  
    IOReturn ( *SMARTExecuteOffLineImmediate ) (
        void * interface, 
        Boolean extendedTest );    
    IOReturn ( *SMARTReadData ) (
        void * interface,
        ATASMARTData * data );    
    IOReturn ( *SMARTValidateReadData ) (
        void * interface, 
        const ATASMARTData * data );     
    IOReturn ( *SMARTReadDataThresholds ) (
        void * interface, 
        ATASMARTDataThresholds * dataThresholds );    
    IOReturn ( *SMARTReadLogDirectory ) (
        void * interface, 
        ATASMARTLogDirectory * logData );    
    IOReturn ( *SMARTReadLogAtAddress ) (
        void * interface, 
        UInt32 logOffset, 
        void * buffer, 
        UInt32 size );    
    IOReturn ( *SMARTWriteLogAtAddress ) (
        void * interface, 
        UInt32 logOffset, 
        const void * buffer, 
        UInt32 size );    
    IOReturn ( *GetATAIdentifyData ) (
        void * interface, 
        void * buffer, 
        UInt32 inSize, 
        UInt32 * outSize );  
} IOATASMARTInterface;  
Parameters
enable

Passing true will ENABLE SMART operations, false will DISABLE SMART operations.

enable

Passing true will ENABLE SMART Autosave, false will DISABLE SMART Autosave.

if

exceededCondition is non-zero the device threshold exceeded condition.

passing

true will collect "off-line" extended test, false short test.

interface

A valid IOATASMARTInterface**.

buffer

A valid buffer.

inSize

The number of bytes to place in the buffer.

outSize

The number of bytes placed in the buffer. Can be NULL if the information is not required by the caller.

Return Value

An IOReturn result code. If inSize is greater than 512 or less than 1, kIOReturnBadArgument is returned.

Discussion

Reads the 512-byte data provided by the drive in response to the ATA IDENTIFY DEVICE command. See section 8.15 of ATA/ATAPI-6. The data placed in buffer is guaranteed to be in native endian form on return. (i.e. it will be byte swapped on big endian platforms, so the caller need not do anything)

Macro Definitions

kIOATASMARTInterfaceID
kIOATASMARTLibFactoryID
kIOATASMARTUserClientTypeID
kIOPropertySMARTCapableKey

kIOATASMARTInterfaceID


#define kIOATASMARTInterfaceID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x08, 0xAB, 0xE2, 0x1C, 0x20, 0xD4, 0x11, 0xD6, \ 
    0x8D, 0xF6, 0x00, 0x03, 0x93, 0x5A, 0x76, 0xB2) 
Discussion

InterfaceID for IOATASMARTInterface.


kIOATASMARTLibFactoryID


#define kIOATASMARTLibFactoryID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x5E, 0x65, 0x9F, 0x92, 0x20, 0xD3, 0x11, 0xD6, \ 
    0xBD, 0xB5, 0x00, 0x03, 0x93, 0x5A, 0x76, 0xB2) 
Discussion

UUID for the IOATASMARTInterface Factory.


kIOATASMARTUserClientTypeID


#define kIOATASMARTUserClientTypeID CFUUIDGetConstantUUIDWithBytes(NULL, \ 
    0x24, 0x51, 0x4B, 0x7A, 0x28, 0x04, 0x11, 0xD6, \ 
    0x8A, 0x02, 0x00, 0x30, 0x65, 0x70, 0x48, 0x66) 
Discussion

Factory ID for creating an ATA SMART user client.


kIOPropertySMARTCapableKey


#define kIOPropertySMARTCapableKey "SMART Capable" 
Discussion

Property to search for in IORegistry to find SMART capable devices without hardcoding the search to a particular device class.

 

Did this document help you? Yes It's good, but... Not helpful...

 

Last Updated: 2009-10-15