summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-03-06 04:31:56 +0900
committerJeff Garzik <jeff@garzik.org>2006-03-11 19:03:38 -0500
commit1da7b0d01b20bf21f3263d8d2f17fa49a214d773 (patch)
treeed68984a55447d5620adbe885d9479bf96213bd6 /include/linux
parent2e755f68ee23b03484fde18d978f910cc5479cb8 (diff)
[PATCH] libata: improve xfer mask constants and update ata_mode_string()
Add ATA_BITS_*, ATA_MASK_* macros and reorder xfer_mask fields such that higher transfer mode is placed at higher order bit. As thie reordering breaks ata_mode_string(), this patch also rewrites ata_mode_string(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/libata.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 15674923cc84..239408ecfddf 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -188,11 +188,19 @@ enum {
PORT_DISABLED = 2,
/* encoding various smaller bitmaps into a single
- * unsigned long bitmap
+ * unsigned int bitmap
*/
- ATA_SHIFT_UDMA = 0,
- ATA_SHIFT_MWDMA = 8,
- ATA_SHIFT_PIO = 11,
+ ATA_BITS_PIO = 5,
+ ATA_BITS_MWDMA = 3,
+ ATA_BITS_UDMA = 8,
+
+ ATA_SHIFT_PIO = 0,
+ ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_BITS_PIO,
+ ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_BITS_MWDMA,
+
+ ATA_MASK_PIO = ((1 << ATA_BITS_PIO) - 1) << ATA_SHIFT_PIO,
+ ATA_MASK_MWDMA = ((1 << ATA_BITS_MWDMA) - 1) << ATA_SHIFT_MWDMA,
+ ATA_MASK_UDMA = ((1 << ATA_BITS_UDMA) - 1) << ATA_SHIFT_UDMA,
/* size of buffer to pad xfers ending on unaligned boundaries */
ATA_DMA_PAD_SZ = 4,