ide-floppy.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. /* delay this long before sending packet command */
  21. u8 ticks;
  22. int progress_indication;
  23. /* Device information */
  24. /* Current format */
  25. int blocks, block_size, bs_factor;
  26. /* Last format capacity descriptor */
  27. u8 cap_desc[8];
  28. /* Copy of the flexible disk page */
  29. u8 flexible_disk_page[32];
  30. } idefloppy_floppy_t;
  31. /*
  32. * Pages of the SELECT SENSE / MODE SENSE packet commands.
  33. * See SFF-8070i spec.
  34. */
  35. #define IDEFLOPPY_CAPABILITIES_PAGE 0x1b
  36. #define IDEFLOPPY_FLEXIBLE_DISK_PAGE 0x05
  37. /* IOCTLs used in low-level formatting. */
  38. #define IDEFLOPPY_IOCTL_FORMAT_SUPPORTED 0x4600
  39. #define IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY 0x4601
  40. #define IDEFLOPPY_IOCTL_FORMAT_START 0x4602
  41. #define IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS 0x4603
  42. /* ide-floppy.c */
  43. void ide_floppy_create_mode_sense_cmd(struct ide_atapi_pc *, u8);
  44. void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *);
  45. /* ide-floppy_ioctl.c */
  46. int ide_floppy_format_ioctl(ide_drive_t *, struct file *, unsigned int,
  47. void __user *);
  48. #endif /*__IDE_FLOPPY_H */