Lines Matching refs:index

397 static void __init check_prefetch (unsigned int index)  in check_prefetch()  argument
399 ide_drive_t *drive = cmd_drives[index]; in check_prefetch()
400 u8 b = get_cmd640_reg(prefetch_regs[index]); in check_prefetch()
402 if (b & prefetch_masks[index]) { /* is prefetch off? */ in check_prefetch()
444 static void set_prefetch_mode (unsigned int index, int mode) in set_prefetch_mode() argument
446 ide_drive_t *drive = cmd_drives[index]; in set_prefetch_mode()
447 int reg = prefetch_regs[index]; in set_prefetch_mode()
459 b &= ~prefetch_masks[index]; /* enable prefetch */ in set_prefetch_mode()
464 b |= prefetch_masks[index]; /* disable prefetch */ in set_prefetch_mode()
473 static void display_clocks (unsigned int index) in display_clocks() argument
477 active_count = active_counts[index]; in display_clocks()
480 recovery_count = recovery_counts[index]; in display_clocks()
485 printk(", clocks=%d/%d/%d\n", setup_counts[index], active_count, recovery_count); in display_clocks()
500 static void __init retrieve_drive_counts (unsigned int index) in retrieve_drive_counts() argument
507 b = get_cmd640_reg(arttim_regs[index]) & ~0x3f; in retrieve_drive_counts()
514 setup_counts[index] = b; in retrieve_drive_counts()
519 b = get_cmd640_reg(drwtim_regs[index]); in retrieve_drive_counts()
520 active_counts[index] = (b >> 4) ? (b >> 4) : 0x10; in retrieve_drive_counts()
521 recovery_counts[index] = (b & 0x0f) ? (b & 0x0f) : 0x10; in retrieve_drive_counts()
529 static void program_drive_counts (unsigned int index) in program_drive_counts() argument
532 u8 setup_count = setup_counts[index]; in program_drive_counts()
533 u8 active_count = active_counts[index]; in program_drive_counts()
534 u8 recovery_count = recovery_counts[index]; in program_drive_counts()
542 if (index > 1) { in program_drive_counts()
544 if (cmd_drives[mate = index ^ 1]->present) { in program_drive_counts()
574 setup_count |= __get_cmd640_reg(arttim_regs[index]) & 0x3f; in program_drive_counts()
575 __put_cmd640_reg(arttim_regs[index], setup_count); in program_drive_counts()
576 __put_cmd640_reg(drwtim_regs[index], pack_nibbles(active_count, recovery_count)); in program_drive_counts()
583 static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle_time) in cmd640_set_mode() argument
620 setup_counts[index] = setup_count; in cmd640_set_mode()
621 active_counts[index] = active_count; in cmd640_set_mode()
622 recovery_counts[index] = recovery_count; in cmd640_set_mode()
632 program_drive_counts (index); in cmd640_set_mode()
642 unsigned int index = 0; in cmd640_tune_drive() local
644 while (drive != cmd_drives[index]) { in cmd640_tune_drive()
645 if (++index > 3) { in cmd640_tune_drive()
664 set_prefetch_mode(index, mode_wanted); in cmd640_tune_drive()
670 cmd640_set_mode (index, d.pio_mode, d.cycle_time); in cmd640_tune_drive()
677 display_clocks(index); in cmd640_tune_drive()
728 unsigned int index; in ide_probe_for_cmd640x() local
841 for (index = 0; index < (2 + (second_port_cmd640 << 1)); index++) { in ide_probe_for_cmd640x()
842 ide_drive_t *drive = cmd_drives[index]; in ide_probe_for_cmd640x()
844 if (drive->autotune || ((index > 1) && second_port_toggled)) { in ide_probe_for_cmd640x()
849 setup_counts [index] = 4; /* max possible */ in ide_probe_for_cmd640x()
850 active_counts [index] = 16; /* max possible */ in ide_probe_for_cmd640x()
851 recovery_counts [index] = 16; /* max possible */ in ide_probe_for_cmd640x()
852 program_drive_counts (index); in ide_probe_for_cmd640x()
853 set_prefetch_mode (index, 0); in ide_probe_for_cmd640x()
854 printk("cmd640: drive%d timings/prefetch cleared\n", index); in ide_probe_for_cmd640x()
860 retrieve_drive_counts (index); in ide_probe_for_cmd640x()
861 check_prefetch (index); in ide_probe_for_cmd640x()
863 index, drive->no_io_32bit ? "off" : "on"); in ide_probe_for_cmd640x()
864 display_clocks(index); in ide_probe_for_cmd640x()
870 check_prefetch (index); in ide_probe_for_cmd640x()
872 index, drive->no_io_32bit ? "off" : "on"); in ide_probe_for_cmd640x()