Lines Matching defs:current_drive
151 pr_info("floppy%d: " format, current_drive, ##args)
584 static unsigned char current_drive;
626 if (drive_params[current_drive].flags & DEBUGT)
850 * Both current_drive and current_fdc are changed to match the new drive.
876 current_drive = drive;
882 * Both current_drive and current_fdc are changed to match the new drive.
961 if (drive_params[current_drive].select_delay)
964 saved_drive = current_drive;
1024 debug_dcl(drive_params[current_drive].flags,
1027 if (disk_change(current_drive)) {
1446 &drive_state[current_drive].flags);
1451 &drive_state[current_drive].flags);
1453 if (drive_params[current_drive].flags & FTD_MSG)
1456 } else if (floppy_errors >= drive_params[current_drive].max_errors.reporting) {
1461 drive_state[current_drive].track = NEED_2_RECAL;
1494 ready_date = drive_state[current_drive].spinup_date + drive_params[current_drive].spinup;
1499 if (time_after(ready_date, jiffies + drive_params[current_drive].select_delay)) {
1500 ready_date -= drive_params[current_drive].select_delay;
1545 drive_state[current_drive].track = NEED_2_RECAL;
1550 if (drive_state[current_drive].track >= 0 &&
1551 drive_state[current_drive].track != reply_buffer[ST1] &&
1553 debug_dcl(drive_params[current_drive].flags,
1555 debug_dcl(drive_params[current_drive].flags, "jiffies=%lu\n",
1558 &drive_state[current_drive].flags);
1560 drive_state[current_drive].select_date = jiffies;
1562 drive_state[current_drive].track = reply_buffer[ST1];
1598 debug_dcl(drive_params[current_drive].flags,
1601 if (!test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) &&
1602 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) {
1608 &drive_state[current_drive].flags);
1613 if (drive_state[current_drive].track <= NEED_1_RECAL) {
1616 } else if (test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) &&
1618 (drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->track)) {
1624 if (drive_params[current_drive].flags & FD_SILENT_DCL_CLEAR) {
1625 set_dor(current_fdc, ~(0x10 << UNIT(current_drive)), 0);
1632 check_wp(current_fdc, current_drive);
1633 if (raw_cmd->track != drive_state[current_drive].track &&
1644 output_byte(current_fdc, UNIT(current_drive));
1658 switch (drive_state[current_drive].track) {
1676 debug_dcl(drive_params[current_drive].flags,
1680 &drive_state[current_drive].flags);
1681 drive_state[current_drive].select_date = jiffies;
1691 drive_state[current_drive].track = NEED_1_RECAL;
1695 drive_state[current_drive].track = reply_buffer[ST1];
1757 } while ((reply_buffer[ST0] & 0x83) != UNIT(current_drive) &&
1776 if (output_byte(current_fdc, UNIT(current_drive)) < 0)
1903 data = UNIT(current_drive);
1905 if (!(fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))) {
1908 drive_state[current_drive].first_read_date = 0;
1910 drive_state[current_drive].spinup_date = jiffies;
1911 data |= (0x10 << UNIT(current_drive));
1913 } else if (fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))
1914 mask &= ~(0x10 << UNIT(current_drive));
1917 timer_delete(motor_off_timer + current_drive);
1921 return fd_wait_for_completion(drive_state[current_drive].select_date + drive_params[current_drive].select_delay,
1936 debug_dcl(drive_params[current_drive].flags,
1939 disk_change(current_drive) && !drive_params[current_drive].select_delay)
1940 twaddle(current_fdc, current_drive); /* this clears the dcl on certain
1953 fdc_specify(current_fdc, current_drive); /* must be done here because of hut, hlt ... */
1958 fdc_specify(current_fdc, current_drive);
1965 reschedule_timeout(current_drive, "floppy start");
1968 debug_dcl(drive_params[current_drive].flags,
1970 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags);
2092 drive_state[current_drive].probed_format++;
2093 if (!next_valid_format(current_drive))
2097 INFBOUND(write_errors[current_drive].badness, err_count);
2098 if (err_count > drive_params[current_drive].max_errors.abort)
2100 if (err_count > drive_params[current_drive].max_errors.reset)
2102 else if (err_count > drive_params[current_drive].max_errors.recal)
2103 drive_state[current_drive].track = NEED_2_RECAL;
2156 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, format_req.head);
2233 _floppy->track > drive_params[current_drive].tracks ||
2294 INFBOUND(drive_state[current_drive].maxblock, block);
2296 drive_state[current_drive].maxtrack = 1;
2302 write_errors[current_drive].write_errors++;
2303 if (write_errors[current_drive].write_errors == 1) {
2304 write_errors[current_drive].first_error_sector = blk_rq_pos(req);
2305 write_errors[current_drive].first_error_generation = drive_state[current_drive].generation;
2307 write_errors[current_drive].last_error_sector = blk_rq_pos(req);
2308 write_errors[current_drive].last_error_generation = drive_state[current_drive].generation;
2329 if (!drive_state[current_drive].first_read_date)
2330 drive_state[current_drive].first_read_date = jiffies;
2384 current_type[current_drive] = _floppy;
2385 floppy_sizes[TOMINOR(current_drive)] = _floppy->size;
2390 if (drive_params[current_drive].flags & FTD_MSG)
2392 _floppy->name, current_drive);
2393 current_type[current_drive] = _floppy;
2394 floppy_sizes[TOMINOR(current_drive)] = _floppy->size;
2403 buffer_drive = current_drive;
2578 test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) &&
2604 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, raw_cmd->cmd[HEAD]);
2642 (current_drive == buffer_drive) &&
2669 buffer_drive != current_drive || /* bad drive */
2678 buffer_drive = current_drive;
2692 buffer_drive = current_drive;
2775 if (current_drive < N_DRIVE)
2776 floppy_off(current_drive);
2792 reschedule_timeout(current_drive, "redo fd request");
2800 disk_change(current_drive);
2801 if (test_bit(current_drive, &fake_change) ||
2802 test_bit(FD_DISK_CHANGED_BIT, &drive_state[current_drive].flags)) {
2809 drive_state[current_drive].probed_format = 0;
2810 if (next_valid_format(current_drive)) {
2818 _floppy = floppy_type + drive_params[current_drive].autodetect[drive_state[current_drive].probed_format];
2827 if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags))
2828 twaddle(current_fdc, current_drive);
2897 debug_dcl(drive_params[current_drive].flags,
2899 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags);
2923 * Both current_drive and current_fdc are changed to match the new drive.
3006 if (disk_change(current_drive))
3011 motor_off_callback(&motor_off_timer[current_drive]);
3141 if (drive == current_drive) {
3164 debug_dcl(drive_params[current_drive].flags,
3170 drive_state[current_drive].track = NO_TRACK;
3276 drive_state[current_drive].keep_data = -1;
3278 drive_state[current_drive].keep_data = 1;
3284 if (drive_state[current_drive].maxblock > user_params[drive].sect ||
3285 drive_state[current_drive].maxtrack ||
3554 twaddle(current_fdc, current_drive);
4348 int current_drive = 0;
4354 current_drive = ints[1];
4355 if (current_drive < 0 || current_drive >= 8) {
4360 if (current_drive >= 4 && !FDC2)
4363 drive_params[current_drive].cmos = ints[2];
4473 saved_drive = current_drive;
4707 current_drive = 0;