blob: 7f697ddb5fe569a06e18864343fa677d12f8fe7b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001// SPDX-License-Identifier: GPL-2.0
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02002#include <linux/kernel.h>
Paul Gortmaker38789fd2011-07-17 15:33:58 -04003#include <linux/export.h>
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02004#include <linux/ide.h>
Alexey Dobriyan6d703a82009-09-01 17:52:57 -07005#include <linux/seq_file.h>
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02006
7#include "ide-floppy.h"
8
Alexey Dobriyan6d703a82009-09-01 17:52:57 -07009static int idefloppy_capacity_proc_show(struct seq_file *m, void *v)
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020010{
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070011 ide_drive_t*drive = (ide_drive_t *)m->private;
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020012
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070013 seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
14 return 0;
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020015}
16
17ide_proc_entry_t ide_floppy_proc[] = {
Christoph Hellwigec7d9c92018-04-13 21:25:54 +020018 { "capacity", S_IFREG|S_IRUGO, idefloppy_capacity_proc_show },
19 { "geometry", S_IFREG|S_IRUGO, ide_geometry_proc_show },
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070020 {}
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020021};
22
23ide_devset_rw_field(bios_cyl, bios_cyl);
24ide_devset_rw_field(bios_head, bios_head);
25ide_devset_rw_field(bios_sect, bios_sect);
26ide_devset_rw_field(ticks, pc_delay);
27
28const struct ide_proc_devset ide_floppy_settings[] = {
29 IDE_PROC_DEVSET(bios_cyl, 0, 1023),
30 IDE_PROC_DEVSET(bios_head, 0, 255),
31 IDE_PROC_DEVSET(bios_sect, 0, 63),
32 IDE_PROC_DEVSET(ticks, 0, 255),
Hannes Eder71bfc7a2009-03-05 16:10:56 +010033 { NULL },
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020034};