#ifndef __ATA_SMART_CLIENT_H__
#define __ATA_SMART_CLIENT_H__
#include <IOKit/IOCFPlugIn.h>
#ifdef __cplusplus
extern "C" {
#endif
extern void * ATASMARTLibFactory ( CFAllocatorRef allocator, CFUUIDRef typeID );
#ifdef __cplusplus
}
#endif
class ATASMARTClient
{
public:
ATASMARTClient ( );
typedef struct InterfaceMap
{
IUnknownVTbl * pseudoVTable;
ATASMARTClient * obj;
} InterfaceMap;
private:
ATASMARTClient ( ATASMARTClient& src );
void operator = ( ATASMARTClient& src );
protected:
static inline ATASMARTClient * getThis ( void * self )
{ return ( ATASMARTClient * ) ( ( InterfaceMap * ) self )->obj; };
static UInt32 sFactoryRefCount;
static void sFactoryAddRef ( void );
static void sFactoryRelease ( void );
static HRESULT sQueryInterface ( void * self, REFIID iid, void ** ppv );
static UInt32 sAddRef ( void * self );
static UInt32 sRelease ( void * self );
static IOReturn sProbe ( void * self, CFDictionaryRef propertyTable, io_service_t service, SInt32 * order );
static IOReturn sStart ( void * self, CFDictionaryRef propertyTable, io_service_t service );
static IOReturn sStop ( void * self );
virtual ~ATASMARTClient ( void );
virtual IOReturn Probe ( CFDictionaryRef propertyTable, io_service_t service, SInt32 * order );
virtual IOReturn Start ( CFDictionaryRef propertyTable, io_service_t service );
virtual IOReturn Stop ( void );
static IOReturn sSMARTEnableDisableOperations ( void * interface, Boolean enable );
static IOReturn sSMARTEnableDisableAutosave ( void * interface, Boolean enable );
static IOReturn sSMARTReturnStatus ( void * interface, Boolean * exceededCondition );
static IOReturn sSMARTExecuteOffLineImmediate ( void * interface, Boolean extendedTest );
static IOReturn sSMARTReadData ( void * interface, ATASMARTData * data );
static IOReturn sSMARTValidateReadData ( void * interface, const ATASMARTData * data );
static IOReturn sSMARTReadDataThresholds ( void * interface, ATASMARTDataThresholds * data );
static IOReturn sSMARTReadLogDirectory ( void * interface, ATASMARTLogDirectory * logData );
static IOReturn sSMARTReadLogAtAddress ( void * interface, UInt32 address, void * buffer, UInt32 size );
static IOReturn sSMARTWriteLogAtAddress ( void * interface, UInt32 address, const void * buffer, UInt32 size );
virtual IOReturn SMARTEnableDisableOperations ( Boolean enable );
virtual IOReturn SMARTEnableDisableAutosave ( Boolean enable );
virtual IOReturn SMARTReturnStatus ( Boolean * exceededCondition );
virtual IOReturn SMARTExecuteOffLineImmediate ( Boolean extendedTest );
virtual IOReturn SMARTReadData ( ATASMARTData * data );
virtual IOReturn SMARTReadDataThresholds ( ATASMARTDataThresholds * data );
virtual IOReturn SMARTReadLogDirectory ( ATASMARTLogDirectory * logData );
virtual IOReturn SMARTReadLogAtAddress ( UInt32 address, void * buffer, UInt32 size );
virtual IOReturn SMARTWriteLogAtAddress ( UInt32 address, const void * buffer, UInt32 size );
static IOCFPlugInInterface sIOCFPlugInInterface;
static IOATASMARTInterface sATASMARTInterface;
UInt32 fRefCount;
InterfaceMap fCFPlugInInterfaceMap;
InterfaceMap fATASMARTInterfaceMap;
io_service_t fService;
io_connect_t fConnection;
public:
static IOCFPlugInInterface ** alloc ( void );
virtual HRESULT QueryInterface ( REFIID iid, void ** ppv );
virtual UInt32 AddRef ( void );
virtual UInt32 Release ( void );
};
#endif