2008-10-13 19:39:44 +00:00
|
|
|
#include <linux/kernel.h>
|
2011-07-17 19:33:58 +00:00
|
|
|
#include <linux/export.h>
|
2008-10-13 19:39:44 +00:00
|
|
|
#include <linux/ide.h>
|
2009-09-02 00:52:57 +00:00
|
|
|
#include <linux/seq_file.h>
|
2008-10-13 19:39:44 +00:00
|
|
|
|
|
|
|
#include "ide-floppy.h"
|
|
|
|
|
2009-09-02 00:52:57 +00:00
|
|
|
static int idefloppy_capacity_proc_show(struct seq_file *m, void *v)
|
2008-10-13 19:39:44 +00:00
|
|
|
{
|
2009-09-02 00:52:57 +00:00
|
|
|
ide_drive_t*drive = (ide_drive_t *)m->private;
|
2008-10-13 19:39:44 +00:00
|
|
|
|
2009-09-02 00:52:57 +00:00
|
|
|
seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
|
|
|
|
return 0;
|
2008-10-13 19:39:44 +00:00
|
|
|
}
|
|
|
|
|
2009-09-02 00:52:57 +00:00
|
|
|
static int idefloppy_capacity_proc_open(struct inode *inode, struct file *file)
|
|
|
|
{
|
2013-03-31 22:16:14 +00:00
|
|
|
return single_open(file, idefloppy_capacity_proc_show, PDE_DATA(inode));
|
2009-09-02 00:52:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct file_operations idefloppy_capacity_proc_fops = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.open = idefloppy_capacity_proc_open,
|
|
|
|
.read = seq_read,
|
|
|
|
.llseek = seq_lseek,
|
|
|
|
.release = single_release,
|
|
|
|
};
|
|
|
|
|
2008-10-13 19:39:44 +00:00
|
|
|
ide_proc_entry_t ide_floppy_proc[] = {
|
2009-09-02 00:52:57 +00:00
|
|
|
{ "capacity", S_IFREG|S_IRUGO, &idefloppy_capacity_proc_fops },
|
|
|
|
{ "geometry", S_IFREG|S_IRUGO, &ide_geometry_proc_fops },
|
|
|
|
{}
|
2008-10-13 19:39:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
ide_devset_rw_field(bios_cyl, bios_cyl);
|
|
|
|
ide_devset_rw_field(bios_head, bios_head);
|
|
|
|
ide_devset_rw_field(bios_sect, bios_sect);
|
|
|
|
ide_devset_rw_field(ticks, pc_delay);
|
|
|
|
|
|
|
|
const struct ide_proc_devset ide_floppy_settings[] = {
|
|
|
|
IDE_PROC_DEVSET(bios_cyl, 0, 1023),
|
|
|
|
IDE_PROC_DEVSET(bios_head, 0, 255),
|
|
|
|
IDE_PROC_DEVSET(bios_sect, 0, 63),
|
|
|
|
IDE_PROC_DEVSET(ticks, 0, 255),
|
2009-03-05 15:10:56 +00:00
|
|
|
{ NULL },
|
2008-10-13 19:39:44 +00:00
|
|
|
};
|