Skip to content
Snippets Groups Projects
Commit 75d58e71 authored by chrfranke's avatar chrfranke
Browse files

Fix SCT temperature table commands on big endian CPUs.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@3064 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 128fe5c0
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[CF] Fix SCT temperature table commands on big endian CPUs.
[MS] drivedb.h updates:
- more Seagate Momentus 5400.6 drives
- HP 500GB drive MM0500EANCR
......
......@@ -13,6 +13,7 @@ Summary: smartmontools release 5.40
- Drive database is in a separate source file 'drivedb.h'
which can be downloaded from SVN.
- smartd libcap-ng support, option '-C, --capabilities'.
- Fix SCT temperature table commands on big endian CPUs.
Date 2010-01-28
Summary: smartmontools release 5.39.1
......
......@@ -2214,6 +2214,13 @@ int ataReadSCTTempHist(ata_device * device, ata_sct_temperature_history_table *
cmd.function_code = 1; // Read table
cmd.table_id = 2; // Temperature History Table
// swap endian order if needed
if (isbigendian()) {
swapx(&cmd.action_code);
swapx(&cmd.function_code);
swapx(&cmd.table_id);
}
// write command via SMART log page 0xe0
if (smartcommandhandler(device, WRITE_LOG, 0xe0, (char *)&cmd)){
syserror("Error Write SCT Data Table command failed");
......@@ -2276,6 +2283,15 @@ int ataSetSCTTempInterval(ata_device * device, unsigned interval, bool persisten
cmd.state = interval;
cmd.option_flags = (persistent ? 0x01 : 0x00);
// swap endian order if needed
if (isbigendian()) {
swapx(&cmd.action_code);
swapx(&cmd.function_code);
swapx(&cmd.feature_code);
swapx(&cmd.state);
swapx(&cmd.option_flags);
}
// write command via SMART log page 0xe0
if (smartcommandhandler(device, WRITE_LOG, 0xe0, (char *)&cmd)){
syserror("Error Write SCT Feature Control Command failed");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment