Lines Matching refs:drive
47 static inline u8 HT_CONFIG(ide_drive_t *drive) in HT_CONFIG() argument
49 return ((unsigned long)ide_get_drivedata(drive) & 0xff00) >> 8; in HT_CONFIG()
97 static inline u8 HT_TIMING(ide_drive_t *drive) in HT_TIMING() argument
99 return (unsigned long)ide_get_drivedata(drive) & 0x00ff; in HT_TIMING()
114 static void ht6560b_dev_select(ide_drive_t *drive) in ht6560b_dev_select() argument
116 ide_hwif_t *hwif = drive->hwif; in ht6560b_dev_select()
124 select = HT_CONFIG(drive); in ht6560b_dev_select()
125 timing = HT_TIMING(drive); in ht6560b_dev_select()
131 if (drive->media != ide_disk || in ht6560b_dev_select()
132 (drive->dev_flags & IDE_DFLAG_PRESENT) == 0) in ht6560b_dev_select()
150 drive->name, select, timing); in ht6560b_dev_select()
155 outb(drive->select | ATA_DEVICE_OBS, hwif->io_ports.device_addr); in ht6560b_dev_select()
199 static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio) in ht_pio2timings() argument
209 cycle_time = ide_pio_cycle_time(drive, pio); in ht_pio2timings()
232 …printk("ht6560b: drive %s setting pio=%d recovery=%d (%dns) active=%d (%dns)\n", drive->name, pio,… in ht_pio2timings()
239 printk("ht6560b: drive %s setting pio=0\n", drive->name); in ht_pio2timings()
251 static void ht_set_prefetch(ide_drive_t *drive, u8 state) in ht_set_prefetch() argument
258 config = (unsigned long)ide_get_drivedata(drive); in ht_set_prefetch()
265 drive->dev_flags |= IDE_DFLAG_NO_UNMASK; in ht_set_prefetch()
266 drive->dev_flags &= ~IDE_DFLAG_UNMASK; in ht_set_prefetch()
269 drive->dev_flags &= ~IDE_DFLAG_NO_UNMASK; in ht_set_prefetch()
272 ide_set_drivedata(drive, (void *)config); in ht_set_prefetch()
277 printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis")); in ht_set_prefetch()
281 static void ht6560b_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) in ht6560b_set_pio_mode() argument
284 const u8 pio = drive->pio_mode - XFER_PIO_0; in ht6560b_set_pio_mode()
290 ht_set_prefetch(drive, pio & 1); in ht6560b_set_pio_mode()
294 timing = ht_pio2timings(drive, pio); in ht6560b_set_pio_mode()
297 config = (unsigned long)ide_get_drivedata(drive); in ht6560b_set_pio_mode()
300 ide_set_drivedata(drive, (void *)config); in ht6560b_set_pio_mode()
304 printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); in ht6560b_set_pio_mode()
308 static void __init ht6560b_init_dev(ide_drive_t *drive) in ht6560b_init_dev() argument
310 ide_hwif_t *hwif = drive->hwif; in ht6560b_init_dev()
317 ide_set_drivedata(drive, (void *)t); in ht6560b_init_dev()