• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asus-wl-520gu-7.0.1.45/src/linux/linux/drivers/acorn/block/

Lines Matching defs: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)
45 * - Sometimes the drive-change-detection stops to work. The
95 * (PC gets 14.3K/sec - 0% CPU!) Hmm - hard drive corrupt!
185 { "D360", 9, 720, 1 }, /* 360kb in 720kb drive */
205 int connected; /* !=0 : drive is connected */
259 #define IS_BUFFERED(drive,side,track) \
260 (BufferDrive == (drive) && BufferSide == (side) && BufferTrack == (track))
289 #define RECALIBRATE_ERRORS 4 /* After this many errors the drive
340 static void fd_select_drive(int drive);
348 static void do_fd_action(int drive);
363 static void setup_req_params(int drive);
367 static void fd_probe(int drive);
368 static int fd_test_drive_present(int drive);
407 /* Select a drive, update the FDC1772's track register
410 static void fd_select_drive(int drive)
413 printk("fd_select_drive:%d\n", drive);
418 if (drive == SelectedDrive)
421 oldlatch_aupdate(LATCHA_FDSELALL, 0xf - (1 << drive));
424 FDC1772_WRITE(FDC1772REG_TRACK, unit[drive].track);
427 SelectedDrive = drive;
447 * counts the index signals, which arrive only if one drive is selected.
459 /* no drive selected, needn't deselect anyone */
488 * in the drive and the FDC1772 will leave the motor on forever (or,
504 static int drive = 0;
514 if (++drive > 1 || !unit[drive].connected)
515 drive = 0;
525 if (stat != unit[drive].wpstat) {
526 DPRINT(("wpstat[%d] = %d\n", drive, stat));
527 unit[drive].wpstat = stat;
528 set_bit(drive, &changed_floppies);
610 * required parameter settings (drive select, side select, track
618 static void do_fd_action(int drive)
620 DPRINT(("do_fd_action unit[drive].track=%d\n", unit[drive].track));
625 if (IS_BUFFERED( drive, ReqSide, ReqTrack )) {
630 setup_req_params( drive );
648 if (SelectedDrive != drive) {
649 /*unit[drive].track = -1; DAG */
650 fd_select_drive(drive);
654 if (unit[drive].track == -1)
656 else if (unit[drive].track != ReqTrack << unit[drive].disktype->stretch)
700 /* Seek the drive to the requested track. The drive must have been
1142 unsigned int drive = (dev & 0x03);
1148 if (test_bit(drive, &fake_change)) {
1152 if (test_bit(drive, &changed_floppies)) {
1156 if (unit[drive].wpstat) {
1167 int drive = dev & 3;
1169 if (test_bit(drive, &changed_floppies) || test_bit(drive, &fake_change)
1170 || unit[drive].disktype == 0) {
1174 clear_bit(drive, &fake_change);
1175 clear_bit(drive, &changed_floppies);
1176 unit[drive].disktype = 0;
1193 static void setup_req_params(int drive)
1197 ReqTrack = block / unit[drive].disktype->spt;
1198 ReqSector = block - ReqTrack * unit[drive].disktype->spt + 1;
1214 int device, drive, type;
1237 drive = device & 3;
1239 floppy = &unit[drive];
1242 /* drive not connected */
1243 printk("Unknown Device: fd%d\n", drive);
1251 floppy_sizes[drive] = floppy->disktype->blocks >> 1;
1258 printk("fd%d: invalid disk format", drive);
1263 floppy_sizes[drive] = disk_type[type].blocks >> 1;
1278 setup_req_params(drive);
1279 do_fd_action(drive);
1339 int drive, device;
1342 drive = MINOR(device);
1347 unit[drive].disktype = NULL;
1348 floppy_sizes[drive] = MAX_DISK_SIZE;
1352 return invalidate_drive(drive);
1356 if (drive < 0 || drive > 3)
1366 /* Initialize the 'unit' variable for drive 'drive' */
1368 static void fd_probe(int drive)
1370 unit[drive].connected = 0;
1371 unit[drive].disktype = NULL;
1373 if (!fd_test_drive_present(drive))
1376 unit[drive].connected = 1;
1377 unit[drive].track = -1; /* If we put the auto detect back in this can go to 0 */
1378 unit[drive].steprate = FDC1772STEP_6;
1383 /* This function tests the physical presence of a floppy drive (not
1387 * signal. This should now be raised if there is a drive connected
1388 * (and there is no hardware failure :-) Otherwise, the drive is
1392 static int fd_test_drive_present(int drive)
1398 printk("fd_test_drive_present %d\n", drive);
1399 if (drive > 1)
1402 fd_select_drive(drive);
1455 int drive, cnt = 0;
1457 printk("Probing floppy drive(s):\n");
1458 for (drive = 0; drive < FD_MAX_UNITS; drive++) {
1459 fd_probe(drive);
1460 if (unit[drive].connected) {
1461 printk("fd%d\n", drive);
1489 * drive with different device numbers.
1494 int drive;
1501 drive = MINOR(inode->i_rdev) & 3;
1505 old_dev = fd_device[drive];
1507 if (fd_ref[drive])
1511 if (fd_ref[drive] == -1 || (fd_ref[drive] && filp->f_flags & O_EXCL))
1515 fd_ref[drive] = -1;
1517 fd_ref[drive]++;
1519 fd_device[drive] = inode->i_rdev;
1530 if (unit[drive].wpstat) {
1542 int drive = MINOR(inode->i_rdev) & 3;
1544 if (fd_ref[drive] < 0)
1545 fd_ref[drive] = 0;
1546 else if (!fd_ref[drive]--) {
1548 fd_ref[drive] = 0;