Lines Matching refs:drive
48 static inline u8 HT_CONFIG(ide_drive_t *drive)
50 return ((unsigned long)ide_get_drivedata(drive) & 0xff00) >> 8;
95 * Active Time for each drive. Smaller value gives higher speed.
98 static inline u8 HT_TIMING(ide_drive_t *drive)
100 return (unsigned long)ide_get_drivedata(drive) & 0x00ff;
113 * This routine is invoked from ide.c to prepare for access to a given drive.
115 static void ht6560b_dev_select(ide_drive_t *drive)
117 ide_hwif_t *hwif = drive->hwif;
125 select = HT_CONFIG(drive);
126 timing = HT_TIMING(drive);
132 if (drive->media != ide_disk ||
133 (drive->dev_flags & IDE_DFLAG_PRESENT) == 0)
145 * Set timing for this drive:
151 drive->name, select, timing);
156 outb(drive->select | ATA_DEVICE_OBS, hwif->io_ports.device_addr);
200 static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio)
210 cycle_time = ide_pio_cycle_time(drive, pio);
233 printk("ht6560b: drive %s setting pio=%d recovery=%d (%dns) active=%d (%dns)\n", drive->name, pio, recovery_cycles, recovery_time, active_cycles, active_time);
240 printk("ht6560b: drive %s setting pio=0\n", drive->name);
252 static void ht_set_prefetch(ide_drive_t *drive, u8 state)
259 config = (unsigned long)ide_get_drivedata(drive);
266 drive->dev_flags |= IDE_DFLAG_NO_UNMASK;
267 drive->dev_flags &= ~IDE_DFLAG_UNMASK;
270 drive->dev_flags &= ~IDE_DFLAG_NO_UNMASK;
273 ide_set_drivedata(drive, (void *)config);
278 printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis"));
282 static void ht6560b_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive)
285 const u8 pio = drive->pio_mode - XFER_PIO_0;
291 ht_set_prefetch(drive, pio & 1);
295 timing = ht_pio2timings(drive, pio);
298 config = (unsigned long)ide_get_drivedata(drive);
301 ide_set_drivedata(drive, (void *)config);
305 printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing);
309 static void __init ht6560b_init_dev(ide_drive_t *drive)
311 ide_hwif_t *hwif = drive->hwif;
318 ide_set_drivedata(drive, (void *)t);