aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-11-27 05:43:42 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:12 -0500
commit7dc951aefdc1dc20228691b04867fb6195864d67 (patch)
treeb2c3c1213831593feaf16c9fdc0c88f26d3c10f2 /include
parent9d3501ab962b1506d93974faf8509251b4a85fbc (diff)
libata: xfer_mask is unsigned long not unsigned int
Jeff says xfer_mask is unsigned long not unsigned int. Convert all xfermask fields and handling functions to deal with unsigned longs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/libata.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d33702fe78f9..d9eb20c67bb6 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -267,7 +267,7 @@ enum {
267 PORT_DISABLED = 2, 267 PORT_DISABLED = 2,
268 268
269 /* encoding various smaller bitmaps into a single 269 /* encoding various smaller bitmaps into a single
270 * unsigned int bitmap 270 * unsigned long bitmap
271 */ 271 */
272 ATA_NR_PIO_MODES = 7, 272 ATA_NR_PIO_MODES = 7,
273 ATA_NR_MWDMA_MODES = 5, 273 ATA_NR_MWDMA_MODES = 5,
@@ -277,13 +277,6 @@ enum {
277 ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_NR_PIO_MODES, 277 ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_NR_PIO_MODES,
278 ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_NR_MWDMA_MODES, 278 ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_NR_MWDMA_MODES,
279 279
280 ATA_MASK_PIO = ((1 << ATA_NR_PIO_MODES) - 1)
281 << ATA_SHIFT_PIO,
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,
286
287 /* size of buffer to pad xfers ending on unaligned boundaries */ 280 /* size of buffer to pad xfers ending on unaligned boundaries */
288 ATA_DMA_PAD_SZ = 4, 281 ATA_DMA_PAD_SZ = 4,
289 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE, 282 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
@@ -355,6 +348,15 @@ enum {
355 ATA_DMA_MASK_CFA = (1 << 2), /* DMA on CF Card */ 348 ATA_DMA_MASK_CFA = (1 << 2), /* DMA on CF Card */
356}; 349};
357 350
351enum ata_xfer_mask {
352 ATA_MASK_PIO = ((1LU << ATA_NR_PIO_MODES) - 1)
353 << ATA_SHIFT_PIO,
354 ATA_MASK_MWDMA = ((1LU << ATA_NR_MWDMA_MODES) - 1)
355 << ATA_SHIFT_MWDMA,
356 ATA_MASK_UDMA = ((1LU << ATA_NR_UDMA_MODES) - 1)
357 << ATA_SHIFT_UDMA,
358};
359
358enum hsm_task_states { 360enum hsm_task_states {
359 HSM_ST_IDLE, /* no command on going */ 361 HSM_ST_IDLE, /* no command on going */
360 HSM_ST_FIRST, /* (waiting the device to) 362 HSM_ST_FIRST, /* (waiting the device to)
@@ -526,9 +528,9 @@ struct ata_device {
526 unsigned int cdb_len; 528 unsigned int cdb_len;
527 529
528 /* per-dev xfer mask */ 530 /* per-dev xfer mask */
529 unsigned int pio_mask; 531 unsigned long pio_mask;
530 unsigned int mwdma_mask; 532 unsigned long mwdma_mask;
531 unsigned int udma_mask; 533 unsigned long udma_mask;
532 534
533 /* for CHS addressing */ 535 /* for CHS addressing */
534 u16 cylinders; /* Number of cylinders */ 536 u16 cylinders; /* Number of cylinders */
@@ -854,15 +856,16 @@ extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
854extern void ata_tf_to_fis(const struct ata_taskfile *tf, 856extern void ata_tf_to_fis(const struct ata_taskfile *tf,
855 u8 pmp, int is_cmd, u8 *fis); 857 u8 pmp, int is_cmd, u8 *fis);
856extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 858extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
857extern unsigned int ata_pack_xfermask(unsigned int pio_mask, 859extern unsigned long ata_pack_xfermask(unsigned long pio_mask,
858 unsigned int mwdma_mask, unsigned int udma_mask); 860 unsigned long mwdma_mask, unsigned long udma_mask);
859extern void ata_unpack_xfermask(unsigned int xfer_mask, unsigned int *pio_mask, 861extern void ata_unpack_xfermask(unsigned long xfer_mask,
860 unsigned int *mwdma_mask, unsigned int *udma_mask); 862 unsigned long *pio_mask, unsigned long *mwdma_mask,
861extern u8 ata_xfer_mask2mode(unsigned int xfer_mask); 863 unsigned long *udma_mask);
862extern unsigned int ata_xfer_mode2mask(u8 xfer_mode); 864extern u8 ata_xfer_mask2mode(unsigned long xfer_mask);
863extern int ata_xfer_mode2shift(unsigned int xfer_mode); 865extern unsigned long ata_xfer_mode2mask(u8 xfer_mode);
864extern const char *ata_mode_string(unsigned int xfer_mask); 866extern int ata_xfer_mode2shift(unsigned long xfer_mode);
865extern unsigned int ata_id_xfermask(const u16 *id); 867extern const char *ata_mode_string(unsigned long xfer_mask);
868extern unsigned long ata_id_xfermask(const u16 *id);
866extern void ata_noop_dev_select(struct ata_port *ap, unsigned int device); 869extern void ata_noop_dev_select(struct ata_port *ap, unsigned int device);
867extern void ata_std_dev_select(struct ata_port *ap, unsigned int device); 870extern void ata_std_dev_select(struct ata_port *ap, unsigned int device);
868extern u8 ata_check_status(struct ata_port *ap); 871extern u8 ata_check_status(struct ata_port *ap);
@@ -1001,7 +1004,8 @@ extern int ata_pci_prepare_sff_host(struct pci_dev *pdev,
1001 const struct ata_port_info * const * ppi, 1004 const struct ata_port_info * const * ppi,
1002 struct ata_host **r_host); 1005 struct ata_host **r_host);
1003extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); 1006extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
1004extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long); 1007extern unsigned long ata_pci_default_filter(struct ata_device *dev,
1008 unsigned long xfer_mask);
1005#endif /* CONFIG_PCI */ 1009#endif /* CONFIG_PCI */
1006 1010
1007/* 1011/*