From 2e45594f9a71ed5bf47685be43a9cf44b04d96bb Mon Sep 17 00:00:00 2001 From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Mon, 8 Dec 2003 20:36:03 +0000 Subject: [PATCH] Included hdreg.h in os_linux.c, hence eliminating the 'hardwired' ioctl() request values. git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@1348 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- sm5/os_linux.c | 8 ++------ sm5/os_linux.cpp | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/sm5/os_linux.c b/sm5/os_linux.c index c40527809..58f481786 100644 --- a/sm5/os_linux.c +++ b/sm5/os_linux.c @@ -52,6 +52,7 @@ #include <dirent.h> #include <sys/stat.h> #include <glob.h> +#include <linux/hdreg.h> #include "atacmds.h" #include "config.h" @@ -60,7 +61,7 @@ #include "smartd.h" #include "utility.h" -const char *os_XXXX_c_cvsid="$Id: os_linux.c,v 1.33 2003/12/07 19:59:08 ballen4705 Exp $" \ +const char *os_XXXX_c_cvsid="$Id: os_linux.c,v 1.34 2003/12/08 20:36:03 ballen4705 Exp $" \ ATACMDS_H_CVSID CONFIG_H_CVSID OS_XXXX_H_CVSID SCSICMDS_H_CVSID SMARTD_H_CVSID UTILITY_H_CVSID; // to hold onto exit code for atexit routine @@ -277,10 +278,6 @@ int ata_command_interface(int device, smart_command_set command, int select, cha unsigned char buff[STRANGE_BUFFER_LENGTH]; int retval, copydata=0; - // The two linux IOCTL's that we use. These MUST be consistent with - // the same quantities in the kernel include file linux/hdreg.h - const int HDIO_DRIVE_TASK = 0x031e; - const int HDIO_DRIVE_CMD = 0x031f; const int HDIO_DRIVE_CMD_OFFSET = 4; // See struct hd_drive_cmd_hdr in hdreg.h @@ -414,7 +411,6 @@ int ata_command_interface(int device, smart_command_set command, int select, cha // command set, and return 'Command Aborted' to IDENTIFY DEVICE. if (command==IDENTIFY || command==PIDENTIFY){ unsigned char deviceid[512]; - const int HDIO_GET_IDENTITY=0x030d; // check the device identity, as seen when the system was booted // or the device was FIRST registered. This will not be current // if the user has subsequently changed some of the parameters. If diff --git a/sm5/os_linux.cpp b/sm5/os_linux.cpp index 7bfdcea6c..8ebf43788 100644 --- a/sm5/os_linux.cpp +++ b/sm5/os_linux.cpp @@ -52,6 +52,7 @@ #include <dirent.h> #include <sys/stat.h> #include <glob.h> +#include <linux/hdreg.h> #include "atacmds.h" #include "config.h" @@ -60,7 +61,7 @@ #include "smartd.h" #include "utility.h" -const char *os_XXXX_c_cvsid="$Id: os_linux.cpp,v 1.33 2003/12/07 19:59:08 ballen4705 Exp $" \ +const char *os_XXXX_c_cvsid="$Id: os_linux.cpp,v 1.34 2003/12/08 20:36:03 ballen4705 Exp $" \ ATACMDS_H_CVSID CONFIG_H_CVSID OS_XXXX_H_CVSID SCSICMDS_H_CVSID SMARTD_H_CVSID UTILITY_H_CVSID; // to hold onto exit code for atexit routine @@ -277,10 +278,6 @@ int ata_command_interface(int device, smart_command_set command, int select, cha unsigned char buff[STRANGE_BUFFER_LENGTH]; int retval, copydata=0; - // The two linux IOCTL's that we use. These MUST be consistent with - // the same quantities in the kernel include file linux/hdreg.h - const int HDIO_DRIVE_TASK = 0x031e; - const int HDIO_DRIVE_CMD = 0x031f; const int HDIO_DRIVE_CMD_OFFSET = 4; // See struct hd_drive_cmd_hdr in hdreg.h @@ -414,7 +411,6 @@ int ata_command_interface(int device, smart_command_set command, int select, cha // command set, and return 'Command Aborted' to IDENTIFY DEVICE. if (command==IDENTIFY || command==PIDENTIFY){ unsigned char deviceid[512]; - const int HDIO_GET_IDENTITY=0x030d; // check the device identity, as seen when the system was booted // or the device was FIRST registered. This will not be current // if the user has subsequently changed some of the parameters. If -- GitLab