-/* $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>
#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 */
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 */