aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLin Ming <ming.m.lin@intel.com>2012-06-25 04:13:08 -0400
committerJeff Garzik <jgarzik@redhat.com>2012-06-29 11:38:17 -0400
commitb1354cbb5bfce28f2e1ed28d77b362dfdfca638d (patch)
tree0784fe570bc70663207f56a214f0ff529962bdc6
parenta606dac368eed5696fb38e16b1394f1d049c09e9 (diff)
libata: detect Device Attention support
Add a new flag ATA_DFLAG_DA to indicate that device supports "Device Attention". Acked-by: Aaron Lu <aaron.lu@amd.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/ata/libata-core.c3
-rw-r--r--include/linux/ata.h1
-rw-r--r--include/linux/libata.h2
3 files changed, 6 insertions, 0 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 7705191b5a81..c14f88c1f1da 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2374,6 +2374,9 @@ int ata_dev_configure(struct ata_device *dev)
2374 dma_dir_string = ", DMADIR"; 2374 dma_dir_string = ", DMADIR";
2375 } 2375 }
2376 2376
2377 if (ata_id_has_da(dev->id))
2378 dev->flags |= ATA_DFLAG_DA;
2379
2377 /* print device info to dmesg */ 2380 /* print device info to dmesg */
2378 if (ata_msg_drv(ap) && print_info) 2381 if (ata_msg_drv(ap) && print_info)
2379 ata_dev_info(dev, 2382 ata_dev_info(dev,
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 32df2b6ef0e0..5713d3ac381a 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -578,6 +578,7 @@ static inline int ata_is_data(u8 prot)
578 ((u64) (id)[(n) + 0]) ) 578 ((u64) (id)[(n) + 0]) )
579 579
580#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) 580#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
581#define ata_id_has_da(id) ((id)[77] & (1 << 4))
581 582
582static inline bool ata_id_has_hipm(const u16 *id) 583static inline bool ata_id_has_hipm(const u16 *id)
583{ 584{
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 888feef3cda4..cc22b943db83 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -161,6 +161,8 @@ enum {
161 ATA_DFLAG_DETACH = (1 << 24), 161 ATA_DFLAG_DETACH = (1 << 24),
162 ATA_DFLAG_DETACHED = (1 << 25), 162 ATA_DFLAG_DETACHED = (1 << 25),
163 163
164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
165
164 ATA_DEV_UNKNOWN = 0, /* unknown device */ 166 ATA_DEV_UNKNOWN = 0, /* unknown device */
165 ATA_DEV_ATA = 1, /* ATA device */ 167 ATA_DEV_ATA = 1, /* ATA device */
166 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */ 168 ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */