From 0b384f75f7e25e1c15650a56e53f29a1c453c91d Mon Sep 17 00:00:00 2001 From: jmatthew Date: Wed, 31 May 2017 05:54:06 +0000 Subject: [PATCH] add some details relating to SATA device power management part of a diff from Imre Vadasz via sf@ --- sys/dev/ata/atascsi.h | 22 +++++++++++++++++++--- 1 file 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 @@ -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 */ -- 2.20.1