1149d0e48SBart Van Assche /* SPDX-License-Identifier: GPL-2.0 */ 2149d0e48SBart Van Assche 3149d0e48SBart Van Assche #ifndef _SCSI_SCSI_STATUS_H 4149d0e48SBart Van Assche #define _SCSI_SCSI_STATUS_H 5149d0e48SBart Van Assche 6149d0e48SBart Van Assche #include <linux/types.h> 7149d0e48SBart Van Assche #include <scsi/scsi_proto.h> 8149d0e48SBart Van Assche 9149d0e48SBart Van Assche /* Message codes. */ 10149d0e48SBart Van Assche enum scsi_msg_byte { 11149d0e48SBart Van Assche COMMAND_COMPLETE = 0x00, 12149d0e48SBart Van Assche EXTENDED_MESSAGE = 0x01, 13149d0e48SBart Van Assche SAVE_POINTERS = 0x02, 14149d0e48SBart Van Assche RESTORE_POINTERS = 0x03, 15149d0e48SBart Van Assche DISCONNECT = 0x04, 16149d0e48SBart Van Assche INITIATOR_ERROR = 0x05, 17149d0e48SBart Van Assche ABORT_TASK_SET = 0x06, 18149d0e48SBart Van Assche MESSAGE_REJECT = 0x07, 19149d0e48SBart Van Assche NOP = 0x08, 20149d0e48SBart Van Assche MSG_PARITY_ERROR = 0x09, 21149d0e48SBart Van Assche LINKED_CMD_COMPLETE = 0x0a, 22149d0e48SBart Van Assche LINKED_FLG_CMD_COMPLETE = 0x0b, 23149d0e48SBart Van Assche TARGET_RESET = 0x0c, 24149d0e48SBart Van Assche ABORT_TASK = 0x0d, 25149d0e48SBart Van Assche CLEAR_TASK_SET = 0x0e, 26149d0e48SBart Van Assche INITIATE_RECOVERY = 0x0f, /* SCSI-II only */ 27149d0e48SBart Van Assche RELEASE_RECOVERY = 0x10, /* SCSI-II only */ 28149d0e48SBart Van Assche TERMINATE_IO_PROC = 0x11, /* SCSI-II only */ 29149d0e48SBart Van Assche CLEAR_ACA = 0x16, 30149d0e48SBart Van Assche LOGICAL_UNIT_RESET = 0x17, 31149d0e48SBart Van Assche SIMPLE_QUEUE_TAG = 0x20, 32149d0e48SBart Van Assche HEAD_OF_QUEUE_TAG = 0x21, 33149d0e48SBart Van Assche ORDERED_QUEUE_TAG = 0x22, 34149d0e48SBart Van Assche IGNORE_WIDE_RESIDUE = 0x23, 35149d0e48SBart Van Assche ACA = 0x24, 36149d0e48SBart Van Assche QAS_REQUEST = 0x55, 37149d0e48SBart Van Assche 38149d0e48SBart Van Assche /* Old SCSI2 names, don't use in new code */ 39149d0e48SBart Van Assche BUS_DEVICE_RESET = TARGET_RESET, 40149d0e48SBart Van Assche ABORT = ABORT_TASK_SET, 41149d0e48SBart Van Assche }; 42149d0e48SBart Van Assche 43149d0e48SBart Van Assche /* Host byte codes. */ 44149d0e48SBart Van Assche enum scsi_host_status { 45149d0e48SBart Van Assche DID_OK = 0x00, /* NO error */ 46149d0e48SBart Van Assche DID_NO_CONNECT = 0x01, /* Couldn't connect before timeout period */ 47149d0e48SBart Van Assche DID_BUS_BUSY = 0x02, /* BUS stayed busy through time out period */ 48149d0e48SBart Van Assche DID_TIME_OUT = 0x03, /* TIMED OUT for other reason */ 49149d0e48SBart Van Assche DID_BAD_TARGET = 0x04, /* BAD target. */ 50149d0e48SBart Van Assche DID_ABORT = 0x05, /* Told to abort for some other reason */ 51149d0e48SBart Van Assche DID_PARITY = 0x06, /* Parity error */ 52149d0e48SBart Van Assche DID_ERROR = 0x07, /* Internal error */ 53149d0e48SBart Van Assche DID_RESET = 0x08, /* Reset by somebody. */ 54149d0e48SBart Van Assche DID_BAD_INTR = 0x09, /* Got an interrupt we weren't expecting. */ 55149d0e48SBart Van Assche DID_PASSTHROUGH = 0x0a, /* Force command past mid-layer */ 56149d0e48SBart Van Assche DID_SOFT_ERROR = 0x0b, /* The low level driver just wish a retry */ 57149d0e48SBart Van Assche DID_IMM_RETRY = 0x0c, /* Retry without decrementing retry count */ 58149d0e48SBart Van Assche DID_REQUEUE = 0x0d, /* Requeue command (no immediate retry) also 59149d0e48SBart Van Assche * without decrementing the retry count */ 60149d0e48SBart Van Assche DID_TRANSPORT_DISRUPTED = 0x0e, /* Transport error disrupted execution 61149d0e48SBart Van Assche * and the driver blocked the port to 62149d0e48SBart Van Assche * recover the link. Transport class will 63149d0e48SBart Van Assche * retry or fail IO */ 64149d0e48SBart Van Assche DID_TRANSPORT_FAILFAST = 0x0f, /* Transport class fastfailed the io */ 65*68a3a910SMike Christie /* 66*68a3a910SMike Christie * We used to have DID_TARGET_FAILURE, DID_NEXUS_FAILURE, 67*68a3a910SMike Christie * DID_ALLOC_FAILURE and DID_MEDIUM_ERROR at 0x10 - 0x13. For compat 68*68a3a910SMike Christie * with userspace apps that parse the host byte for SG IO, we leave 69*68a3a910SMike Christie * that block of codes unused and start at 0x14 below. 70*68a3a910SMike Christie */ 71149d0e48SBart Van Assche DID_TRANSPORT_MARGINAL = 0x14, /* Transport marginal errors */ 72149d0e48SBart Van Assche }; 73149d0e48SBart Van Assche 74149d0e48SBart Van Assche #endif /* _SCSI_SCSI_STATUS_H */ 75