summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@trik.(none)>2004-10-22 23:04:21 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@trik.(none)>2004-10-22 23:04:21 +0200
commitae021d4bfcf77d57da773fabae8e738ed4b0321f (patch)
tree80b5b154c4000f7937b39bfed3e0f099533dcd3e
parentc5f35b911ed0a1e025ee0b0ce9d75d72f9f39b3f (diff)
[ide] kill ide_raw_build_sglist()
ide_build_sglist() can be now used for REQ_DRIVE_TASKFILE requests. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-dma.c39
-rw-r--r--drivers/ide/pci/sgiioc4.c5
-rw-r--r--drivers/ide/ppc/pmac.c7
-rw-r--r--include/linux/ide.h1
4 files changed, 7 insertions, 45 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 56eb77a61deb..5475b42ad798 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -208,6 +208,9 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
ide_hwif_t *hwif = HWIF(drive);
struct scatterlist *sg = hwif->sg_table;
+ if ((rq->flags & REQ_DRIVE_TASKFILE) && rq->nr_sectors > 256)
+ BUG();
+
ide_map_sg(drive, rq);
if (rq_data_dir(rq) == READ)
@@ -221,37 +224,6 @@ int ide_build_sglist(ide_drive_t *drive, struct request *rq)
EXPORT_SYMBOL_GPL(ide_build_sglist);
/**
- * ide_raw_build_sglist - map IDE scatter gather for DMA
- * @drive: the drive to build the DMA table for
- * @rq: the request holding the sg list
- *
- * Perform the PCI mapping magic necessary to access the source or
- * target buffers of a taskfile request via PCI DMA. The lower layers
- * of the kernel provide the necessary cache management so that we can
- * operate in a portable fashion
- */
-
-int ide_raw_build_sglist(ide_drive_t *drive, struct request *rq)
-{
- ide_hwif_t *hwif = HWIF(drive);
- struct scatterlist *sg = hwif->sg_table;
- ide_task_t *args = rq->special;
-
- if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE)
- hwif->sg_dma_direction = PCI_DMA_TODEVICE;
- else
- hwif->sg_dma_direction = PCI_DMA_FROMDEVICE;
-
- BUG_ON(rq->nr_sectors > 256);
-
- ide_map_sg(drive, rq);
-
- return pci_map_sg(hwif->pci_dev, sg, hwif->sg_nents, hwif->sg_dma_direction);
-}
-
-EXPORT_SYMBOL_GPL(ide_raw_build_sglist);
-
-/**
* ide_build_dmatable - build IDE DMA table
*
* ide_build_dmatable() prepares a dma request. We map the command
@@ -272,10 +244,7 @@ int ide_build_dmatable (ide_drive_t *drive, struct request *rq)
int i;
struct scatterlist *sg;
- if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE)
- hwif->sg_nents = i = ide_raw_build_sglist(drive, rq);
- else
- hwif->sg_nents = i = ide_build_sglist(drive, rq);
+ hwif->sg_nents = i = ide_build_sglist(drive, rq);
if (!i)
return 0;
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 88ca26a2c245..b5e3993d8dbe 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -501,10 +501,7 @@ sgiioc4_build_dma_table(ide_drive_t * drive, struct request *rq, int ddir)
unsigned int count = 0, i = 1;
struct scatterlist *sg;
- if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE)
- hwif->sg_nents = i = ide_raw_build_sglist(drive, rq);
- else
- hwif->sg_nents = i = ide_build_sglist(drive, rq);
+ hwif->sg_nents = i = ide_build_sglist(drive, rq);
if (!i)
return 0; /* sglist of length Zero */
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 5b956078aad0..b04980ac8e06 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1582,11 +1582,8 @@ pmac_ide_build_dmatable(ide_drive_t *drive, struct request *rq)
while (readl(&dma->status) & RUN)
udelay(1);
- /* Build sglist */
- if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE)
- hwif->sg_nents = i = ide_raw_build_sglist(drive, rq);
- else
- hwif->sg_nents = i = ide_build_sglist(drive, rq);
+ hwif->sg_nents = i = ide_build_sglist(drive, rq);
+
if (!i)
return 0;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index f4bafe0cd0fb..2b97d5f6a470 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1495,7 +1495,6 @@ int __ide_dma_off(ide_drive_t *);
#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
extern int ide_build_sglist(ide_drive_t *, struct request *);
-extern int ide_raw_build_sglist(ide_drive_t *, struct request *);
extern int ide_build_dmatable(ide_drive_t *, struct request *);
extern void ide_destroy_dmatable(ide_drive_t *);
extern ide_startstop_t ide_dma_intr(ide_drive_t *);