static int sgiioc4_ide_dma_setup(ide_drive_t *drive) { struct request *rq = HWGROUP(drive)->rq; unsigned int count = 0; int ddir; if (rq_data_dir(rq)) ddir = PCI_DMA_TODEVICE; else ddir = PCI_DMA_FROMDEVICE; if (!(count = sgiioc4_build_dma_table(drive, rq, ddir))) { /* try PIO instead of DMA */ ide_map_sg(drive, rq); return 1; } if (rq_data_dir(rq)) /* Writes TO the IOC4 FROM Main Memory */ ddir = IOC4_DMA_READ; else /* Writes FROM the IOC4 TO Main Memory */ ddir = IOC4_DMA_WRITE; sgiioc4_configure_for_dma(ddir, drive); return 0; }
static int sgiioc4_ide_dma_read(ide_drive_t * drive) { struct request *rq = HWGROUP(drive)->rq; unsigned int count = 0; if (!(count = sgiioc4_build_dma_table(drive, rq, PCI_DMA_FROMDEVICE))) { /* try PIO instead of DMA */ return 1; } /* Writes FROM the IOC4 TO Main Memory */ sgiioc4_configure_for_dma(IOC4_DMA_WRITE, drive); return 0; }
static int sgiioc4_ide_dma_write(ide_drive_t * drive) { struct request *rq = HWGROUP(drive)->rq; unsigned int count = 0; if (!(count = sgiioc4_build_dma_table(drive, rq, PCI_DMA_TODEVICE))) { /* try PIO instead of DMA */ return 1; } sgiioc4_configure_for_dma(IOC4_DMA_READ, drive); /* Writes TO the IOC4 FROM Main Memory */ return 0; }