Sync up error codes
Instead of using a combo of SCSI status/sense, -Eyxz, and TCMU
defined error codes in the handler API and IO path define
a set of TCMU status codes that will be used.
@@ -34,6 +34,36 @@ struct tcmulib_cmd;
#define TCMU_NOT_HANDLED -1
#define TCMU_ASYNC_HANDLED -2
+/*
+ * TCMU return status codes
+ */
+enum {
+ TCMU_STS_ASYNC_HANDLED = -2,
+ TCMU_STS_NOT_HANDLED = -1,
+ TCMU_STS_OK = 0,
+ TCMU_STS_NO_RESOURCE,
+ /* handler has setup sense. */
+ TCMU_STS_PASSTHROUGH_ERR,
+ TCMU_STS_WR_ERR,
+ TCMU_STS_RD_ERR,
+ TCMU_STS_MISCOMPARE,
+ TCMU_STS_INVALID_CMD,
+ TCMU_STS_INVALID_CDB,
+ TCMU_STS_INVALID_PARAM_LIST,
+ TCMU_STS_INVALID_PARAM_LIST_LEN,
+ TCMU_STS_TIMEOUT,
+ TCMU_STS_FENCED,
+ TCMU_STS_HW_ERR,
+ TCMU_STS_RANGE,
+ TCMU_STS_FRMT_IN_PROGRESS,
+ TCMU_STS_CAPACITY_CHANGED,
+ /* xcopy specific errors */
+ TCMU_STS_NOTSUPP_SEG_DESC_TYPE,
+ TCMU_STS_NOTSUPP_TGT_DESC_TYPE,
+ TCMU_STS_CP_TGT_DEV_NOTCONN,
+ TCMU_STS_INVALID_CP_TGT_DEV_TYPE,
+};
+
#define SENSE_BUFFERSIZE 96
#define CFGFS_ROOT "/sys/kernel/config/target"
