summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorbrucec <brucec@FreeBSD.org>2010-11-04 15:24:32 +0000
committerbrucec <brucec@FreeBSD.org>2010-11-04 15:24:32 +0000
commit493d225e7af9077a6b88f261b5e6231b6224000e (patch)
treee257f3a09a622355ca93e9f03f388fb0e59dc73f /sbin
parent8362b61a773d05139a09c6c1b359e8f7248ec4a0 (diff)
downloadFreeBSD-src-493d225e7af9077a6b88f261b5e6231b6224000e.zip
FreeBSD-src-493d225e7af9077a6b88f261b5e6231b6224000e.tar.gz
Fix standby timer calculation: the timer was being set 30 minutes later
than the user requested. Also, 21 minutes is encoded as 252 and 22-29 minutes cannot be encoded so must be rounded up to 30. PR: bin/151871
Diffstat (limited to 'sbin')
-rw-r--r--sbin/camcontrol/camcontrol.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
index 9f16f2b..bedd035 100644
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -4316,10 +4316,17 @@ atapm(struct cam_device *device, int argc, char **argv,
sc = 0;
else if (t <= (240 * 5))
sc = t / 5;
+ else if (t == (252 * 5))
+ /* special encoding for 21 minutes */
+ sc = 252;
+ else if (t < (30 * 60))
+ /* no encoding exists for 22-29 minutes, so set to 30 mins */
+ sc = 241;
else if (t <= (11 * 30 * 60))
- sc = t / (30 * 60) + 241;
+ sc = t / (30 * 60) + 240;
else
sc = 253;
+
cam_fill_ataio(&ccb->ataio,
retry_count,
NULL,
OpenPOWER on IntegriCloud