aboutsummaryrefslogtreecommitdiff
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-29 12:12:34 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-29 12:12:34 -0700
commit3529a233421fc43fa7bfdf7a4317daf28348a23d (patch)
tree520558ffb70e4f4743495ad7a62d4c775c0c1ea3 /include/linux/ata.h
parent00cda56d39f013cce60f44f1e3da19b87eba5d85 (diff)
parent31556594f913fa81d008cecfe46d7211c919a853 (diff)
Merge branch 'alpm' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'alpm' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [libata] AHCI: add hw link power management support [libata] Link power management infrastructure
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index e21c002c3a4..128dc7ad490 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -236,6 +236,7 @@ enum {
/* SETFEATURE Sector counts for SATA features */
SATA_AN = 0x05, /* Asynchronous Notification */
+ SATA_DIPM = 0x03, /* Device Initiated Power Management */
/* ATAPI stuff */
ATAPI_PKT_DMA = (1 << 0),
@@ -378,6 +379,26 @@ struct ata_taskfile {
#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
+static inline bool ata_id_has_hipm(const u16 *id)
+{
+ u16 val = id[76];
+
+ if (val == 0 || val == 0xffff)
+ return false;
+
+ return val & (1 << 9);
+}
+
+static inline bool ata_id_has_dipm(const u16 *id)
+{
+ u16 val = id[78];
+
+ if (val == 0 || val == 0xffff)
+ return false;
+
+ return val & (1 << 3);
+}
+
static inline int ata_id_has_fua(const u16 *id)
{
if ((id[84] & 0xC000) != 0x4000)