From 19f9361af7dfa0bb1f98c7619544ed71d2dded39 Mon Sep 17 00:00:00 2001 From: Sagi Grimberg Date: Wed, 19 Feb 2014 17:50:15 +0200 Subject: Target/sbc: Set protection operation and relevant checks SBC-3 mandates the protection checks that must be performed in the rdprotect/wrprotect field. Use them. According to backstore device pi_attributes and cdb rdprotect/wrprotect field. (Fix incorrect se_cmd->prot_type -> TARGET_PROT_NORMAL comparision in transport_generic_new_cmd - nab) (Fix missing break in sbc_set_prot_op_checks - DanC + Sagi) Signed-off-by: Sagi Grimberg Signed-off-by: Nicholas Bellinger --- include/target/target_core_base.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 1772fadcff62..5ae92492d1ee 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h @@ -463,6 +463,12 @@ enum target_prot_type { TARGET_DIF_TYPE3_PROT, }; +enum target_core_dif_check { + TARGET_DIF_CHECK_GUARD = 0x1 << 0, + TARGET_DIF_CHECK_APPTAG = 0x1 << 1, + TARGET_DIF_CHECK_REFTAG = 0x1 << 2, +}; + struct se_dif_v1_tuple { __be16 guard_tag; __be16 app_tag; @@ -556,6 +562,7 @@ struct se_cmd { /* DIF related members */ enum target_prot_op prot_op; enum target_prot_type prot_type; + u8 prot_checks; u32 prot_length; u32 reftag_seed; struct scatterlist *t_prot_sg; -- cgit v1.2.3