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