Lines Matching refs:unit
264 static struct amiga_floppy_struct unit[FD_MAX_UNITS]; variable
406 if (unit[drive].track % 2 != 0) in fd_select()
408 if (unit[drive].motor == 1) in fd_select()
461 if (!unit[nr].motor) { in fd_motor_on()
462 unit[nr].motor = 1; in fd_motor_on()
500 unit[drive].motor = 0; in fd_motor_off()
528 for (n = unit[drive].type->tracks/2; n != 0; --n) { in fd_calibrate()
536 ms_delay(unit[drive].type->step_delay); in fd_calibrate()
538 ms_delay (unit[drive].type->settle_time); in fd_calibrate()
540 n = unit[drive].type->tracks + 20; in fd_calibrate()
547 ms_delay(unit[drive].type->step_delay + 1); in fd_calibrate()
553 unit[drive].track = -1; in fd_calibrate()
558 unit[drive].track = 0; in fd_calibrate()
559 ms_delay(unit[drive].type->settle_time); in fd_calibrate()
576 if (unit[drive].track == track) { in fd_seek()
584 if (unit[drive].track < 0 && !fd_calibrate(drive)) { in fd_seek()
590 cnt = unit[drive].track/2 - track/2; in fd_seek()
600 if (track % 2 != unit[drive].track % 2) in fd_seek()
601 ms_delay (unit[drive].type->side_time); in fd_seek()
602 unit[drive].track = track; in fd_seek()
614 ms_delay (unit[drive].type->step_delay); in fd_seek()
616 ms_delay (unit[drive].type->settle_time); in fd_seek()
705 custom.dsklen = unit[drive].type->read_size/sizeof(short) | DSKLEN_DMAEN; in raw_read()
706 custom.dsklen = unit[drive].type->read_size/sizeof(short) | DSKLEN_DMAEN; in raw_read()
733 if ((ulong)unit[drive].track >= unit[drive].type->precomp2) in raw_write()
735 else if ((ulong)unit[drive].track >= unit[drive].type->precomp1) in raw_write()
741 custom.dsklen = unit[drive].type->write_size/sizeof(short) | DSKLEN_DMAEN|DSKLEN_WRITE; in raw_write()
742 custom.dsklen = unit[drive].type->write_size/sizeof(short) | DSKLEN_DMAEN|DSKLEN_WRITE; in raw_write()
762 unit[drive].dirty = 0; in post_write()
845 end = raw + unit[drive].type->read_size; in amiga_read()
847 for (scnt = 0;scnt < unit[drive].dtype->sects * unit[drive].type->sect_mult; scnt++) { in amiga_read()
874 if (hdr.track != unit[drive].track) { in amiga_read()
875 printk(KERN_INFO "MFM_TRACK: %d, %d\n", hdr.track, unit[drive].track); in amiga_read()
879 raw = decode ((ulong *)(unit[drive].trackbuf + hdr.sect*512), in amiga_read()
881 csum = checksum((ulong *)(unit[drive].trackbuf + hdr.sect*512), 512); in amiga_read()
888 ((ulong *)(unit[drive].trackbuf+hdr.sect*512))[0], in amiga_read()
889 ((ulong *)(unit[drive].trackbuf+hdr.sect*512))[1], in amiga_read()
890 ((ulong *)(unit[drive].trackbuf+hdr.sect*512))[2], in amiga_read()
891 ((ulong *)(unit[drive].trackbuf+hdr.sect*512))[3]); in amiga_read()
942 hdr.track = unit[disk].track; in putsec()
944 hdr.ord = unit[disk].dtype->sects * unit[disk].type->sect_mult - cnt; in putsec()
949 hdr.datachk = checksum((ulong *)(unit[disk].trackbuf+cnt*512), 512); in putsec()
959 encode_block(raw, (ulong *)(unit[disk].trackbuf+cnt*512), 512); in putsec()
972 for (cnt = 0; cnt < 415 * unit[disk].type->sect_mult; cnt++) in amiga_write()
976 for (cnt = 0; cnt < unit[disk].dtype->sects * unit[disk].type->sect_mult; cnt++) in amiga_write()
1160 end = raw + unit[drive].type->read_size; in dos_read()
1162 for (scnt=0; scnt < unit[drive].dtype->sects * unit[drive].type->sect_mult; scnt++) { in dos_read()
1167 unit[drive].track,drive,scnt); in dos_read()
1188 if (hdr.track != unit[drive].track/unit[drive].type->heads) { in dos_read()
1191 unit[drive].track/unit[drive].type->heads); in dos_read()
1195 if (hdr.side != unit[drive].track%unit[drive].type->heads) { in dos_read()
1198 unit[drive].track%unit[drive].type->heads); in dos_read()
1213 unit[drive].track, drive, scnt, hdr.sec); in dos_read()
1228 …raw = dos_decode((unsigned char *)(unit[drive].trackbuf + (hdr.sec - 1) * 512), (ushort *) raw, 51… in dos_read()
1230 crc = dos_data_crc(unit[drive].trackbuf + (hdr.sec - 1) * 512); in dos_read()
1237 ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[0], in dos_read()
1238 ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[1], in dos_read()
1239 ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[2], in dos_read()
1240 ((ulong *)(unit[drive].trackbuf+(hdr.sec-1)*512))[3]); in dos_read()
1288 hdr.track=unit[drive].track/unit[drive].type->heads; in ms_putsec()
1289 hdr.side=unit[drive].track%unit[drive].type->heads; in ms_putsec()
1307 (unsigned char *)unit[drive].trackbuf+cnt*512,512); in ms_putsec()
1311 crc[0]=dos_data_crc(unit[drive].trackbuf+cnt*512); in ms_putsec()
1334 if (unit[disk].type->sect_mult==2) /* check for HD-Disks */ in dos_write()
1349 for(cnt = 0; cnt < unit[disk].dtype->sects * unit[disk].type->sect_mult; cnt++) in dos_write()
1380 (*unit[nr].dtype->write_fkt)(nr); in flush_track_callback()
1405 (*unit[nr].dtype->write_fkt)(nr); in non_int_flush_track()
1428 if (unit[drive].track == track) in get_track()
1436 if (unit[drive].dirty == 1) { in get_track()
1445 error = (*unit[drive].dtype->read_fkt)(drive); in get_track()
1451 unit[drive].track = -1; in get_track()
1461 int drive = floppy - unit; in amiflop_rw_cur_segment()
1529 geo->heads = unit[drive].type->heads; in fd_getgeo()
1530 geo->sectors = unit[drive].dtype->sects * unit[drive].type->sect_mult; in fd_getgeo()
1531 geo->cylinders = unit[drive].type->tracks; in fd_getgeo()
1539 int drive = p - unit; in fd_locked_ioctl()
1639 unit[drive].type = &drive_types[num_dr_types-1]; /* FD_NODRIVE */ in fd_probe()
1643 unit[drive].type = drive_types + type; in fd_probe()
1644 unit[drive].track = -1; in fd_probe()
1646 unit[drive].disk = -1; in fd_probe()
1647 unit[drive].motor = 0; in fd_probe()
1648 unit[drive].busy = 0; in fd_probe()
1649 unit[drive].status = -1; in fd_probe()
1695 unit[drive].dtype=&data_types[system]; in floppy_open()
1696 unit[drive].blocks=unit[drive].type->heads*unit[drive].type->tracks* in floppy_open()
1697 data_types[system].sects*unit[drive].type->sect_mult; in floppy_open()
1698 set_capacity(unit[drive].gendisk, unit[drive].blocks); in floppy_open()
1701 unit[drive].type->name, data_types[system].name); in floppy_open()
1710 int drive = p - unit; in floppy_release()
1713 if (unit[drive].dirty == 1) { in floppy_release()
1737 int drive = p - unit; in amiga_check_events()
1783 disk->queue = blk_mq_init_sq_queue(&unit[drive].tag_set, &amiflop_mq_ops, in fd_alloc_disk()
1790 unit[drive].trackbuf = kmalloc(FLOPPY_MAX_SECTORS * 512, GFP_KERNEL); in fd_alloc_disk()
1791 if (!unit[drive].trackbuf) in fd_alloc_disk()
1799 blk_mq_free_tag_set(&unit[drive].tag_set); in fd_alloc_disk()
1803 unit[drive].type->code = FD_NODRIVE; in fd_alloc_disk()
1817 if (unit[drive].type->code == FD_NODRIVE) in fd_probe_drives()
1826 unit[drive].gendisk = disk; in fd_probe_drives()
1835 disk->private_data = &unit[drive]; in fd_probe_drives()
1852 if (unit[drive].type->code == FD_NODRIVE) in floppy_find()
1855 return get_disk_and_module(unit[drive].gendisk); in floppy_find()
1899 unit[i].track = -1; in amiga_floppy_probe()