projects
/
platform
/
upstream
/
libatasmart.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6606ba
)
fix parsing of awake status
author
Lennart Poettering
<lennart@poettering.net>
Tue, 7 Apr 2009 19:38:40 +0000
(21:38 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Tue, 7 Apr 2009 19:38:40 +0000
(21:38 +0200)
atasmart.c
patch
|
blob
|
history
diff --git
a/atasmart.c
b/atasmart.c
index
7da80e0
..
44e095d
100644
(file)
--- a/
atasmart.c
+++ b/
atasmart.c
@@
-452,6
+452,7
@@
static int disk_identify_device(SkDisk *d) {
int sk_disk_check_sleep_mode(SkDisk *d, SkBool *awake) {
int ret;
uint16_t cmd[6];
+ uint8_t status;
if (!d->identify_data_valid) {
errno = ENOTSUP;
@@
-473,7
+474,8
@@
int sk_disk_check_sleep_mode(SkDisk *d, SkBool *awake) {
return -1;
}
- *awake = ntohs(cmd[1]) == 0xFF;
+ status = ntohs(cmd[1]) & 0xFF;
+ *awake = status == 0xFF || status == 0x80; /* idle and active/idle is considered awake */
return 0;
}