scsi_iu.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * This file is in the public domain.
  3. */
  4. #ifndef _SCSI_SCSI_IU_H
  5. #define _SCSI_SCSI_IU_H 1
  6. struct scsi_status_iu_header
  7. {
  8. u_int8_t reserved[2];
  9. u_int8_t flags;
  10. #define SIU_SNSVALID 0x2
  11. #define SIU_RSPVALID 0x1
  12. u_int8_t status;
  13. u_int8_t sense_length[4];
  14. u_int8_t pkt_failures_length[4];
  15. u_int8_t pkt_failures[1];
  16. };
  17. #define SIU_PKTFAIL_OFFSET(siu) 12
  18. #define SIU_PKTFAIL_CODE(siu) (scsi_4btoul((siu)->pkt_failures) & 0xFF)
  19. #define SIU_PFC_NONE 0
  20. #define SIU_PFC_CIU_FIELDS_INVALID 2
  21. #define SIU_PFC_TMF_NOT_SUPPORTED 4
  22. #define SIU_PFC_TMF_FAILED 5
  23. #define SIU_PFC_INVALID_TYPE_CODE 6
  24. #define SIU_PFC_ILLEGAL_REQUEST 7
  25. #define SIU_SENSE_OFFSET(siu) \
  26. (12 + (((siu)->flags & SIU_RSPVALID) \
  27. ? scsi_4btoul((siu)->pkt_failures_length) \
  28. : 0))
  29. #define SIU_TASKMGMT_NONE 0x00
  30. #define SIU_TASKMGMT_ABORT_TASK 0x01
  31. #define SIU_TASKMGMT_ABORT_TASK_SET 0x02
  32. #define SIU_TASKMGMT_CLEAR_TASK_SET 0x04
  33. #define SIU_TASKMGMT_LUN_RESET 0x08
  34. #define SIU_TASKMGMT_TARGET_RESET 0x20
  35. #define SIU_TASKMGMT_CLEAR_ACA 0x40
  36. #endif /*_SCSI_SCSI_IU_H*/