Skip to content
Snippets Groups Projects
Commit 07c2f93b authored by chrfranke's avatar chrfranke
Browse files

Add missing check for log page 0x11 support to smartctl

'-l sataphy' option.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2960 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 71b796a7
Branches
No related tags found
No related merge requests found
......@@ -43,6 +43,9 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[CF] Add missing check for log page 0x11 support to smartctl
'-l sataphy' option.
[CF] Add USB ID of Freecom Hard Drive XS.
[AS] Linux: Autodetect DELL PERC and MegaRAID controllers.
......
......@@ -2051,9 +2051,11 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
ata_smart_log_directory smartlogdir_buf, gplogdir_buf;
const ata_smart_log_directory * smartlogdir = 0, * gplogdir = 0;
if ( options.gp_logdir || options.smart_logdir
|| options.sataphy || options.smart_ext_error_log
if ( options.gp_logdir
|| options.smart_logdir
|| options.smart_ext_error_log
|| options.smart_ext_selftest_log
|| options.sataphy
|| !options.log_requests.empty() ) {
PRINT_ON(con);
if (isGeneralPurposeLoggingCapable(&drive))
......@@ -2063,7 +2065,8 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
bool need_smart_logdir = options.smart_logdir;
bool need_gp_logdir = ( options.gp_logdir
|| options.smart_ext_error_log
|| options.smart_ext_selftest_log);
|| options.smart_ext_selftest_log
|| options.sataphy );
unsigned i;
for (i = 0; i < options.log_requests.size(); i++) {
if (options.log_requests[i].gpl)
......@@ -2323,6 +2326,12 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
// Print SATA Phy Event Counters
if (options.sataphy) {
unsigned nsectors = GetNumLogSectors(gplogdir, 0x11, true);
if (!nsectors)
pout("SATA Phy Event Counters (GP Log 0x11) not supported\n");
else if (nsectors != 1)
pout("SATA Phy Event Counters with %u sectors not supported\n", nsectors);
else {
unsigned char log_11[512] = {0, };
unsigned char features = (options.sataphy_reset ? 0x01 : 0x00);
if (!ataReadLogExt(device, 0x11, features, 0, log_11, 1))
......@@ -2330,6 +2339,7 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
else
PrintSataPhyEventCounters(log_11, options.sataphy_reset);
}
}
// START OF THE TESTING SECTION OF THE CODE. IF NO TESTING, RETURN
if (options.smart_selftest_type == -1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment