diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 19:56:47 +0100 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 19:56:47 +0100 |
commit | 578cfa0d72f81526b2fcb1dd2463c47bbf633989 (patch) | |
tree | 045e7d196e79f6cec24d486d5df9e2fbd8dc29d6 /drivers/ide/ide-dma.c | |
parent | ide: remove ide_auto_reduce_xfer() (diff) | |
download | linux-578cfa0d72f81526b2fcb1dd2463c47bbf633989.tar.xz linux-578cfa0d72f81526b2fcb1dd2463c47bbf633989.zip |
ide: move check_dma_crc() to ide-dma.c
* Move check_dma_crc() to ide-dma.c and add inline version for
CONFIG_BLK_DEV_IDEDMA=n case.
* Rename check_dma_crc() to ide_check_dma_crc().
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 7beaf1e9be12..3cf59f2c3928 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -819,6 +819,26 @@ int ide_set_dma(ide_drive_t *drive) return 0; } +void ide_check_dma_crc(ide_drive_t *drive) +{ + u8 mode; + + ide_dma_off_quietly(drive); + drive->crc_count = 0; + mode = drive->current_speed; + /* + * Don't try non Ultra-DMA modes without iCRC's. Force the + * device to PIO and make the user enable SWDMA/MWDMA modes. + */ + if (mode > XFER_UDMA_0 && mode <= XFER_UDMA_7) + mode--; + else + mode = XFER_PIO_4; + ide_set_xfer_rate(drive, mode); + if (drive->current_speed >= XFER_SW_DMA_0) + ide_dma_on(drive); +} + #ifdef CONFIG_BLK_DEV_IDEDMA_PCI void ide_dma_lost_irq (ide_drive_t *drive) { |