ide-floppy.h 1.8 KB

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