Skip to content
Snippets Groups Projects
Commit 3bc7bc06 authored by ballen4705's avatar ballen4705
Browse files

Fixed errors that Bruno pointed out stopped the 2.2 kernel compilation

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@144 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 588c4598
No related branches found
No related tags found
No related merge requests found
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "atacmds.h" #include "atacmds.h"
const char *CVSid1="$Id: atacmds.c,v 1.28 2002/10/26 19:33:39 ballen4705 Exp $" CVSID1; const char *CVSid1="$Id: atacmds.c,v 1.29 2002/10/26 19:59:01 ballen4705 Exp $" CVSID1;
// These Drive Identity tables are taken from hdparm 5.2, and are also // These Drive Identity tables are taken from hdparm 5.2, and are also
// given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note // given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note
...@@ -199,17 +199,17 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){ ...@@ -199,17 +199,17 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
// describing which revision. Note that Revision 0 of ATA-3 does NOT // describing which revision. Note that Revision 0 of ATA-3 does NOT
// support SMART. For this one case we return -3 rather than +3 as // support SMART. For this one case we return -3 rather than +3 as
// the version number. See notes above. // the version number. See notes above.
int ataVersionInfo (const char** description, struct hd_driveid drive){ int ataVersionInfo (const char** description, struct hd_driveid drive, unsigned short *minor){
unsigned short major,minor; unsigned short major;
int i; int i;
// get major and minor ATA revision numbers // get major and minor ATA revision numbers
#ifdef __NEW_HD_DRIVE_ID #ifdef __NEW_HD_DRIVE_ID
major=drive.major_rev_num; major=drive.major_rev_num;
minor=drive.minor_rev_num; *minor=drive.minor_rev_num;
#else #else
major=drive.word80; major=drive.word80;
minor=drive.word81; *minor=drive.word81;
#endif #endif
// First check if device has ANY ATA version information in it // First check if device has ANY ATA version information in it
...@@ -219,10 +219,10 @@ int ataVersionInfo (const char** description, struct hd_driveid drive){ ...@@ -219,10 +219,10 @@ int ataVersionInfo (const char** description, struct hd_driveid drive){
} }
// The minor revision number has more information - try there first // The minor revision number has more information - try there first
if (minor && (minor<=MINOR_MAX)){ if (*minor && (*minor<=MINOR_MAX)){
int std = actual_ver[minor]; int std = actual_ver[*minor];
if (std) { if (std) {
*description=minor_str[minor]; *description=minor_str[*minor];
return std; return std;
} }
} }
...@@ -530,7 +530,7 @@ int ataSmartStatus2(int device){ ...@@ -530,7 +530,7 @@ int ataSmartStatus2(int device){
// Should be fixed by putting in a call to code // Should be fixed by putting in a call to code
// that compares smart data to thresholds. // that compares smart data to thresholds.
int ataSmartStatus2(int device){ int ataSmartStatus2(int device){
return ataSmartStatus(device) return ataSmartStatus(device);
} }
#endif #endif
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include <stdlib.h> #include <stdlib.h>
#include "atacmds.h" #include "atacmds.h"
const char *CVSid1="$Id: atacmds.cpp,v 1.28 2002/10/26 19:33:39 ballen4705 Exp $" CVSID1; const char *CVSid1="$Id: atacmds.cpp,v 1.29 2002/10/26 19:59:01 ballen4705 Exp $" CVSID1;
// These Drive Identity tables are taken from hdparm 5.2, and are also // These Drive Identity tables are taken from hdparm 5.2, and are also
// given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note // given in the ATA/ATAPI specs for the IDENTIFY DEVICE command. Note
...@@ -199,17 +199,17 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){ ...@@ -199,17 +199,17 @@ int ataReadHDIdentity (int device, struct hd_driveid *buf){
// describing which revision. Note that Revision 0 of ATA-3 does NOT // describing which revision. Note that Revision 0 of ATA-3 does NOT
// support SMART. For this one case we return -3 rather than +3 as // support SMART. For this one case we return -3 rather than +3 as
// the version number. See notes above. // the version number. See notes above.
int ataVersionInfo (const char** description, struct hd_driveid drive){ int ataVersionInfo (const char** description, struct hd_driveid drive, unsigned short *minor){
unsigned short major,minor; unsigned short major;
int i; int i;
// get major and minor ATA revision numbers // get major and minor ATA revision numbers
#ifdef __NEW_HD_DRIVE_ID #ifdef __NEW_HD_DRIVE_ID
major=drive.major_rev_num; major=drive.major_rev_num;
minor=drive.minor_rev_num; *minor=drive.minor_rev_num;
#else #else
major=drive.word80; major=drive.word80;
minor=drive.word81; *minor=drive.word81;
#endif #endif
// First check if device has ANY ATA version information in it // First check if device has ANY ATA version information in it
...@@ -219,10 +219,10 @@ int ataVersionInfo (const char** description, struct hd_driveid drive){ ...@@ -219,10 +219,10 @@ int ataVersionInfo (const char** description, struct hd_driveid drive){
} }
// The minor revision number has more information - try there first // The minor revision number has more information - try there first
if (minor && (minor<=MINOR_MAX)){ if (*minor && (*minor<=MINOR_MAX)){
int std = actual_ver[minor]; int std = actual_ver[*minor];
if (std) { if (std) {
*description=minor_str[minor]; *description=minor_str[*minor];
return std; return std;
} }
} }
...@@ -530,7 +530,7 @@ int ataSmartStatus2(int device){ ...@@ -530,7 +530,7 @@ int ataSmartStatus2(int device){
// Should be fixed by putting in a call to code // Should be fixed by putting in a call to code
// that compares smart data to thresholds. // that compares smart data to thresholds.
int ataSmartStatus2(int device){ int ataSmartStatus2(int device){
return ataSmartStatus(device) return ataSmartStatus(device);
} }
#endif #endif
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define _ATACMDS_H_ #define _ATACMDS_H_
#ifndef CVSID1 #ifndef CVSID1
#define CVSID1 "$Id: atacmds.h,v 1.19 2002/10/26 19:33:39 ballen4705 Exp $\n" #define CVSID1 "$Id: atacmds.h,v 1.20 2002/10/26 19:59:01 ballen4705 Exp $\n"
#endif #endif
// These are the major and minor versions for smartd and smartctl // These are the major and minor versions for smartd and smartctl
...@@ -314,7 +314,7 @@ int ataSmartSelfTestAbort (int device); ...@@ -314,7 +314,7 @@ int ataSmartSelfTestAbort (int device);
// Returns the latest compatibility of ATA/ATAPI Version the device // Returns the latest compatibility of ATA/ATAPI Version the device
// supports. Returns -1 if Version command is not supported // supports. Returns -1 if Version command is not supported
int ataVersionInfo (const char **description, struct hd_driveid drive); int ataVersionInfo (const char **description, struct hd_driveid drive, unsigned short *minor);
// If SMART supported, this is guaranteed to return 1 if SMART is enabled, else 0. // If SMART supported, this is guaranteed to return 1 if SMART is enabled, else 0.
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "smartctl.h" #include "smartctl.h"
#include "extern.h" #include "extern.h"
const char *CVSid4="$Id: ataprint.c,v 1.33 2002/10/24 09:54:02 ballen4705 Exp $" const char *CVSid4="$Id: ataprint.c,v 1.34 2002/10/26 19:59:01 ballen4705 Exp $"
CVSID2 CVSID3 CVSID6; CVSID2 CVSID3 CVSID6;
// Function for printing ASCII byte-swapped strings, skipping white // Function for printing ASCII byte-swapped strings, skipping white
...@@ -63,6 +63,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){ ...@@ -63,6 +63,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){
int version; int version;
const char *description; const char *description;
char unknown[64]; char unknown[64];
unsigned short minorrev;
// print out model, serial # and firmware versions (byte-swap ASCI strings) // print out model, serial # and firmware versions (byte-swap ASCI strings)
pout("Device Model: "); pout("Device Model: ");
...@@ -75,11 +76,11 @@ void ataPrintDriveInfo (struct hd_driveid drive){ ...@@ -75,11 +76,11 @@ void ataPrintDriveInfo (struct hd_driveid drive){
printswap(drive.fw_rev,8); printswap(drive.fw_rev,8);
// now get ATA version info // now get ATA version info
version=ataVersionInfo(&description,drive); version=ataVersionInfo(&description,drive, &minorrev);
// unrecognized minor revision code // unrecognized minor revision code
if (!description){ if (!description){
sprintf(unknown,"Unrecognized. Minor revision code: 0x%02x",drive.minor_rev_num); sprintf(unknown,"Unrecognized. Minor revision code: 0x%02x",minorrev);
description=unknown; description=unknown;
} }
...@@ -104,9 +105,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){ ...@@ -104,9 +105,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){
/* void PrintSmartOfflineStatus ( struct ata_smart_values data) /* void PrintSmartOfflineStatus ( struct ata_smart_values data)
prints verbose value Off-line data collection status byte */ prints verbose value Off-line data collection status byte */
void PrintSmartOfflineStatus(struct ata_smart_values data){
void PrintSmartOfflineStatus ( struct ata_smart_values data)
{
pout("Off-line data collection status: "); pout("Off-line data collection status: ");
switch(data.offline_data_collection_status){ switch(data.offline_data_collection_status){
...@@ -155,15 +154,9 @@ void PrintSmartOfflineStatus ( struct ata_smart_values data) ...@@ -155,15 +154,9 @@ void PrintSmartOfflineStatus ( struct ata_smart_values data)
(data.offline_data_collection_status <= 0x3f)) || (data.offline_data_collection_status <= 0x3f)) ||
((data.offline_data_collection_status >= 0xc0) && ((data.offline_data_collection_status >= 0xc0) &&
(data.offline_data_collection_status <= 0xff)) ) (data.offline_data_collection_status <= 0xff)) )
{ pout("(0x%02x)\tVendor Specific.\n",data.offline_data_collection_status);
pout ("(0x%02x)\tVendor Specific.\n",
data.offline_data_collection_status);
}
else else
{ pout("(0x%02x)\tReserved.\n",data.offline_data_collection_status);
pout ("(0x%02x)\tReserved.\n",
data.offline_data_collection_status);
}
} }
} }
...@@ -237,8 +230,7 @@ void PrintSmartSelfExecStatus ( struct ata_smart_values data) ...@@ -237,8 +230,7 @@ void PrintSmartSelfExecStatus ( struct ata_smart_values data)
void PrintSmartTotalTimeCompleteOffline ( struct ata_smart_values data) void PrintSmartTotalTimeCompleteOffline ( struct ata_smart_values data){
{
pout("Total time to complete off-line \n"); pout("Total time to complete off-line \n");
pout("data collection: \t\t (%4d) seconds.\n", pout("data collection: \t\t (%4d) seconds.\n",
data.total_time_to_complete_off_line); data.total_time_to_complete_off_line);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "smartctl.h" #include "smartctl.h"
#include "extern.h" #include "extern.h"
const char *CVSid4="$Id: ataprint.cpp,v 1.33 2002/10/24 09:54:02 ballen4705 Exp $" const char *CVSid4="$Id: ataprint.cpp,v 1.34 2002/10/26 19:59:01 ballen4705 Exp $"
CVSID2 CVSID3 CVSID6; CVSID2 CVSID3 CVSID6;
// Function for printing ASCII byte-swapped strings, skipping white // Function for printing ASCII byte-swapped strings, skipping white
...@@ -63,6 +63,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){ ...@@ -63,6 +63,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){
int version; int version;
const char *description; const char *description;
char unknown[64]; char unknown[64];
unsigned short minorrev;
// print out model, serial # and firmware versions (byte-swap ASCI strings) // print out model, serial # and firmware versions (byte-swap ASCI strings)
pout("Device Model: "); pout("Device Model: ");
...@@ -75,11 +76,11 @@ void ataPrintDriveInfo (struct hd_driveid drive){ ...@@ -75,11 +76,11 @@ void ataPrintDriveInfo (struct hd_driveid drive){
printswap(drive.fw_rev,8); printswap(drive.fw_rev,8);
// now get ATA version info // now get ATA version info
version=ataVersionInfo(&description,drive); version=ataVersionInfo(&description,drive, &minorrev);
// unrecognized minor revision code // unrecognized minor revision code
if (!description){ if (!description){
sprintf(unknown,"Unrecognized. Minor revision code: 0x%02x",drive.minor_rev_num); sprintf(unknown,"Unrecognized. Minor revision code: 0x%02x",minorrev);
description=unknown; description=unknown;
} }
...@@ -104,9 +105,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){ ...@@ -104,9 +105,7 @@ void ataPrintDriveInfo (struct hd_driveid drive){
/* void PrintSmartOfflineStatus ( struct ata_smart_values data) /* void PrintSmartOfflineStatus ( struct ata_smart_values data)
prints verbose value Off-line data collection status byte */ prints verbose value Off-line data collection status byte */
void PrintSmartOfflineStatus(struct ata_smart_values data){
void PrintSmartOfflineStatus ( struct ata_smart_values data)
{
pout("Off-line data collection status: "); pout("Off-line data collection status: ");
switch(data.offline_data_collection_status){ switch(data.offline_data_collection_status){
...@@ -155,15 +154,9 @@ void PrintSmartOfflineStatus ( struct ata_smart_values data) ...@@ -155,15 +154,9 @@ void PrintSmartOfflineStatus ( struct ata_smart_values data)
(data.offline_data_collection_status <= 0x3f)) || (data.offline_data_collection_status <= 0x3f)) ||
((data.offline_data_collection_status >= 0xc0) && ((data.offline_data_collection_status >= 0xc0) &&
(data.offline_data_collection_status <= 0xff)) ) (data.offline_data_collection_status <= 0xff)) )
{ pout("(0x%02x)\tVendor Specific.\n",data.offline_data_collection_status);
pout ("(0x%02x)\tVendor Specific.\n",
data.offline_data_collection_status);
}
else else
{ pout("(0x%02x)\tReserved.\n",data.offline_data_collection_status);
pout ("(0x%02x)\tReserved.\n",
data.offline_data_collection_status);
}
} }
} }
...@@ -237,8 +230,7 @@ void PrintSmartSelfExecStatus ( struct ata_smart_values data) ...@@ -237,8 +230,7 @@ void PrintSmartSelfExecStatus ( struct ata_smart_values data)
void PrintSmartTotalTimeCompleteOffline ( struct ata_smart_values data) void PrintSmartTotalTimeCompleteOffline ( struct ata_smart_values data){
{
pout("Total time to complete off-line \n"); pout("Total time to complete off-line \n");
pout("data collection: \t\t (%4d) seconds.\n", pout("data collection: \t\t (%4d) seconds.\n",
data.total_time_to_complete_off_line); data.total_time_to_complete_off_line);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment