blob: d711d9b883dea63124ac11c38907f8ca8a23b36c [file] [log] [blame]
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02001#include <linux/kernel.h>
2#include <linux/ide.h>
Alexey Dobriyan6d703a82009-09-01 17:52:57 -07003#include <linux/seq_file.h>
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02004
5#include "ide-floppy.h"
6
Alexey Dobriyan6d703a82009-09-01 17:52:57 -07007static int idefloppy_capacity_proc_show(struct seq_file *m, void *v)
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +02008{
Alexey Dobriyan6d703a82009-09-01 17:52:57 -07009 ide_drive_t*drive = (ide_drive_t *)m->private;
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020010
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070011 seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
12 return 0;
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020013}
14
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070015static int idefloppy_capacity_proc_open(struct inode *inode, struct file *file)
16{
17 return single_open(file, idefloppy_capacity_proc_show, PDE(inode)->data);
18}
19
20static const struct file_operations idefloppy_capacity_proc_fops = {
21 .owner = THIS_MODULE,
22 .open = idefloppy_capacity_proc_open,
23 .read = seq_read,
24 .llseek = seq_lseek,
25 .release = single_release,
26};
27
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020028ide_proc_entry_t ide_floppy_proc[] = {
Alexey Dobriyan6d703a82009-09-01 17:52:57 -070029 { "capacity", S_IFREG|S_IRUGO, &idefloppy_capacity_proc_fops },
30 { "geometry", S_IFREG|S_IRUGO, &ide_geometry_proc_fops },
31 {}
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020032};
33
34ide_devset_rw_field(bios_cyl, bios_cyl);
35ide_devset_rw_field(bios_head, bios_head);
36ide_devset_rw_field(bios_sect, bios_sect);
37ide_devset_rw_field(ticks, pc_delay);
38
39const struct ide_proc_devset ide_floppy_settings[] = {
40 IDE_PROC_DEVSET(bios_cyl, 0, 1023),
41 IDE_PROC_DEVSET(bios_head, 0, 255),
42 IDE_PROC_DEVSET(bios_sect, 0, 63),
43 IDE_PROC_DEVSET(ticks, 0, 255),
Hannes Eder71bfc7a2009-03-05 16:10:56 +010044 { NULL },
Bartlomiej Zolnierkiewiczb9103da2008-10-13 21:39:44 +020045};