usb_usual.h 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Interface to the libusual.
  3. *
  4. * Copyright (c) 2005 Pete Zaitcev <zaitcev@redhat.com>
  5. * Copyright (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
  6. * Copyright (c) 1999 Michael Gee (michael@linuxspecific.com)
  7. */
  8. #ifndef __LINUX_USB_USUAL_H
  9. #define __LINUX_USB_USUAL_H
  10. /* We should do this for cleanliness... But other usb_foo.h do not do this. */
  11. /* #include <linux/usb.h> */
  12. /*
  13. * The flags field, which we store in usb_device_id.driver_info.
  14. * It is compatible with the old usb-storage flags in lower 24 bits.
  15. */
  16. /*
  17. * Static flag definitions. We use this roundabout technique so that the
  18. * proc_info() routine can automatically display a message for each flag.
  19. */
  20. #define US_DO_ALL_FLAGS \
  21. US_FLAG(SINGLE_LUN, 0x00000001) \
  22. /* allow access to only LUN 0 */ \
  23. US_FLAG(NEED_OVERRIDE, 0x00000002) \
  24. /* unusual_devs entry is necessary */ \
  25. US_FLAG(SCM_MULT_TARG, 0x00000004) \
  26. /* supports multiple targets */ \
  27. US_FLAG(FIX_INQUIRY, 0x00000008) \
  28. /* INQUIRY response needs faking */ \
  29. US_FLAG(FIX_CAPACITY, 0x00000010) \
  30. /* READ CAPACITY response too big */ \
  31. US_FLAG(IGNORE_RESIDUE, 0x00000020) \
  32. /* reported residue is wrong */ \
  33. US_FLAG(BULK32, 0x00000040) \
  34. /* Uses 32-byte CBW length */ \
  35. US_FLAG(NOT_LOCKABLE, 0x00000080) \
  36. /* PREVENT/ALLOW not supported */ \
  37. US_FLAG(GO_SLOW, 0x00000100) \
  38. /* Need delay after Command phase */ \
  39. US_FLAG(NO_WP_DETECT, 0x00000200) \
  40. /* Don't check for write-protect */ \
  41. US_FLAG(MAX_SECTORS_64, 0x00000400) \
  42. /* Sets max_sectors to 64 */ \
  43. US_FLAG(IGNORE_DEVICE, 0x00000800) \
  44. /* Don't claim device */ \
  45. US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \
  46. /* sometimes sizes is too big */ \
  47. US_FLAG(MAX_SECTORS_MIN,0x00002000) \
  48. /* Sets max_sectors to arch min */ \
  49. US_FLAG(BULK_IGNORE_TAG,0x00004000) \
  50. /* Ignore tag mismatch in bulk operations */ \
  51. US_FLAG(SANE_SENSE, 0x00008000) \
  52. /* Sane Sense (> 18 bytes) */ \
  53. US_FLAG(CAPACITY_OK, 0x00010000) \
  54. /* READ CAPACITY response is correct */ \
  55. US_FLAG(BAD_SENSE, 0x00020000) \
  56. /* Bad Sense (never more than 18 bytes) */ \
  57. US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
  58. /* cannot handle READ_DISC_INFO */ \
  59. US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
  60. /* cannot handle READ_CAPACITY_16 */ \
  61. US_FLAG(INITIAL_READ10, 0x00100000) \
  62. /* Initial READ(10) (and others) must be retried */ \
  63. US_FLAG(WRITE_CACHE, 0x00200000) \
  64. /* Write Cache status is not available */ \
  65. US_FLAG(NEEDS_CAP16, 0x00400000) \
  66. /* cannot handle READ_CAPACITY_10 */ \
  67. US_FLAG(IGNORE_UAS, 0x00800000) \
  68. /* Device advertises UAS but it is broken */ \
  69. US_FLAG(BROKEN_FUA, 0x01000000) \
  70. /* Cannot handle FUA in WRITE or READ CDBs */ \
  71. US_FLAG(NO_ATA_1X, 0x02000000) \
  72. /* Cannot handle ATA_12 or ATA_16 CDBs */ \
  73. US_FLAG(NO_REPORT_OPCODES, 0x04000000) \
  74. /* Cannot handle MI_REPORT_SUPPORTED_OPERATION_CODES */ \
  75. US_FLAG(MAX_SECTORS_240, 0x08000000) \
  76. /* Sets max_sectors to 240 */ \
  77. US_FLAG(NO_REPORT_LUNS, 0x10000000) \
  78. /* Cannot handle REPORT_LUNS */ \
  79. #define US_FLAG(name, value) US_FL_##name = value ,
  80. enum { US_DO_ALL_FLAGS };
  81. #undef US_FLAG
  82. #include <linux/usb/storage.h>
  83. extern int usb_usual_ignore_device(struct usb_interface *intf);
  84. extern struct usb_device_id usb_storage_usb_ids[];
  85. #endif /* __LINUX_USB_USUAL_H */