Skip to content
Snippets Groups Projects
Commit 4e2dee85 authored by chrfranke's avatar chrfranke
Browse files

Minor fix to remove ID 0 from 'smartctl -l sataphy ...' output.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2719 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent c83397d5
Branches
No related tags found
No related merge requests found
CHANGELOG for smartmontools CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.766 2009/01/27 21:12:00 chrfranke Exp $ $Id: CHANGELOG,v 1.767 2009/01/29 20:29:00 chrfranke Exp $
The most recent version of this file is: The most recent version of this file is:
http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup
...@@ -41,6 +41,8 @@ NOTES FOR FUTURE RELEASES: see TODO file. ...@@ -41,6 +41,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[CF] Minor fix to remove ID 0 from 'smartctl -l sataphy ...' output.
[CF] knowndrives.cpp updates: Add warnings about possible firmware [CF] knowndrives.cpp updates: Add warnings about possible firmware
bugs to Seagate 7200.11, ES.2 and DiamondMax 22 entries. bugs to Seagate 7200.11, ES.2 and DiamondMax 22 entries.
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "utility.h" #include "utility.h"
#include "knowndrives.h" #include "knowndrives.h"
const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.204 2009/01/15 22:52:50 chrfranke Exp $" const char *ataprint_c_cvsid="$Id: ataprint.cpp,v 1.205 2009/01/29 20:29:00 chrfranke Exp $"
ATACMDNAMES_H_CVSID ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID; ATACMDNAMES_H_CVSID ATACMDS_H_CVSID ATAPRINT_H_CVSID CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID KNOWNDRIVES_H_CVSID SMARTCTL_H_CVSID UTILITY_H_CVSID;
// for passing global control variables // for passing global control variables
...@@ -971,16 +971,18 @@ static void PrintSataPhyEventCounters(const unsigned char * data, bool reset) ...@@ -971,16 +971,18 @@ static void PrintSataPhyEventCounters(const unsigned char * data, bool reset)
pout("[Reserved: 0x%02x 0x%02x 0x%02x 0x%02x]\n", pout("[Reserved: 0x%02x 0x%02x 0x%02x 0x%02x]\n",
data[0], data[1], data[2], data[3]); data[0], data[1], data[2], data[3]);
pout("ID Size Value Description\n"); pout("ID Size Value Description\n");
for (unsigned i = 4; ; ) { for (unsigned i = 4; ; ) {
// Get counter id // Get counter id and size (bits 14:12)
unsigned id = data[i] | (data[i+1] << 8); unsigned id = data[i] | (data[i+1] << 8);
unsigned size = ((id >> 12) & 0x7) << 1;
id &= 0x8fff;
// End of counter table ?
if (!id) if (!id)
break; break;
i += 2; i += 2;
// Get counter size (bits 14:12)
unsigned size = ((id >> 12) & 0x7) << 1;
id &= 0x8fff;
if (!(2 <= size && size <= 8 && i + size < 512)) { if (!(2 <= size && size <= 8 && i + size < 512)) {
pout("0x%04x %u: Invalid entry\n", id, size); pout("0x%04x %u: Invalid entry\n", id, size);
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment