Lines Matching refs: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
176 { "D360", 9, 720, 0, 1}, /* 1: 360kb in 720k or 1.2MB drive */
177 { "D720", 9,1440, 0, 0}, /* 2: 720kb in 720k or 1.2MB drive */
274 * MSch: User-provided type information. 'drive' points to
280 * User-provided permanent type information. 'drive' points to
289 int connected; /* !=0 : drive is connected */
306 #define UD unit[drive]
307 #define UDT unit[drive].disktype
364 #define IS_BUFFERED(drive,side,track) \
365 (BufferDrive == (drive) && BufferSide == (side) && BufferTrack == (track))
392 #define RECALIBRATE_ERRORS 4 /* After this many errors the drive
420 static void fd_select_drive( int drive );
426 static int do_format(int drive, int type, struct atari_format_descr *desc);
427 static void do_fd_action( int drive );
441 static void setup_req_params( int drive );
444 static void fd_probe( int drive );
445 static int fd_test_drive_present( int drive );
504 /* Select a drive, update the FDC's track register and set the correct
508 static void fd_select_drive( int drive )
513 if (drive == SelectedDrive)
520 sound_ym.wd_data = (tmp | DSKDRVNONE) & ~(drive == 0 ? DSKDRV0 : DSKDRV1);
533 SelectedDrive = drive;
549 /* On Falcon, the drive B select line is used on the printer port, so
558 * counts the index signals, which arrive only if one drive is selected.
566 /* no drive selected, needn't deselect anyone */
584 * in the drive and the FDC will leave the motor on forever (or,
599 static int drive = 0;
605 if (++drive > 1 || !UD.connected)
606 drive = 0;
615 ~(drive == 0 ? DSKDRV0 : DSKDRV1);
620 DPRINT(( "wpstat[%d] = %d\n", drive, stat ));
622 set_bit (drive, &changed_floppies);
724 static int do_format(int drive, int type, struct atari_format_descr *desc)
726 struct request_queue *q = unit[drive].disk->queue;
787 do_fd_action( drive );
800 * required parameter settings (drive select, side select, track
808 static void do_fd_action( int drive )
814 if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
819 setup_req_params( drive );
836 if (SelectedDrive != drive)
837 fd_select_drive( drive );
892 /* Seek the drive to the requested track. The drive must have been
1410 unsigned int drive = p - unit;
1411 if (test_bit (drive, &fake_change)) {
1415 if (test_bit (drive, &changed_floppies)) {
1432 unsigned int drive = p - unit;
1434 if (test_bit(drive, &changed_floppies) ||
1435 test_bit(drive, &fake_change) ||
1440 clear_bit(drive, &fake_change);
1441 clear_bit(drive, &changed_floppies);
1445 if (default_params[drive].blocks == 0)
1448 UDT = &default_params[drive];
1456 static void setup_req_params( int drive )
1488 int drive = floppy - unit;
1508 /* drive not connected */
1509 printk(KERN_ERR "Unknown Device: fd%d\n", drive );
1525 printk(KERN_WARNING "fd%d: invalid disk format", drive );
1530 printk(KERN_WARNING "fd%d: unsupported disk format", drive );
1547 setup_req_params( drive );
1548 do_fd_action( drive );
1564 int drive = floppy - unit;
1584 drive, dtp, dtp->name);
1608 * Currently, the drive geometry is cleared after each
1629 drive, setprm.size, setprm.sect, setprm.stretch);
1647 /* skip this one, invalid for drive ... */
1659 drive, dtp->name, dtp);
1665 default_params[drive].name = dtp->name;
1666 default_params[drive].spt = dtp->spt;
1667 default_params[drive].blocks = dtp->blocks;
1668 default_params[drive].fdc_speed = dtp->fdc_speed;
1669 default_params[drive].stretch = dtp->stretch;
1681 dtp = &default_params[drive];
1684 dtp = &user_params[drive];
1697 drive, dtp->blocks, dtp->spt, dtp->stretch);
1723 return do_format(drive, type, &fmt_desc);
1727 default_params[drive].blocks = 0;
1734 set_bit(drive, &fake_change);
1755 /* Initialize the 'unit' variable for drive 'drive' */
1757 static void __init fd_probe( int drive )
1762 if (!fd_test_drive_present( drive ))
1767 switch( UserSteprate[drive] ) {
1791 /* This function tests the physical presence of a floppy drive (not
1795 * signal. This should now be raised if there is a drive connected
1796 * (and there is no hardware failure :-) Otherwise, the drive is
1800 static int __init fd_test_drive_present( int drive )
1806 if (drive >= (MACH_IS_FALCON ? 1 : 2)) return( 0 );
1807 fd_select_drive( drive );
1849 int drive, cnt = 0;
1855 printk(KERN_INFO "Probing floppy drive(s):\n");
1856 for( drive = 0; drive < FD_MAX_UNITS; drive++ ) {
1857 fd_probe( drive );
1859 printk(KERN_INFO "fd%d\n", drive);
1887 * drive with different device numbers.
1967 int drive = *part & 3;
1969 if (drive >= FD_MAX_UNITS || type > NUM_DISK_MINORS)
1972 return get_disk_and_module(unit[drive].disk);
2083 printk(KERN_ERR "ataflop_setup: bad drive type\n" );