Lines Matching refs:current_drive

153 	pr_info("floppy%d: " format, current_drive, ##args)
588 static unsigned char current_drive;
630 if (drive_params[current_drive].flags & DEBUGT)
854 * Both current_drive and current_fdc are changed to match the new drive.
880 current_drive = drive;
886 * Both current_drive and current_fdc are changed to match the new drive.
965 if (drive_params[current_drive].select_delay)
968 saved_drive = current_drive;
1028 debug_dcl(drive_params[current_drive].flags,
1031 if (disk_change(current_drive)) {
1450 &drive_state[current_drive].flags);
1455 &drive_state[current_drive].flags);
1457 if (drive_params[current_drive].flags & FTD_MSG)
1460 } else if (floppy_errors >= drive_params[current_drive].max_errors.reporting) {
1465 drive_state[current_drive].track = NEED_2_RECAL;
1498 ready_date = drive_state[current_drive].spinup_date + drive_params[current_drive].spinup;
1503 if (time_after(ready_date, jiffies + drive_params[current_drive].select_delay)) {
1504 ready_date -= drive_params[current_drive].select_delay;
1549 drive_state[current_drive].track = NEED_2_RECAL;
1554 if (drive_state[current_drive].track >= 0 &&
1555 drive_state[current_drive].track != reply_buffer[ST1] &&
1557 debug_dcl(drive_params[current_drive].flags,
1559 debug_dcl(drive_params[current_drive].flags, "jiffies=%lu\n",
1562 &drive_state[current_drive].flags);
1564 drive_state[current_drive].select_date = jiffies;
1566 drive_state[current_drive].track = reply_buffer[ST1];
1602 debug_dcl(drive_params[current_drive].flags,
1605 if (!test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) &&
1606 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) {
1612 &drive_state[current_drive].flags);
1617 if (drive_state[current_drive].track <= NEED_1_RECAL) {
1620 } else if (test_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags) &&
1622 (drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->track)) {
1628 if (drive_params[current_drive].flags & FD_SILENT_DCL_CLEAR) {
1629 set_dor(current_fdc, ~(0x10 << UNIT(current_drive)), 0);
1636 check_wp(current_fdc, current_drive);
1637 if (raw_cmd->track != drive_state[current_drive].track &&
1648 output_byte(current_fdc, UNIT(current_drive));
1662 switch (drive_state[current_drive].track) {
1680 debug_dcl(drive_params[current_drive].flags,
1684 &drive_state[current_drive].flags);
1685 drive_state[current_drive].select_date = jiffies;
1695 drive_state[current_drive].track = NEED_1_RECAL;
1699 drive_state[current_drive].track = reply_buffer[ST1];
1761 } while ((reply_buffer[ST0] & 0x83) != UNIT(current_drive) &&
1780 if (output_byte(current_fdc, UNIT(current_drive)) < 0)
1907 data = UNIT(current_drive);
1909 if (!(fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))) {
1912 drive_state[current_drive].first_read_date = 0;
1914 drive_state[current_drive].spinup_date = jiffies;
1915 data |= (0x10 << UNIT(current_drive));
1917 } else if (fdc_state[current_fdc].dor & (0x10 << UNIT(current_drive)))
1918 mask &= ~(0x10 << UNIT(current_drive));
1921 del_timer(motor_off_timer + current_drive);
1925 return fd_wait_for_completion(drive_state[current_drive].select_date + drive_params[current_drive].select_delay,
1940 debug_dcl(drive_params[current_drive].flags,
1943 disk_change(current_drive) && !drive_params[current_drive].select_delay)
1944 twaddle(current_fdc, current_drive); /* this clears the dcl on certain
1957 fdc_specify(current_fdc, current_drive); /* must be done here because of hut, hlt ... */
1962 fdc_specify(current_fdc, current_drive);
1969 reschedule_timeout(current_drive, "floppy start");
1972 debug_dcl(drive_params[current_drive].flags,
1974 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags);
2096 drive_state[current_drive].probed_format++;
2097 if (!next_valid_format(current_drive))
2101 INFBOUND(write_errors[current_drive].badness, err_count);
2102 if (err_count > drive_params[current_drive].max_errors.abort)
2104 if (err_count > drive_params[current_drive].max_errors.reset)
2106 else if (err_count > drive_params[current_drive].max_errors.recal)
2107 drive_state[current_drive].track = NEED_2_RECAL;
2160 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, format_req.head);
2237 _floppy->track > drive_params[current_drive].tracks ||
2298 INFBOUND(drive_state[current_drive].maxblock, block);
2300 drive_state[current_drive].maxtrack = 1;
2306 write_errors[current_drive].write_errors++;
2307 if (write_errors[current_drive].write_errors == 1) {
2308 write_errors[current_drive].first_error_sector = blk_rq_pos(req);
2309 write_errors[current_drive].first_error_generation = drive_state[current_drive].generation;
2311 write_errors[current_drive].last_error_sector = blk_rq_pos(req);
2312 write_errors[current_drive].last_error_generation = drive_state[current_drive].generation;
2333 if (!drive_state[current_drive].first_read_date)
2334 drive_state[current_drive].first_read_date = jiffies;
2388 current_type[current_drive] = _floppy;
2389 floppy_sizes[TOMINOR(current_drive)] = _floppy->size;
2394 if (drive_params[current_drive].flags & FTD_MSG)
2396 _floppy->name, current_drive);
2397 current_type[current_drive] = _floppy;
2398 floppy_sizes[TOMINOR(current_drive)] = _floppy->size;
2407 buffer_drive = current_drive;
2582 test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags)) &&
2608 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, raw_cmd->cmd[HEAD]);
2646 (current_drive == buffer_drive) &&
2673 buffer_drive != current_drive || /* bad drive */
2682 buffer_drive = current_drive;
2696 buffer_drive = current_drive;
2779 if (current_drive < N_DRIVE)
2780 floppy_off(current_drive);
2796 reschedule_timeout(current_drive, "redo fd request");
2804 disk_change(current_drive);
2805 if (test_bit(current_drive, &fake_change) ||
2806 test_bit(FD_DISK_CHANGED_BIT, &drive_state[current_drive].flags)) {
2813 drive_state[current_drive].probed_format = 0;
2814 if (next_valid_format(current_drive)) {
2822 _floppy = floppy_type + drive_params[current_drive].autodetect[drive_state[current_drive].probed_format];
2831 if (test_bit(FD_NEED_TWADDLE_BIT, &drive_state[current_drive].flags))
2832 twaddle(current_fdc, current_drive);
2901 debug_dcl(drive_params[current_drive].flags,
2903 set_bit(FD_DISK_NEWCHANGE_BIT, &drive_state[current_drive].flags);
2927 * Both current_drive and current_fdc are changed to match the new drive.
3010 if (disk_change(current_drive))
3015 motor_off_callback(&motor_off_timer[current_drive]);
3148 if (drive == current_drive) {
3171 debug_dcl(drive_params[current_drive].flags,
3177 drive_state[current_drive].track = NO_TRACK;
3283 drive_state[current_drive].keep_data = -1;
3285 drive_state[current_drive].keep_data = 1;
3291 if (drive_state[current_drive].maxblock > user_params[drive].sect ||
3292 drive_state[current_drive].maxtrack ||
3561 twaddle(current_fdc, current_drive);
4355 int current_drive = 0;
4361 current_drive = ints[1];
4362 if (current_drive < 0 || current_drive >= 8) {
4367 if (current_drive >= 4 && !FDC2)
4370 drive_params[current_drive].cmos = ints[2];
4480 saved_drive = current_drive;
4714 current_drive = 0;