ide-floppy_proc.c revision 71bfc7a7c73eaf1f99e309dba60822ba050e3ec5
1b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz#include <linux/kernel.h> 2b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz#include <linux/ide.h> 3b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz 4b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz#include "ide-floppy.h" 5b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz 6b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewiczstatic int proc_idefloppy_read_capacity(char *page, char **start, off_t off, 7b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz int count, int *eof, void *data) 8b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz{ 9b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz ide_drive_t*drive = (ide_drive_t *)data; 10b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz int len; 11b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz 129a6eb74d07f9152dd0e0ea551e878e869b8d2fc1Bartlomiej Zolnierkiewicz len = sprintf(page, "%llu\n", (long long)ide_gd_capacity(drive)); 13b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz PROC_IDE_READ_RETURN(page, start, off, count, eof, len); 14b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz} 15b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz 16b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewiczide_proc_entry_t ide_floppy_proc[] = { 17b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz { "capacity", S_IFREG|S_IRUGO, proc_idefloppy_read_capacity, NULL }, 18b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz { "geometry", S_IFREG|S_IRUGO, proc_ide_read_geometry, NULL }, 19b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz { NULL, 0, NULL, NULL } 20b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz}; 21b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz 22b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewiczide_devset_rw_field(bios_cyl, bios_cyl); 23b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewiczide_devset_rw_field(bios_head, bios_head); 24b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewiczide_devset_rw_field(bios_sect, bios_sect); 25b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewiczide_devset_rw_field(ticks, pc_delay); 26b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz 27b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewiczconst struct ide_proc_devset ide_floppy_settings[] = { 28b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz IDE_PROC_DEVSET(bios_cyl, 0, 1023), 29b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz IDE_PROC_DEVSET(bios_head, 0, 255), 30b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz IDE_PROC_DEVSET(bios_sect, 0, 63), 31b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz IDE_PROC_DEVSET(ticks, 0, 255), 3271bfc7a7c73eaf1f99e309dba60822ba050e3ec5Hannes Eder { NULL }, 33b9103da463f72d03c513acdb18f1aebd7931ed1eBartlomiej Zolnierkiewicz}; 34