struct scatterlist *sg = hwif->sg_table;
int nents;
- if (hwif->sg_dma_active)
- BUG();
-
nents = blk_rq_map_sg(drive->queue, rq, hwif->sg_table);
if (rq_data_dir(rq) == READ)
hwif->sg_table,
hwif->sg_nents,
hwif->sg_dma_direction);
- hwif->sg_dma_active = 0;
return 0; /* revert to PIO for this request */
}
int nents = HWIF(drive)->sg_nents;
pci_unmap_sg(dev, sg, nents, HWIF(drive)->sg_dma_direction);
- HWIF(drive)->sg_dma_active = 0;
}
EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
ide_hwif_t *hwif = HWIF(drive);
if ((id->capability & 1) && hwif->autodma) {
- /* Consult the list of known "bad" drives */
- if (__ide_dma_bad_drive(drive))
- return __ide_dma_off(drive);
-
/*
* Enable DMA on any drive that has
* UltraDMA (mode 0/1/2/3/4/5/6) enabled
int __ide_dma_on (ide_drive_t *drive)
{
+ /* consult the list of known "bad" drives */
+ if (__ide_dma_bad_drive(drive))
+ return 1;
+
drive->using_dma = 1;
ide_toggle_bounce(drive, 1);