aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2014-02-19 10:50:15 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2014-03-13 15:03:02 -0400
commit19f9361af7dfa0bb1f98c7619544ed71d2dded39 (patch)
tree4afa7db32e56d65500661134906c729699f226bc /include
parentacb2bde3e32100f1ab50e38f0db03660a1cb0a06 (diff)
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 <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include')
-rw-r--r--include/target/target_core_base.h7
1 files changed, 7 insertions, 0 deletions
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 {
463 TARGET_DIF_TYPE3_PROT, 463 TARGET_DIF_TYPE3_PROT,
464}; 464};
465 465
466enum target_core_dif_check {
467 TARGET_DIF_CHECK_GUARD = 0x1 << 0,
468 TARGET_DIF_CHECK_APPTAG = 0x1 << 1,
469 TARGET_DIF_CHECK_REFTAG = 0x1 << 2,
470};
471
466struct se_dif_v1_tuple { 472struct se_dif_v1_tuple {
467 __be16 guard_tag; 473 __be16 guard_tag;
468 __be16 app_tag; 474 __be16 app_tag;
@@ -556,6 +562,7 @@ struct se_cmd {
556 /* DIF related members */ 562 /* DIF related members */
557 enum target_prot_op prot_op; 563 enum target_prot_op prot_op;
558 enum target_prot_type prot_type; 564 enum target_prot_type prot_type;
565 u8 prot_checks;
559 u32 prot_length; 566 u32 prot_length;
560 u32 reftag_seed; 567 u32 reftag_seed;
561 struct scatterlist *t_prot_sg; 568 struct scatterlist *t_prot_sg;