blob: e7a25ea757dfe76e827cdff00c64b60ab63eec4d [file] [log] [blame]
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02001#include <linux/kernel.h>
Paul Gortmaker38789fd2011-07-17 15:33:58 -04002#include <linux/export.h>
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02003#include <linux/ide.h>
Alexey Dobriyan6d703a82009-09-01 17:52:57 -07004#include <linux/seq_file.h>
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02005
6#include "ide-floppy.h"
7
Alexey Dobriyan6d703a82009-09-01 17:52:57 -07008static int idefloppy_capacity_proc_show(struct seq_file *m, void *v)
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02009{
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070010 ide_drive_t*drive = (ide_drive_t *)m->private;
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020011
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070012 seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
13 return 0;
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020014}
15
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070016static int idefloppy_capacity_proc_open(struct inode *inode, struct file *file)
17{
Al Virod9dda782013-03-31 18:16:14 -040018 return single_open(file, idefloppy_capacity_proc_show, PDE_DATA(inode));
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070019}
20
21static const struct file_operations idefloppy_capacity_proc_fops = {
22 .owner = THIS_MODULE,
23 .open = idefloppy_capacity_proc_open,
24 .read = seq_read,
25 .llseek = seq_lseek,
26 .release = single_release,
27};
28
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020029ide_proc_entry_t ide_floppy_proc[] = {
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070030 { "capacity", S_IFREG|S_IRUGO, &idefloppy_capacity_proc_fops },
31 { "geometry", S_IFREG|S_IRUGO, &ide_geometry_proc_fops },
32 {}
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020033};
34
35ide_devset_rw_field(bios_cyl, bios_cyl);
36ide_devset_rw_field(bios_head, bios_head);
37ide_devset_rw_field(bios_sect, bios_sect);
38ide_devset_rw_field(ticks, pc_delay);
39
40const struct ide_proc_devset ide_floppy_settings[] = {
41 IDE_PROC_DEVSET(bios_cyl, 0, 1023),
42 IDE_PROC_DEVSET(bios_head, 0, 255),
43 IDE_PROC_DEVSET(bios_sect, 0, 63),
44 IDE_PROC_DEVSET(ticks, 0, 255),
Hannes Eder71bfc7a2009-03-05 16:10:56 +010045 { NULL },
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020046};