diff options
author | David Disseldorp <ddiss@suse.de> | 2020-02-21 10:44:01 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-02-21 17:37:16 -0500 |
commit | 1bf630fddd505e4d3e1c7e857eb54f8da787fe9a (patch) | |
tree | e9d21c227d4e09fe26f3f8cf9eead8202cb1c1f9 /include/target | |
parent | 87310c9fb502868798c26c6720837718e94dd479 (diff) | |
download | linux-1bf630fddd505e4d3e1c7e857eb54f8da787fe9a.tar.gz |
scsi: target: use an enum to track emulate_ua_intlck_ctrl
The emulate_ua_intlck_ctrl device attribute accepts values of 0, 1 or 2 via
ConfigFS, which map to unit attention interlocks control codes in the MODE
SENSE control Mode Page. Use an enum to track these values so that it's
clear that, unlike the remaining emulate_X attributes,
emulate_ua_intlck_ctrl isn't boolean.
Link: https://marc.info/?l=target-devel&m=158227825428798
Suggested-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index bbac0f1c3ba1..6d4a694f6ea7 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -74,8 +74,6 @@ #define DA_EMULATE_MODEL_ALIAS 0 /* Emulation for WriteCache and SYNCHRONIZE_CACHE */ #define DA_EMULATE_WRITE_CACHE 0 -/* Emulation for UNIT ATTENTION Interlock Control */ -#define DA_EMULATE_UA_INTLLCK_CTRL 0 /* Emulation for TASK_ABORTED status (TAS) by default */ #define DA_EMULATE_TAS 1 /* Emulation for Thin Provisioning UNMAP using block/blk-lib.c:blkdev_issue_discard() */ @@ -433,6 +431,13 @@ enum target_prot_type { TARGET_DIF_TYPE3_PROT, }; +/* Emulation for UNIT ATTENTION Interlock Control */ +enum target_ua_intlck_ctrl { + TARGET_UA_INTLCK_CTRL_CLEAR = 0, + TARGET_UA_INTLCK_CTRL_NO_CLEAR = 1, + TARGET_UA_INTLCK_CTRL_ESTABLISH_UA = 2, +}; + enum target_core_dif_check { TARGET_DIF_CHECK_GUARD = 0x1 << 0, TARGET_DIF_CHECK_APPTAG = 0x1 << 1, @@ -668,7 +673,7 @@ struct se_dev_attrib { bool emulate_fua_write; bool emulate_fua_read; /* deprecated */ bool emulate_write_cache; - int emulate_ua_intlck_ctrl; + enum target_ua_intlck_ctrl emulate_ua_intlck_ctrl; bool emulate_tas; bool emulate_tpu; bool emulate_tpws; |