Lines Matching refs:current_drive
155 pr_info("floppy%d: " format, current_drive, ##args)
590 static unsigned char current_drive; variable
632 if (drive_params[current_drive].flags & DEBUGT) in debugt()
882 current_drive = drive; in set_fdc()
967 if (drive_params[current_drive].select_delay) in scandrives()
970 saved_drive = current_drive; in scandrives()
1026 debug_dcl(drive_params[current_drive].flags, in fd_watchdog()
1029 if (disk_change(current_drive)) { in fd_watchdog()
1448 &drive_state[current_drive].flags); in interpret_errors()
1453 &drive_state[current_drive].flags); in interpret_errors()
1455 if (drive_params[current_drive].flags & FTD_MSG) in interpret_errors()
1458 } else if (*errors >= drive_params[current_drive].max_errors.reporting) { in interpret_errors()
1463 drive_state[current_drive].track = NEED_2_RECAL; in interpret_errors()
1496 ready_date = drive_state[current_drive].spinup_date + drive_params[current_drive].spinup; in setup_rw_floppy()
1501 if (time_after(ready_date, jiffies + drive_params[current_drive].select_delay)) { in setup_rw_floppy()
1502 ready_date -= drive_params[current_drive].select_delay; in setup_rw_floppy()
1547 drive_state[current_drive].track = NEED_2_RECAL; in seek_interrupt()
1552 if (drive_state[current_drive].track >= 0 && in seek_interrupt()
1553 drive_state[current_drive].track != reply_buffer[ST1] && in seek_interrupt()
1555 debug_dcl(drive_params[current_drive].flags, in seek_interrupt()
1557 debug_dcl(drive_params[current_drive].flags, "jiffies=%lu\n", in seek_interrupt()
1560 &drive_state[current_drive].flags); in seek_interrupt()
1562 drive_state[current_drive].select_date = jiffies; in seek_interrupt()
1564 drive_state[current_drive].track = reply_buffer[ST1]; in seek_interrupt()
1600 debug_dcl(drive_params[current_drive].flags, in seek_floppy()
1603 if (!test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) && in seek_floppy()
1604 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) { in seek_floppy()
1610 &drive_state[current_drive].flags); in seek_floppy()
1615 if (drive_state[current_drive].track <= NEED_1_RECAL) { in seek_floppy()
1618 } else if (test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) && in seek_floppy()
1620 …(drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->trac… in seek_floppy()
1626 if (drive_params[current_drive].flags & FD_SILENT_DCL_CLEAR) { in seek_floppy()
1627 set_dor(current_fdc, ~(0x10 << UNIT(current_drive)), 0); in seek_floppy()
1634 check_wp(current_fdc, current_drive); in seek_floppy()
1635 if (raw_cmd->track != drive_state[current_drive].track && in seek_floppy()
1646 output_byte(current_fdc, UNIT(current_drive)); in seek_floppy()
1660 switch (drive_state[current_drive].track) { in recal_interrupt()
1678 debug_dcl(drive_params[current_drive].flags, in recal_interrupt()
1682 &drive_state[current_drive].flags); in recal_interrupt()
1683 drive_state[current_drive].select_date = jiffies; in recal_interrupt()
1693 drive_state[current_drive].track = NEED_1_RECAL; in recal_interrupt()
1697 drive_state[current_drive].track = reply_buffer[ST1]; in recal_interrupt()
1759 } while ((reply_buffer[ST0] & 0x83) != UNIT(current_drive) && in floppy_interrupt()
1778 if (output_byte(current_fdc, UNIT(current_drive)) < 0) in recalibrate_floppy()
1905 data = UNIT(current_drive); in start_motor()
1907 if (!(fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))) { in start_motor()
1910 drive_state[current_drive].first_read_date = 0; in start_motor()
1912 drive_state[current_drive].spinup_date = jiffies; in start_motor()
1913 data |= (0x10 << UNIT(current_drive)); in start_motor()
1915 } else if (fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive))) in start_motor()
1916 mask &= ~(0x10 << UNIT(current_drive)); in start_motor()
1919 del_timer(motor_off_timer + current_drive); in start_motor()
1923 …return fd_wait_for_completion(drive_state[current_drive].select_date + drive_params[current_drive]… in start_motor()
1938 debug_dcl(drive_params[current_drive].flags, in floppy_ready()
1941 disk_change(current_drive) && !drive_params[current_drive].select_delay) in floppy_ready()
1942 twaddle(current_fdc, current_drive); /* this clears the dcl on certain in floppy_ready()
1955 fdc_specify(current_fdc, current_drive); /* must be done here because of hut, hlt ... */ in floppy_ready()
1960 fdc_specify(current_fdc, current_drive); in floppy_ready()
1967 reschedule_timeout(current_drive, "floppy start"); in floppy_start()
1970 debug_dcl(drive_params[current_drive].flags, in floppy_start()
1972 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags); in floppy_start()
2094 drive_state[current_drive].probed_format++; in bad_flp_intr()
2095 if (!next_valid_format(current_drive)) in bad_flp_intr()
2099 INFBOUND(write_errors[current_drive].badness, err_count); in bad_flp_intr()
2100 if (err_count > drive_params[current_drive].max_errors.abort) in bad_flp_intr()
2102 if (err_count > drive_params[current_drive].max_errors.reset) in bad_flp_intr()
2104 else if (err_count > drive_params[current_drive].max_errors.recal) in bad_flp_intr()
2105 drive_state[current_drive].track = NEED_2_RECAL; in bad_flp_intr()
2157 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, format_req.head); in setup_format_params()
2234 _floppy->track > drive_params[current_drive].tracks || in do_format()
2296 INFBOUND(drive_state[current_drive].maxblock, block); in request_done()
2298 drive_state[current_drive].maxtrack = 1; in request_done()
2304 write_errors[current_drive].write_errors++; in request_done()
2305 if (write_errors[current_drive].write_errors == 1) { in request_done()
2306 write_errors[current_drive].first_error_sector = blk_rq_pos(req); in request_done()
2307 write_errors[current_drive].first_error_generation = drive_state[current_drive].generation; in request_done()
2309 write_errors[current_drive].last_error_sector = blk_rq_pos(req); in request_done()
2310 write_errors[current_drive].last_error_generation = drive_state[current_drive].generation; in request_done()
2331 if (!drive_state[current_drive].first_read_date) in rw_interrupt()
2332 drive_state[current_drive].first_read_date = jiffies; in rw_interrupt()
2387 current_type[current_drive] = _floppy; in rw_interrupt()
2388 floppy_sizes[TOMINOR(current_drive)] = _floppy->size; in rw_interrupt()
2393 if (drive_params[current_drive].flags & FTD_MSG) in rw_interrupt()
2395 _floppy->name, current_drive); in rw_interrupt()
2396 current_type[current_drive] = _floppy; in rw_interrupt()
2397 floppy_sizes[TOMINOR(current_drive)] = _floppy->size; in rw_interrupt()
2407 buffer_drive = current_drive; in rw_interrupt()
2608 test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) && in make_raw_rw_request()
2634 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, raw_cmd->cmd[HEAD]); in make_raw_rw_request()
2672 (current_drive == buffer_drive) && in make_raw_rw_request()
2724 *errors < drive_params[current_drive].max_errors.read_track && in make_raw_rw_request()
2726 … (drive_params[current_drive].read_track & (1 << drive_state[current_drive].probed_format)))))) { in make_raw_rw_request()
2747 buffer_drive != current_drive || /* bad drive */ in make_raw_rw_request()
2756 buffer_drive = current_drive; in make_raw_rw_request()
2770 buffer_drive = current_drive; in make_raw_rw_request()
2864 if (current_drive < N_DRIVE) in redo_fd_request()
2865 floppy_off(current_drive); in redo_fd_request()
2882 reschedule_timeout(current_drive, "redo fd request"); in redo_fd_request()
2890 disk_change(current_drive); in redo_fd_request()
2891 if (test_bit(current_drive, &fake_change) || in redo_fd_request()
2892 test_bit(FD_DISK_CHANGED_BIT, &drive_state[current_drive].flags)) { in redo_fd_request()
2899 drive_state[current_drive].probed_format = 0; in redo_fd_request()
2900 if (next_valid_format(current_drive)) { in redo_fd_request()
2908 …_floppy = floppy_type + drive_params[current_drive].autodetect[drive_state[current_drive].probed_f… in redo_fd_request()
2918 if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) in redo_fd_request()
2919 twaddle(current_fdc, current_drive); in redo_fd_request()
2988 debug_dcl(drive_params[current_drive].flags, in poll_drive()
2990 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags); in poll_drive()
3098 if (disk_change(current_drive)) in raw_cmd_done()
3103 motor_off_callback(&motor_off_timer[current_drive]); in raw_cmd_done()
3236 if (drive == current_drive) { in raw_cmd_ioctl()
3259 debug_dcl(drive_params[current_drive].flags, in raw_cmd_ioctl()
3265 drive_state[current_drive].track = NO_TRACK; in raw_cmd_ioctl()
3339 drive_state[current_drive].keep_data = -1; in set_geometry()
3341 drive_state[current_drive].keep_data = 1; in set_geometry()
3347 if (drive_state[current_drive].maxblock > user_params[drive].sect || in set_geometry()
3348 drive_state[current_drive].maxtrack || in set_geometry()
3626 twaddle(current_fdc, current_drive); in fd_locked_ioctl()
4422 int current_drive = 0; in set_cmos() local
4428 current_drive = ints[1]; in set_cmos()
4429 if (current_drive < 0 || current_drive >= 8) { in set_cmos()
4434 if (current_drive >= 4 && !FDC2) in set_cmos()
4437 drive_params[current_drive].cmos = ints[2]; in set_cmos()
4547 saved_drive = current_drive; in floppy_resume()
4743 current_drive = 0; in do_floppy_init()