Add protocol data transfer tests.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
---
 include/linux/ata.h |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/include/linux/ata.h b/include/linux/ata.h
index e21c002..fd73b69 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -321,6 +321,27 @@ enum ata_tf_protocols {
        ATA_PROT_ATAPI_DMA,     /* packet command with special DMA sauce */
 };
 
+static inline int ata_is_nodata(u8 prot)
+{
+       return prot == ATA_PROT_NODATA || prot == ATA_PROT_ATAPI_NODATA;
+}
+
+static inline int ata_is_pio_data(u8 prot)
+{
+       return prot == ATA_PROT_PIO || prot == ATA_PROT_ATAPI;
+}
+
+static inline int ata_is_dma_data(u8 prot)
+{
+       return prot == ATA_PROT_DMA || prot == ATA_PROT_NCQ ||
+               prot == ATA_PROT_ATAPI_DMA;
+}
+
+static inline int ata_is_data(u8 prot)
+{
+       return ata_is_pio_data(prot) || ata_is_dma_data(prot);
+}
+
 enum ata_ioctls {
        ATA_IOC_GET_IO32        = 0x309,
        ATA_IOC_SET_IO32        = 0x324,
-- 
1.5.2.4

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to