uas.h 1004 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef __USB_UAS_H__
  2. #define __USB_UAS_H__
  3. #include <scsi/scsi.h>
  4. #include <scsi/scsi_cmnd.h>
  5. /* Common header for all IUs */
  6. struct iu {
  7. __u8 iu_id;
  8. __u8 rsvd1;
  9. __be16 tag;
  10. };
  11. enum {
  12. IU_ID_COMMAND = 0x01,
  13. IU_ID_STATUS = 0x03,
  14. IU_ID_RESPONSE = 0x04,
  15. IU_ID_TASK_MGMT = 0x05,
  16. IU_ID_READ_READY = 0x06,
  17. IU_ID_WRITE_READY = 0x07,
  18. };
  19. struct command_iu {
  20. __u8 iu_id;
  21. __u8 rsvd1;
  22. __be16 tag;
  23. __u8 prio_attr;
  24. __u8 rsvd5;
  25. __u8 len;
  26. __u8 rsvd7;
  27. struct scsi_lun lun;
  28. __u8 cdb[16]; /* XXX: Overflow-checking tools may misunderstand */
  29. };
  30. /*
  31. * Also used for the Read Ready and Write Ready IUs since they have the
  32. * same first four bytes
  33. */
  34. struct sense_iu {
  35. __u8 iu_id;
  36. __u8 rsvd1;
  37. __be16 tag;
  38. __be16 status_qual;
  39. __u8 status;
  40. __u8 rsvd7[7];
  41. __be16 len;
  42. __u8 sense[SCSI_SENSE_BUFFERSIZE];
  43. };
  44. enum {
  45. CMD_PIPE_ID = 1,
  46. STATUS_PIPE_ID = 2,
  47. DATA_IN_PIPE_ID = 3,
  48. DATA_OUT_PIPE_ID = 4,
  49. UAS_SIMPLE_TAG = 0,
  50. UAS_HEAD_TAG = 1,
  51. UAS_ORDERED_TAG = 2,
  52. UAS_ACA = 4,
  53. };
  54. #endif