static int piix_config_drive_for_dma (ide_drive_t *drive) { u8 speed = ide_dma_speed(drive, piix_ratemask(drive)); /* * If no DMA speed was available or the chipset has DMA bugs * then disable DMA and use PIO */ if (!speed || no_piix_dma) return 0; (void) piix_tune_chipset(drive, speed); return ide_dma_enable(drive); }
static int piix_config_drive_for_dma (ide_drive_t *drive) { u8 speed = ide_dma_speed(drive, piix_ratemask(drive)); /* Some ICH devices cannot support DMA mode 0 */ if(speed == XFER_MW_DMA_0 && piix_faulty_dma0(HWIF(drive))) speed = 0; /* If no DMA speed was available or the chipset has DMA bugs then disable DMA and use PIO */ if (!speed || no_piix_dma) { u8 tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); speed = piix_dma_2_pio(XFER_PIO_0 + tspeed); } (void) piix_tune_chipset(drive, speed); return ide_dma_enable(drive); }