static void tune_ht6560b (ide_drive_t *drive, byte pio) { unsigned long flags; byte timing; switch (pio) { case 8: /* set prefetch off */ case 9: /* set prefetch on */ ht_set_prefetch(drive, pio & 1); return; } timing = ht_pio2timings(drive, pio); save_flags (flags); /* all CPUs */ cli(); /* all CPUs */ drive->drive_data &= 0xff00; drive->drive_data |= timing; restore_flags (flags); /* all CPUs */ #ifdef DEBUG printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); #endif }
static void ht6560b_set_pio_mode(ide_drive_t *drive, const u8 pio) { unsigned long flags, config; u8 timing; switch (pio) { case 8: /* set prefetch off */ case 9: /* set prefetch on */ ht_set_prefetch(drive, pio & 1); return; } timing = ht_pio2timings(drive, pio); spin_lock_irqsave(&ht6560b_lock, flags); config = (unsigned long)ide_get_drivedata(drive); config &= 0xff00; config |= timing; ide_set_drivedata(drive, (void *)config); spin_unlock_irqrestore(&ht6560b_lock, flags); #ifdef DEBUG printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); #endif }
static void tune_ht6560b (ide_drive_t *drive, u8 pio) { unsigned long flags; u8 timing; switch (pio) { case 8: /* set prefetch off */ case 9: /* set prefetch on */ ht_set_prefetch(drive, pio & 1); return; } timing = ht_pio2timings(drive, pio); spin_lock_irqsave(&ide_lock, flags); drive->drive_data &= 0xff00; drive->drive_data |= timing; spin_unlock_irqrestore(&ide_lock, flags); #ifdef DEBUG printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); #endif }