Lines Matching full:drive
12 * - Disk change detection and drive deselecting after motor-off
15 * don't have an HD drive :-(
20 * - Removed drive type (unknown on atari)
43 * - Let user set max. supported drive type (speeds up format
177 { "D360", 9, 720, 0, 1}, /* 1: 360kb in 720k or 1.2MB drive */
178 { "D720", 9,1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */
275 * MSch: User-provided type information. 'drive' points to
281 * User-provided permanent type information. 'drive' points to
290 int connected; /* !=0 : drive is connected */
309 #define UD unit[drive]
310 #define UDT unit[drive].disktype
367 #define IS_BUFFERED(drive,side,track) \ argument
368 (BufferDrive == (drive) && BufferSide == (side) && BufferTrack == (track))
395 #define RECALIBRATE_ERRORS 4 /* After this many errors the drive
423 static void fd_select_drive( int drive );
429 static int do_format(int drive, int type, struct atari_format_descr *desc);
430 static void do_fd_action( int drive );
444 static void setup_req_params( int drive );
447 static void fd_probe( int drive );
448 static int fd_test_drive_present( int drive );
517 /* Select a drive, update the FDC's track register and set the correct
521 static void fd_select_drive( int drive ) in fd_select_drive() argument
526 if (drive == SelectedDrive) in fd_select_drive()
533 sound_ym.wd_data = (tmp | DSKDRVNONE) & ~(drive == 0 ? DSKDRV0 : DSKDRV1); in fd_select_drive()
546 SelectedDrive = drive; in fd_select_drive()
562 /* On Falcon, the drive B select line is used on the printer port, so in fd_deselect()
571 * counts the index signals, which arrive only if one drive is selected.
579 /* no drive selected, needn't deselect anyone */ in fd_motor_off_timer()
597 * in the drive and the FDC will leave the motor on forever (or, in fd_motor_off_timer()
612 static int drive = 0; in check_change() local
618 if (++drive > 1 || !UD.connected) in check_change()
619 drive = 0; in check_change()
628 ~(drive == 0 ? DSKDRV0 : DSKDRV1); in check_change()
633 DPRINT(( "wpstat[%d] = %d\n", drive, stat )); in check_change()
635 set_bit (drive, &changed_floppies); in check_change()
743 static int do_format(int drive, int type, struct atari_format_descr *desc) in do_format() argument
760 q = unit[drive].disk[type]->queue; in do_format()
812 do_fd_action( drive ); in do_format()
826 * required parameter settings (drive select, side select, track
834 static void do_fd_action( int drive ) in do_fd_action() argument
840 if (IS_BUFFERED( drive, ReqSide, ReqTrack )) { in do_fd_action()
845 setup_req_params( drive ); in do_fd_action()
863 if (SelectedDrive != drive) in do_fd_action()
864 fd_select_drive( drive ); in do_fd_action()
919 /* Seek the drive to the requested track. The drive must have been
1421 * Because the "Drive ready" signal isn't present in the Atari
1439 unsigned int drive = p - unit; in floppy_check_events() local
1440 if (test_bit (drive, &fake_change)) { in floppy_check_events()
1444 if (test_bit (drive, &changed_floppies)) { in floppy_check_events()
1461 unsigned int drive = p - unit; in floppy_revalidate() local
1463 if (test_bit(drive, &changed_floppies) || in floppy_revalidate()
1464 test_bit(drive, &fake_change) || !p->disktype) { in floppy_revalidate()
1468 clear_bit(drive, &fake_change); in floppy_revalidate()
1469 clear_bit(drive, &changed_floppies); in floppy_revalidate()
1473 if (default_params[drive].blocks == 0) in floppy_revalidate()
1476 UDT = &default_params[drive]; in floppy_revalidate()
1484 static void setup_req_params( int drive ) in setup_req_params() argument
1495 read_track = (ReqCmd == READ && unit[drive].error_count == 0); in setup_req_params()
1507 int drive = floppy - unit; in ataflop_queue_rq() local
1510 DPRINT(("Queue request: drive %d type %d sectors %d of %d last %d\n", in ataflop_queue_rq()
1511 drive, type, blk_rq_cur_sectors(bd->rq), in ataflop_queue_rq()
1524 unit[drive].error_count = 0; in ataflop_queue_rq()
1532 /* drive not connected */ in ataflop_queue_rq()
1533 printk(KERN_ERR "Unknown Device: fd%d\n", drive ); in ataflop_queue_rq()
1550 printk(KERN_WARNING "fd%d: invalid disk format", drive ); in ataflop_queue_rq()
1556 printk(KERN_WARNING "fd%d: unsupported disk format", drive ); in ataflop_queue_rq()
1574 setup_req_params( drive ); in ataflop_queue_rq()
1575 do_fd_action( drive ); in ataflop_queue_rq()
1589 int drive = floppy - unit; in fd_locked_ioctl() local
1609 drive, dtp, dtp->name); in fd_locked_ioctl()
1633 * Currently, the drive geometry is cleared after each in fd_locked_ioctl()
1654 drive, setprm.size, setprm.sect, setprm.stretch); in fd_locked_ioctl()
1673 /* skip this one, invalid for drive ... */ in fd_locked_ioctl()
1685 drive, dtp->name, dtp); in fd_locked_ioctl()
1691 default_params[drive].name = dtp->name; in fd_locked_ioctl()
1692 default_params[drive].spt = dtp->spt; in fd_locked_ioctl()
1693 default_params[drive].blocks = dtp->blocks; in fd_locked_ioctl()
1694 default_params[drive].fdc_speed = dtp->fdc_speed; in fd_locked_ioctl()
1695 default_params[drive].stretch = dtp->stretch; in fd_locked_ioctl()
1707 dtp = &default_params[drive]; in fd_locked_ioctl()
1710 dtp = &user_params[drive]; in fd_locked_ioctl()
1723 drive, dtp->blocks, dtp->spt, dtp->stretch); in fd_locked_ioctl()
1751 return do_format(drive, type, &fmt_desc); in fd_locked_ioctl()
1755 default_params[drive].blocks = 0; in fd_locked_ioctl()
1762 set_bit(drive, &fake_change); in fd_locked_ioctl()
1785 /* Initialize the 'unit' variable for drive 'drive' */
1787 static void __init fd_probe( int drive ) in fd_probe() argument
1792 if (!fd_test_drive_present( drive )) in fd_probe()
1797 switch( UserSteprate[drive] ) { in fd_probe()
1821 /* This function tests the physical presence of a floppy drive (not
1825 * signal. This should now be raised if there is a drive connected
1826 * (and there is no hardware failure :-) Otherwise, the drive is
1830 static int __init fd_test_drive_present( int drive ) in fd_test_drive_present() argument
1836 if (drive >= (MACH_IS_FALCON ? 1 : 2)) return( 0 ); in fd_test_drive_present()
1837 fd_select_drive( drive ); in fd_test_drive_present()
1879 int drive, cnt = 0; in config_types() local
1885 printk(KERN_INFO "Probing floppy drive(s):\n"); in config_types()
1886 for( drive = 0; drive < FD_MAX_UNITS; drive++ ) { in config_types()
1887 fd_probe( drive ); in config_types()
1889 printk(KERN_INFO "fd%d\n", drive); in config_types()
1917 * drive with different device numbers.
1993 static int ataflop_alloc_disk(unsigned int drive, unsigned int type) in ataflop_alloc_disk() argument
2000 disk = blk_mq_alloc_disk(&unit[drive].tag_set, &lim, NULL); in ataflop_alloc_disk()
2005 disk->first_minor = drive + (type << 2); in ataflop_alloc_disk()
2007 sprintf(disk->disk_name, "fd%d", drive); in ataflop_alloc_disk()
2011 disk->private_data = &unit[drive]; in ataflop_alloc_disk()
2014 unit[drive].disk[type] = disk; in ataflop_alloc_disk()
2020 int drive = MINOR(dev) & 3; in ataflop_probe() local
2026 if (drive >= FD_MAX_UNITS || type >= NUM_DISK_MINORS) in ataflop_probe()
2028 if (unit[drive].disk[type]) in ataflop_probe()
2030 if (ataflop_alloc_disk(drive, type)) in ataflop_probe()
2032 if (add_disk(unit[drive].disk[type])) in ataflop_probe()
2034 unit[drive].registered[type] = true; in ataflop_probe()
2038 put_disk(unit[drive].disk[type]); in ataflop_probe()
2039 unit[drive].disk[type] = NULL; in ataflop_probe()
2175 printk(KERN_ERR "ataflop_setup: bad drive type\n" ); in atari_floppy_setup()