ide-floppy_proc.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include <linux/kernel.h>
  2. #include <linux/export.h>
  3. #include <linux/ide.h>
  4. #include <linux/seq_file.h>
  5. #include "ide-floppy.h"
  6. static int idefloppy_capacity_proc_show(struct seq_file *m, void *v)
  7. {
  8. ide_drive_t*drive = (ide_drive_t *)m->private;
  9. seq_printf(m, "%llu\n", (long long)ide_gd_capacity(drive));
  10. return 0;
  11. }
  12. static int idefloppy_capacity_proc_open(struct inode *inode, struct file *file)
  13. {
  14. return single_open(file, idefloppy_capacity_proc_show, PDE_DATA(inode));
  15. }
  16. static const struct file_operations idefloppy_capacity_proc_fops = {
  17. .owner = THIS_MODULE,
  18. .open = idefloppy_capacity_proc_open,
  19. .read = seq_read,
  20. .llseek = seq_lseek,
  21. .release = single_release,
  22. };
  23. ide_proc_entry_t ide_floppy_proc[] = {
  24. { "capacity", S_IFREG|S_IRUGO, &idefloppy_capacity_proc_fops },
  25. { "geometry", S_IFREG|S_IRUGO, &ide_geometry_proc_fops },
  26. {}
  27. };
  28. ide_devset_rw_field(bios_cyl, bios_cyl);
  29. ide_devset_rw_field(bios_head, bios_head);
  30. ide_devset_rw_field(bios_sect, bios_sect);
  31. ide_devset_rw_field(ticks, pc_delay);
  32. const struct ide_proc_devset ide_floppy_settings[] = {
  33. IDE_PROC_DEVSET(bios_cyl, 0, 1023),
  34. IDE_PROC_DEVSET(bios_head, 0, 255),
  35. IDE_PROC_DEVSET(bios_sect, 0, 63),
  36. IDE_PROC_DEVSET(ticks, 0, 255),
  37. { NULL },
  38. };