scsi_status.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _SCSI_SCSI_STATUS_H
  3. #define _SCSI_SCSI_STATUS_H
  4. #include <linux/types.h>
  5. #include <scsi/scsi_proto.h>
  6. /* Message codes. */
  7. enum scsi_msg_byte {
  8. COMMAND_COMPLETE = 0x00,
  9. EXTENDED_MESSAGE = 0x01,
  10. SAVE_POINTERS = 0x02,
  11. RESTORE_POINTERS = 0x03,
  12. DISCONNECT = 0x04,
  13. INITIATOR_ERROR = 0x05,
  14. ABORT_TASK_SET = 0x06,
  15. MESSAGE_REJECT = 0x07,
  16. NOP = 0x08,
  17. MSG_PARITY_ERROR = 0x09,
  18. LINKED_CMD_COMPLETE = 0x0a,
  19. LINKED_FLG_CMD_COMPLETE = 0x0b,
  20. TARGET_RESET = 0x0c,
  21. ABORT_TASK = 0x0d,
  22. CLEAR_TASK_SET = 0x0e,
  23. INITIATE_RECOVERY = 0x0f, /* SCSI-II only */
  24. RELEASE_RECOVERY = 0x10, /* SCSI-II only */
  25. TERMINATE_IO_PROC = 0x11, /* SCSI-II only */
  26. CLEAR_ACA = 0x16,
  27. LOGICAL_UNIT_RESET = 0x17,
  28. SIMPLE_QUEUE_TAG = 0x20,
  29. HEAD_OF_QUEUE_TAG = 0x21,
  30. ORDERED_QUEUE_TAG = 0x22,
  31. IGNORE_WIDE_RESIDUE = 0x23,
  32. ACA = 0x24,
  33. QAS_REQUEST = 0x55,
  34. /* Old SCSI2 names, don't use in new code */
  35. BUS_DEVICE_RESET = TARGET_RESET,
  36. ABORT = ABORT_TASK_SET,
  37. };
  38. /* Host byte codes. */
  39. enum scsi_host_status {
  40. DID_OK = 0x00, /* NO error */
  41. DID_NO_CONNECT = 0x01, /* Couldn't connect before timeout period */
  42. DID_BUS_BUSY = 0x02, /* BUS stayed busy through time out period */
  43. DID_TIME_OUT = 0x03, /* TIMED OUT for other reason */
  44. DID_BAD_TARGET = 0x04, /* BAD target. */
  45. DID_ABORT = 0x05, /* Told to abort for some other reason */
  46. DID_PARITY = 0x06, /* Parity error */
  47. DID_ERROR = 0x07, /* Internal error */
  48. DID_RESET = 0x08, /* Reset by somebody. */
  49. DID_BAD_INTR = 0x09, /* Got an interrupt we weren't expecting. */
  50. DID_PASSTHROUGH = 0x0a, /* Force command past mid-layer */
  51. DID_SOFT_ERROR = 0x0b, /* The low level driver just wish a retry */
  52. DID_IMM_RETRY = 0x0c, /* Retry without decrementing retry count */
  53. DID_REQUEUE = 0x0d, /* Requeue command (no immediate retry) also
  54. * without decrementing the retry count */
  55. DID_TRANSPORT_DISRUPTED = 0x0e, /* Transport error disrupted execution
  56. * and the driver blocked the port to
  57. * recover the link. Transport class will
  58. * retry or fail IO */
  59. DID_TRANSPORT_FAILFAST = 0x0f, /* Transport class fastfailed the io */
  60. /*
  61. * We used to have DID_TARGET_FAILURE, DID_NEXUS_FAILURE,
  62. * DID_ALLOC_FAILURE and DID_MEDIUM_ERROR at 0x10 - 0x13. For compat
  63. * with userspace apps that parse the host byte for SG IO, we leave
  64. * that block of codes unused and start at 0x14 below.
  65. */
  66. DID_TRANSPORT_MARGINAL = 0x14, /* Transport marginal errors */
  67. };
  68. #endif /* _SCSI_SCSI_STATUS_H */