Commit b1354cbb authored by Lin Ming's avatar Lin Ming Committed by Jeff Garzik

libata: detect Device Attention support

Add a new flag ATA_DFLAG_DA to indicate that device supports "Device
Attention".
Acked-by: default avatarAaron Lu <aaron.lu@amd.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent a606dac3
...@@ -2374,6 +2374,9 @@ int ata_dev_configure(struct ata_device *dev) ...@@ -2374,6 +2374,9 @@ int ata_dev_configure(struct ata_device *dev)
dma_dir_string = ", DMADIR"; dma_dir_string = ", DMADIR";
} }
if (ata_id_has_da(dev->id))
dev->flags |= ATA_DFLAG_DA;
/* print device info to dmesg */ /* print device info to dmesg */
if (ata_msg_drv(ap) && print_info) if (ata_msg_drv(ap) && print_info)
ata_dev_info(dev, ata_dev_info(dev,
......
...@@ -578,6 +578,7 @@ static inline int ata_is_data(u8 prot) ...@@ -578,6 +578,7 @@ static inline int ata_is_data(u8 prot)
((u64) (id)[(n) + 0]) ) ((u64) (id)[(n) + 0]) )
#define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20)
#define ata_id_has_da(id) ((id)[77] & (1 << 4))
static inline bool ata_id_has_hipm(const u16 *id) static inline bool ata_id_has_hipm(const u16 *id)
{ {
......
...@@ -161,6 +161,8 @@ enum { ...@@ -161,6 +161,8 @@ enum {
ATA_DFLAG_DETACH = (1 << 24), ATA_DFLAG_DETACH = (1 << 24),
ATA_DFLAG_DETACHED = (1 << 25), ATA_DFLAG_DETACHED = (1 << 25),
ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
ATA_DEV_UNKNOWN = 0, /* unknown device */ ATA_DEV_UNKNOWN = 0, /* unknown device */
ATA_DEV_ATA = 1, /* ATA device */ ATA_DEV_ATA = 1, /* ATA device */
ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */ ATA_DEV_ATA_UNSUP = 2, /* ATA device (unsupported) */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment