smartmontools SVN Rev 3317
Utility to control and monitor storage systems with "S.M.A.R.T."
os_os2.h
Go to the documentation of this file.
00001 /*
00002  * os_os2.c
00003  *
00004  * Home page of code is: http://smartmontools.sourceforge.net
00005  *
00006  * Copyright (C) 2004-8 Yuri Dario <smartmontools-support@lists.sourceforge.net>
00007  *
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2, or (at your option)
00011  * any later version.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * (for example COPYING); if not, write to the Free Software Foundation,
00015  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef OS_OS2_H_
00019 #define OS_OS2_H_
00020 
00021 #define OS_XXXX_H_CVSID "$Id: os_os2.h 3728 2012-12-13 17:57:50Z chrfranke $\n"
00022 
00023 // Additional material should start here.  Note: to keep the '-V' CVS
00024 // reporting option working as intended, you should only #include
00025 // system include files <something.h>.  Local #include files
00026 // <"something.h"> should be #included in os_generic.c
00027 
00028 #define INCL_DOS
00029 #include <os2.h>
00030 
00031 #include "os_os2\hdreg.h"
00032 #include "os_linux.h"
00033 
00034 #pragma pack(1)
00035 
00036 #define DSKSP_CAT_SMART             0x80  /* SMART IOCTL category */
00037 #define DSKSP_SMART_ONOFF           0x20  /* turn SMART on or off */
00038 #define DSKSP_SMART_AUTOSAVE_ONOFF  0x21  /* turn SMART autosave on or off */
00039 #define DSKSP_SMART_SAVE            0x22  /* force save of SMART data */
00040 #define DSKSP_SMART_GETSTATUS       0x23  /* get SMART status (pass/fail) */
00041 #define DSKSP_SMART_GET_ATTRIBUTES  0x24  /* get SMART attributes table */
00042 #define DSKSP_SMART_GET_THRESHOLDS  0x25  /* get SMART thresholds table */
00043 #define DSKSP_SMART_READ_LOG        0x26  
00044 #define DSKSP_SMART_WRITE_LOG       0x27  
00045 #define DSKSP_SMART_READ_LOG_EXT    0x28  
00046 #define DSKSP_SMART_WRITE_LOG_EXT   0x29  
00047 #define DSKSP_SMART_EOLI            0x30  /* EXECUTE OFF-LINE IMMEDIATE */
00048 
00049 #define SMART_CMD_ON      1   /* on  value for related SMART functions */
00050 #define SMART_CMD_OFF     0   /* off value for related SMART functions */
00051 
00052 #define DSKSP_CAT_GENERIC           0x90  /* generic IOCTL category */
00053 #define DSKSP_GET_INQUIRY_DATA      0x42  /* get ATA/ATAPI inquiry data */
00054 
00055 typedef struct _DSKSP_CommandParameters {
00056   BYTE byPhysicalUnit;             /* physical unit number 0-n */
00057                                    /* 0 = 1st disk, 1 = 2nd disk, ...*/
00058                                    /* 0x80 = Pri/Mas, 0x81=Pri/Sla, 0x82=Sec/Mas,*/
00059 } DSKSP_CommandParameters, *PDSKSP_CommandParameters;
00060 
00061 struct SMART_ParamExt {
00062   UCHAR      byPhysicalUnit;  // 0=Pri/Mas, 1=Pri/Sla, 2=Sec/Mas, etc.
00063   ULONG      LogAddress;      // valid values 0-255. See ATA/ATPI standard
00064                               // for details
00065   ULONG      SectorCount;     // valid values 0-255  See ATA/ATPI standard
00066                               // for details
00067   ULONG      reserved;        // reserved. must be set to 0
00068 };
00069 
00070 #endif /* OS_GENERIC_H_ */