aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:47 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:47 -0500
commit578cfa0d72f81526b2fcb1dd2463c47bbf633989 (patch)
tree045e7d196e79f6cec24d486d5df9e2fbd8dc29d6
parent296921a4ca01612cb1d9a43343b33a33eb7697ff (diff)
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>
-rw-r--r--drivers/ide/ide-dma.c20
-rw-r--r--drivers/ide/ide-iops.c24
-rw-r--r--include/linux/ide.h2
3 files changed, 23 insertions, 23 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)
819 return 0; 819 return 0;
820} 820}
821 821
822void ide_check_dma_crc(ide_drive_t *drive)
823{
824 u8 mode;
825
826 ide_dma_off_quietly(drive);
827 drive->crc_count = 0;
828 mode = drive->current_speed;
829 /*
830 * Don't try non Ultra-DMA modes without iCRC's. Force the
831 * device to PIO and make the user enable SWDMA/MWDMA modes.
832 */
833 if (mode > XFER_UDMA_0 && mode <= XFER_UDMA_7)
834 mode--;
835 else
836 mode = XFER_PIO_4;
837 ide_set_xfer_rate(drive, mode);
838 if (drive->current_speed >= XFER_SW_DMA_0)
839 ide_dma_on(drive);
840}
841
822#ifdef CONFIG_BLK_DEV_IDEDMA_PCI 842#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
823void ide_dma_lost_irq (ide_drive_t *drive) 843void ide_dma_lost_irq (ide_drive_t *drive)
824{ 844{
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index b7da44c9e91c..a95178f5e1bb 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -938,28 +938,6 @@ static ide_startstop_t reset_pollfunc (ide_drive_t *drive)
938 return ide_stopped; 938 return ide_stopped;
939} 939}
940 940
941static void check_dma_crc(ide_drive_t *drive)
942{
943#ifdef CONFIG_BLK_DEV_IDEDMA
944 u8 mode;
945
946 ide_dma_off_quietly(drive);
947 drive->crc_count = 0;
948 mode = drive->current_speed;
949 /*
950 * Don't try non Ultra-DMA modes without iCRC's. Force the
951 * device to PIO and make the user enable SWDMA/MWDMA modes.
952 */
953 if (mode > XFER_UDMA_0 && mode <= XFER_UDMA_7)
954 mode--;
955 else
956 mode = XFER_PIO_4;
957 ide_set_xfer_rate(drive, mode);
958 if (drive->current_speed >= XFER_SW_DMA_0)
959 ide_dma_on(drive);
960#endif
961}
962
963static void ide_disk_pre_reset(ide_drive_t *drive) 941static void ide_disk_pre_reset(ide_drive_t *drive)
964{ 942{
965 int legacy = (drive->id->cfs_enable_2 & 0x0400) ? 0 : 1; 943 int legacy = (drive->id->cfs_enable_2 & 0x0400) ? 0 : 1;
@@ -983,7 +961,7 @@ static void pre_reset(ide_drive_t *drive)
983 961
984 if (drive->using_dma) { 962 if (drive->using_dma) {
985 if (drive->crc_count) 963 if (drive->crc_count)
986 check_dma_crc(drive); 964 ide_check_dma_crc(drive);
987 else 965 else
988 ide_dma_off(drive); 966 ide_dma_off(drive);
989 } 967 }
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 748af8dc0895..367c17084a28 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1155,6 +1155,7 @@ void ide_dma_off_quietly(ide_drive_t *);
1155void ide_dma_off(ide_drive_t *); 1155void ide_dma_off(ide_drive_t *);
1156void ide_dma_on(ide_drive_t *); 1156void ide_dma_on(ide_drive_t *);
1157int ide_set_dma(ide_drive_t *); 1157int ide_set_dma(ide_drive_t *);
1158void ide_check_dma_crc(ide_drive_t *);
1158ide_startstop_t ide_dma_intr(ide_drive_t *); 1159ide_startstop_t ide_dma_intr(ide_drive_t *);
1159 1160
1160int ide_build_sglist(ide_drive_t *, struct request *); 1161int ide_build_sglist(ide_drive_t *, struct request *);
@@ -1182,6 +1183,7 @@ static inline void ide_dma_off(ide_drive_t *drive) { ; }
1182static inline void ide_dma_on(ide_drive_t *drive) { ; } 1183static inline void ide_dma_on(ide_drive_t *drive) { ; }
1183static inline void ide_dma_verbose(ide_drive_t *drive) { ; } 1184static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1184static inline int ide_set_dma(ide_drive_t *drive) { return 1; } 1185static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1186static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1185#endif /* CONFIG_BLK_DEV_IDEDMA */ 1187#endif /* CONFIG_BLK_DEV_IDEDMA */
1186 1188
1187#ifndef CONFIG_BLK_DEV_IDEDMA_PCI 1189#ifndef CONFIG_BLK_DEV_IDEDMA_PCI