Lines Matching refs:swd

196 	struct swim_priv *swd;  member
430 struct swim __iomem *base = fs->swd->base; in swim_track()
447 struct swim __iomem *base = fs->swd->base; in floppy_eject()
463 struct swim __iomem *base = fs->swd->base; in swim_read_sector()
500 struct swim __iomem *base = fs->swd->base; in floppy_read_sectors()
528 static struct request *swim_next_request(struct swim_priv *swd) in swim_next_request() argument
532 int old_pos = swd->fdc_queue; in swim_next_request()
535 q = swd->unit[swd->fdc_queue].disk->queue; in swim_next_request()
536 if (++swd->fdc_queue == swd->floppy_count) in swim_next_request()
537 swd->fdc_queue = 0; in swim_next_request()
543 } while (swd->fdc_queue != old_pos); in swim_next_request()
550 struct swim_priv *swd = q->queuedata; in do_fd_request() local
554 req = swim_next_request(swd); in do_fd_request()
578 req = swim_next_request(swd); in do_fd_request()
609 struct swim __iomem *base = fs->swd->base; in setup_medium()
638 struct swim __iomem *base = fs->swd->base; in floppy_open()
699 struct swim __iomem *base = fs->swd->base; in floppy_release()
767 struct swim __iomem *base = fs->swd->base; in floppy_revalidate()
794 struct swim_priv *swd = data; in floppy_find() local
797 if (drive >= swd->floppy_count) in floppy_find()
801 return get_disk_and_module(swd->unit[drive].disk); in floppy_find()
804 static int swim_add_floppy(struct swim_priv *swd, enum drive_location location) in swim_add_floppy() argument
806 struct floppy_state *fs = &swd->unit[swd->floppy_count]; in swim_add_floppy()
807 struct swim __iomem *base = swd->base; in swim_add_floppy()
821 swd->floppy_count++; in swim_add_floppy()
826 static int swim_floppy_init(struct swim_priv *swd) in swim_floppy_init() argument
830 struct swim __iomem *base = swd->base; in swim_floppy_init()
837 swim_add_floppy(swd, INTERNAL_DRIVE); in swim_floppy_init()
841 swim_add_floppy(swd, EXTERNAL_DRIVE); in swim_floppy_init()
852 spin_lock_init(&swd->lock); in swim_floppy_init()
854 for (drive = 0; drive < swd->floppy_count; drive++) { in swim_floppy_init()
855 swd->unit[drive].disk = alloc_disk(1); in swim_floppy_init()
856 if (swd->unit[drive].disk == NULL) { in swim_floppy_init()
860 swd->unit[drive].disk->queue = blk_init_queue(do_fd_request, in swim_floppy_init()
861 &swd->lock); in swim_floppy_init()
862 if (!swd->unit[drive].disk->queue) { in swim_floppy_init()
866 blk_queue_bounce_limit(swd->unit[drive].disk->queue, in swim_floppy_init()
868 swd->unit[drive].disk->queue->queuedata = swd; in swim_floppy_init()
869 swd->unit[drive].swd = swd; in swim_floppy_init()
872 for (drive = 0; drive < swd->floppy_count; drive++) { in swim_floppy_init()
873 swd->unit[drive].disk->flags = GENHD_FL_REMOVABLE; in swim_floppy_init()
874 swd->unit[drive].disk->major = FLOPPY_MAJOR; in swim_floppy_init()
875 swd->unit[drive].disk->first_minor = drive; in swim_floppy_init()
876 sprintf(swd->unit[drive].disk->disk_name, "fd%d", drive); in swim_floppy_init()
877 swd->unit[drive].disk->fops = &floppy_fops; in swim_floppy_init()
878 swd->unit[drive].disk->private_data = &swd->unit[drive]; in swim_floppy_init()
879 set_capacity(swd->unit[drive].disk, 2880); in swim_floppy_init()
880 add_disk(swd->unit[drive].disk); in swim_floppy_init()
884 floppy_find, NULL, swd); in swim_floppy_init()
891 put_disk(swd->unit[drive].disk); in swim_floppy_init()
899 struct swim_priv *swd; in swim_probe() local
930 swd = kzalloc(sizeof(struct swim_priv), GFP_KERNEL); in swim_probe()
931 if (!swd) { in swim_probe()
935 platform_set_drvdata(dev, swd); in swim_probe()
937 swd->base = swim_base; in swim_probe()
939 ret = swim_floppy_init(swd); in swim_probe()
946 kfree(swd); in swim_probe()
955 struct swim_priv *swd = platform_get_drvdata(dev); in swim_remove() local
961 for (drive = 0; drive < swd->floppy_count; drive++) { in swim_remove()
962 del_gendisk(swd->unit[drive].disk); in swim_remove()
963 blk_cleanup_queue(swd->unit[drive].disk->queue); in swim_remove()
964 put_disk(swd->unit[drive].disk); in swim_remove()
971 for (drive = 0; drive < swd->floppy_count; drive++) in swim_remove()
972 floppy_eject(&swd->unit[drive]); in swim_remove()
978 kfree(swd); in swim_remove()