diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-04-09 03:35:03 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-04-09 03:35:03 +0200 |
commit | e55ba06b41d4858564df57bd751d9e21c83e3fc6 (patch) | |
tree | c7a9563b75f822376a8c70de68a0a23033b941e6 /atasmart.c | |
parent | 96394ef1dfb0a2a9a44ee33817ebb416b0dba29f (diff) |
deal with ATA/USB truncation
Diffstat (limited to 'atasmart.c')
-rw-r--r-- | atasmart.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -660,10 +660,12 @@ int sk_disk_smart_status(SkDisk *d, SkBool *good) { if ((ret = disk_command(d, SK_ATA_COMMAND_SMART, SK_DIRECTION_NONE, cmd, NULL, 0)) < 0) return ret; - if (cmd[3] == htons(0x00C2U) && + /* SAT/USB bridges truncate packets, so we only check for 4F, + * not for 2C on those */ + if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) && cmd[4] == htons(0x4F00U)) *good = TRUE; - else if (cmd[3] == htons(0x002CU) && + else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) && cmd[4] == htons(0xF400U)) *good = FALSE; else { |