diff options
Diffstat (limited to 'drivers/ide/ide-xfer-mode.c')
-rw-r--r-- | drivers/ide/ide-xfer-mode.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/ide/ide-xfer-mode.c b/drivers/ide/ide-xfer-mode.c index 6910f6a257e8..af44be9d546c 100644 --- a/drivers/ide/ide-xfer-mode.c +++ b/drivers/ide/ide-xfer-mode.c | |||
@@ -9,11 +9,11 @@ static const char *udma_str[] = | |||
9 | { "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44", | 9 | { "UDMA/16", "UDMA/25", "UDMA/33", "UDMA/44", |
10 | "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" }; | 10 | "UDMA/66", "UDMA/100", "UDMA/133", "UDMA7" }; |
11 | static const char *mwdma_str[] = | 11 | static const char *mwdma_str[] = |
12 | { "MWDMA0", "MWDMA1", "MWDMA2" }; | 12 | { "MWDMA0", "MWDMA1", "MWDMA2", "MWDMA3", "MWDMA4" }; |
13 | static const char *swdma_str[] = | 13 | static const char *swdma_str[] = |
14 | { "SWDMA0", "SWDMA1", "SWDMA2" }; | 14 | { "SWDMA0", "SWDMA1", "SWDMA2" }; |
15 | static const char *pio_str[] = | 15 | static const char *pio_str[] = |
16 | { "PIO0", "PIO1", "PIO2", "PIO3", "PIO4", "PIO5" }; | 16 | { "PIO0", "PIO1", "PIO2", "PIO3", "PIO4", "PIO5", "PIO6" }; |
17 | 17 | ||
18 | /** | 18 | /** |
19 | * ide_xfer_verbose - return IDE mode names | 19 | * ide_xfer_verbose - return IDE mode names |
@@ -30,11 +30,11 @@ const char *ide_xfer_verbose(u8 mode) | |||
30 | 30 | ||
31 | if (mode >= XFER_UDMA_0 && mode <= XFER_UDMA_7) | 31 | if (mode >= XFER_UDMA_0 && mode <= XFER_UDMA_7) |
32 | s = udma_str[i]; | 32 | s = udma_str[i]; |
33 | else if (mode >= XFER_MW_DMA_0 && mode <= XFER_MW_DMA_2) | 33 | else if (mode >= XFER_MW_DMA_0 && mode <= XFER_MW_DMA_4) |
34 | s = mwdma_str[i]; | 34 | s = mwdma_str[i]; |
35 | else if (mode >= XFER_SW_DMA_0 && mode <= XFER_SW_DMA_2) | 35 | else if (mode >= XFER_SW_DMA_0 && mode <= XFER_SW_DMA_2) |
36 | s = swdma_str[i]; | 36 | s = swdma_str[i]; |
37 | else if (mode >= XFER_PIO_0 && mode <= XFER_PIO_5) | 37 | else if (mode >= XFER_PIO_0 && mode <= XFER_PIO_6) |
38 | s = pio_str[i & 0x7]; | 38 | s = pio_str[i & 0x7]; |
39 | else if (mode == XFER_PIO_SLOW) | 39 | else if (mode == XFER_PIO_SLOW) |
40 | s = "PIO SLOW"; | 40 | s = "PIO SLOW"; |
@@ -79,7 +79,10 @@ u8 ide_get_best_pio_mode(ide_drive_t *drive, u8 mode_wanted, u8 max_mode) | |||
79 | } | 79 | } |
80 | 80 | ||
81 | if (id[ATA_ID_FIELD_VALID] & 2) { /* ATA2? */ | 81 | if (id[ATA_ID_FIELD_VALID] & 2) { /* ATA2? */ |
82 | if (ata_id_has_iordy(id)) { | 82 | if (ata_id_is_cfa(id) && (id[ATA_ID_CFA_MODES] & 7)) |
83 | pio_mode = 4 + min_t(int, 2, | ||
84 | id[ATA_ID_CFA_MODES] & 7); | ||
85 | else if (ata_id_has_iordy(id)) { | ||
83 | if (id[ATA_ID_PIO_MODES] & 7) { | 86 | if (id[ATA_ID_PIO_MODES] & 7) { |
84 | overridden = 0; | 87 | overridden = 0; |
85 | if (id[ATA_ID_PIO_MODES] & 4) | 88 | if (id[ATA_ID_PIO_MODES] & 4) |
@@ -239,7 +242,7 @@ int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) | |||
239 | 242 | ||
240 | BUG_ON(rate < XFER_PIO_0); | 243 | BUG_ON(rate < XFER_PIO_0); |
241 | 244 | ||
242 | if (rate >= XFER_PIO_0 && rate <= XFER_PIO_5) | 245 | if (rate >= XFER_PIO_0 && rate <= XFER_PIO_6) |
243 | return ide_set_pio_mode(drive, rate); | 246 | return ide_set_pio_mode(drive, rate); |
244 | 247 | ||
245 | return ide_set_dma_mode(drive, rate); | 248 | return ide_set_dma_mode(drive, rate); |