diff options
author | Tejun Heo <htejun@gmail.com> | 2007-11-27 05:43:40 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-01-23 05:24:11 -0500 |
commit | 70cd071e4ecc06c985189665af75c108601fd5a3 (patch) | |
tree | f28aae811d01f8ef44f27e5d469fe330ff834980 /include/linux | |
parent | 6357357cae7794dcb89cace758108dec612e7ed5 (diff) |
libata: clean up xfermode / PATA timing related stuff
* s/ATA_BITS_(PIO|MWDMA|UDMA)/ATA_NR_\1_MODES/g
* Consistently use 0xff to indicate invalid transfer mode (0x00 is
valid for PIO_SLOW).
* Make ata_xfer_mode2mask() return proper mode mask instead of just
the highest bit.
* Sort ata_timing table in increasing xfermode order and update
ata_timing_find_mode() accordingly.
This patch doesn't introduce any behavior change.
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.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 083dd77b120d..e2ed3bac8c5b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -269,17 +269,20 @@ enum { | |||
269 | /* encoding various smaller bitmaps into a single | 269 | /* encoding various smaller bitmaps into a single |
270 | * unsigned int bitmap | 270 | * unsigned int bitmap |
271 | */ | 271 | */ |
272 | ATA_BITS_PIO = 7, | 272 | ATA_NR_PIO_MODES = 7, |
273 | ATA_BITS_MWDMA = 5, | 273 | ATA_NR_MWDMA_MODES = 5, |
274 | ATA_BITS_UDMA = 8, | 274 | ATA_NR_UDMA_MODES = 8, |
275 | 275 | ||
276 | ATA_SHIFT_PIO = 0, | 276 | ATA_SHIFT_PIO = 0, |
277 | ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_BITS_PIO, | 277 | ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_NR_PIO_MODES, |
278 | ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_BITS_MWDMA, | 278 | ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_NR_MWDMA_MODES, |
279 | 279 | ||
280 | ATA_MASK_PIO = ((1 << ATA_BITS_PIO) - 1) << ATA_SHIFT_PIO, | 280 | ATA_MASK_PIO = ((1 << ATA_NR_PIO_MODES) - 1) |
281 | ATA_MASK_MWDMA = ((1 << ATA_BITS_MWDMA) - 1) << ATA_SHIFT_MWDMA, | 281 | << ATA_SHIFT_PIO, |
282 | ATA_MASK_UDMA = ((1 << ATA_BITS_UDMA) - 1) << ATA_SHIFT_UDMA, | 282 | ATA_MASK_MWDMA = ((1 << ATA_NR_MWDMA_MODES) - 1) |
283 | << ATA_SHIFT_MWDMA, | ||
284 | ATA_MASK_UDMA = ((1 << ATA_NR_UDMA_MODES) - 1) | ||
285 | << ATA_SHIFT_UDMA, | ||
283 | 286 | ||
284 | /* size of buffer to pad xfers ending on unaligned boundaries */ | 287 | /* size of buffer to pad xfers ending on unaligned boundaries */ |
285 | ATA_DMA_PAD_SZ = 4, | 288 | ATA_DMA_PAD_SZ = 4, |