static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) { ide_hwif_t *hwif = HWIF(drive); struct hd_driveid *id = drive->id; drive->init_speed = 0; if (id && (id->capability & 1) && drive->autodma) { if (ide_use_dma(drive)) { if (config_chipset_for_dma(drive)) #ifndef CONFIG_HPT34X_AUTODMA return hwif->ide_dma_off_quietly(drive); #else return hwif->ide_dma_on(drive); #endif } goto fast_ata_pio; } else if ((id->capability & 8) || (id->field_valid & 2)) { fast_ata_pio: hpt34x_tune_drive(drive, 255); return hwif->ide_dma_off_quietly(drive); } /* IORDY not supported */ return 0; }
static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) { drive->init_speed = 0; if (ide_tune_dma(drive)) return -1; if (ide_use_fast_pio(drive)) hpt34x_tune_drive(drive, 255); return -1; }