ide-floppy.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #ifndef __IDE_FLOPPY_H
  2. #define __IDE_FLOPPY_H
  3. /*
  4. * Most of our global data which we need to save even as we leave the driver
  5. * due to an interrupt or a timer event is stored in a variable of type
  6. * idefloppy_floppy_t, defined below.
  7. */
  8. typedef struct ide_floppy_obj {
  9. ide_drive_t *drive;
  10. ide_driver_t *driver;
  11. struct gendisk *disk;
  12. struct kref kref;
  13. unsigned int openers; /* protected by BKL for now */
  14. /* Last failed packet command */
  15. struct ide_atapi_pc *failed_pc;
  16. /* used for blk_{fs,pc}_request() requests */
  17. struct ide_atapi_pc queued_pc;
  18. /* Last error information */
  19. u8 sense_key, asc, ascq;
  20. int progress_indication;
  21. /* Device information */
  22. /* Current format */
  23. int blocks, block_size, bs_factor;
  24. /* Last format capacity descriptor */
  25. u8 cap_desc[8];
  26. /* Copy of the flexible disk page */
  27. u8 flexible_disk_page[32];
  28. } idefloppy_floppy_t;
  29. /*
  30. * Pages of the SELECT SENSE / MODE SENSE packet commands.
  31. * See SFF-8070i spec.
  32. */
  33. #define IDEFLOPPY_CAPABILITIES_PAGE 0x1b
  34. #define IDEFLOPPY_FLEXIBLE_DISK_PAGE 0x05
  35. /* IOCTLs used in low-level formatting. */
  36. #define IDEFLOPPY_IOCTL_FORMAT_SUPPORTED 0x4600
  37. #define IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY 0x4601
  38. #define IDEFLOPPY_IOCTL_FORMAT_START 0x4602
  39. #define IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS 0x4603
  40. /* ide-floppy.c */
  41. void ide_floppy_create_mode_sense_cmd(struct ide_atapi_pc *, u8);
  42. void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *);
  43. sector_t ide_floppy_capacity(ide_drive_t *);
  44. /* ide-floppy_ioctl.c */
  45. int ide_floppy_ioctl(struct inode *, struct file *, unsigned, unsigned long);
  46. #ifdef CONFIG_IDE_PROC_FS
  47. /* ide-floppy_proc.c */
  48. extern ide_proc_entry_t ide_floppy_proc[];
  49. extern const struct ide_proc_devset ide_floppy_settings[];
  50. #endif
  51. #endif /*__IDE_FLOPPY_H */