summaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorJonathan Matthew <jmatthew@cvs.openbsd.org>2017-05-31 05:54:07 +0000
committerJonathan Matthew <jmatthew@cvs.openbsd.org>2017-05-31 05:54:07 +0000
commit3a470aeac36ac5a7c7cd88d4d628ad9e12e223fb (patch)
treee4fabe692b36f23e079aa69808a0da1c4d973d43 /sys/dev/ata
parent5904ec7c3a1e2b41a17b91197c62665a663af1e3 (diff)
add some details relating to SATA device power management
part of a diff from Imre Vadasz via sf@
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/atascsi.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/dev/ata/atascsi.h b/sys/dev/ata/atascsi.h
index d91a85fa838..a4767e7f63d 100644
--- a/sys/dev/ata/atascsi.h
+++ b/sys/dev/ata/atascsi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.h,v 1.51 2017/05/31 05:47:29 jmatthew Exp $ */
+/* $OpenBSD: atascsi.h,v 1.52 2017/05/31 05:54:06 jmatthew Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -50,13 +50,22 @@ struct scsi_link;
#define ATA_C_DSM 0x06
/*
- * ATA SET FEATURES subcommands
+ * ATA SET FEATURES subcommands (feature field)
*/
#define ATA_SF_WRITECACHE_EN 0x02
#define ATA_SF_XFERMODE 0x03
+#define ATA_SF_SATA_FEATURE_EN 0x10
#define ATA_SF_XFERMODE_UDMA 0x40
+#define ATA_SF_SATA_FEATURE_DIS 0x90
#define ATA_SF_LOOKAHEAD_EN 0xaa
+/*
+ * ATA SET FEATURES args (count field)
+ */
+#define ATA_SF_SATA_DEVIPS 0x03 /* Device-initiated power management */
+#define ATA_SF_SATA_DEVAPS 0x07 /* Device Automatic Partial to Slumber transitions */
+#define ATA_SF_SATA_DEVSLEEP 0x09 /* DevSleep power management state */
+
struct ata_identify {
u_int16_t config; /* 0 */
u_int16_t ncyls; /* 1 */
@@ -103,11 +112,18 @@ struct ata_identify {
u_int16_t satacap; /* 76 */
#define ATA_SATACAP_GEN1 0x0002
#define ATA_SATACAP_GEN2 0x0004
+#define ATA_SATACAP_GEN3 0x0008
#define ATA_SATACAP_NCQ 0x0100
-#define ATA_SATACAP_PWRMGMT 0x0200
+#define ATA_SATACAP_HIPM 0x0200
+#define ATA_SATACAP_HOSTAPS 0x2000
+#define ATA_SATACAP_DEVAPS 0x4000
u_int16_t reserved6; /* 77 */
u_int16_t satafsup; /* 78 */
+#define ATA_SATAFSUP_DIPM 0x0008
+#define ATA_SATAFSUP_DEVSLP 0x0100
u_int16_t satafen; /* 79 */
+#define ATA_SATAFEN_DIPM 0x0008
+#define ATA_SATAFEN_DEVSLP 0x0100
u_int16_t majver; /* 80 */
u_int16_t minver; /* 81 */
u_int16_t cmdset82; /* 82 */