]> git.karo-electronics.de Git - karo-tx-linux.git/blob - drivers/ide/ide-floppy_proc.c
Merge branch 'xen/xenbus' into upstream/xen
[karo-tx-linux.git] / drivers / ide / ide-floppy_proc.c
1 #include <linux/kernel.h>
2 #include <linux/ide.h>
3 #include <linux/seq_file.h>
4
5 #include "ide-floppy.h"
6
7 static int idefloppy_capacity_proc_show(struct seq_file *m, void *v)
8 {
9         ide_drive_t*drive = (ide_drive_t *)m->private;
10
11         seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
12         return 0;
13 }
14
15 static 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
20 static 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
28 ide_proc_entry_t ide_floppy_proc[] = {
29         { "capacity",   S_IFREG|S_IRUGO, &idefloppy_capacity_proc_fops  },
30         { "geometry",   S_IFREG|S_IRUGO, &ide_geometry_proc_fops        },
31         {}
32 };
33
34 ide_devset_rw_field(bios_cyl, bios_cyl);
35 ide_devset_rw_field(bios_head, bios_head);
36 ide_devset_rw_field(bios_sect, bios_sect);
37 ide_devset_rw_field(ticks, pc_delay);
38
39 const 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),
44         { NULL },
45 };