diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/target/target_core_backend.h | 3 | ||||
| -rw-r--r-- | include/target/target_core_base.h | 44 |
2 files changed, 47 insertions, 0 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index 39e0114d70c5..0dc2745b9b18 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h | |||
| @@ -41,6 +41,9 @@ struct se_subsystem_api { | |||
| 41 | unsigned int (*get_io_opt)(struct se_device *); | 41 | unsigned int (*get_io_opt)(struct se_device *); |
| 42 | unsigned char *(*get_sense_buffer)(struct se_cmd *); | 42 | unsigned char *(*get_sense_buffer)(struct se_cmd *); |
| 43 | bool (*get_write_cache)(struct se_device *); | 43 | bool (*get_write_cache)(struct se_device *); |
| 44 | int (*init_prot)(struct se_device *); | ||
| 45 | int (*format_prot)(struct se_device *); | ||
| 46 | void (*free_prot)(struct se_device *); | ||
| 44 | }; | 47 | }; |
| 45 | 48 | ||
| 46 | struct sbc_ops { | 49 | struct sbc_ops { |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index dd87ab46ce21..d98048b97fe3 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -435,6 +435,34 @@ struct se_tmr_req { | |||
| 435 | struct list_head tmr_list; | 435 | struct list_head tmr_list; |
| 436 | }; | 436 | }; |
| 437 | 437 | ||
| 438 | enum target_prot_op { | ||
| 439 | TARGET_PROT_NORMAL = 0, | ||
| 440 | TARGET_PROT_DIN_INSERT, | ||
| 441 | TARGET_PROT_DOUT_INSERT, | ||
| 442 | TARGET_PROT_DIN_STRIP, | ||
| 443 | TARGET_PROT_DOUT_STRIP, | ||
| 444 | TARGET_PROT_DIN_PASS, | ||
| 445 | TARGET_PROT_DOUT_PASS, | ||
| 446 | }; | ||
| 447 | |||
| 448 | enum target_prot_ho { | ||
| 449 | PROT_SEPERATED, | ||
| 450 | PROT_INTERLEAVED, | ||
| 451 | }; | ||
| 452 | |||
| 453 | enum target_prot_type { | ||
| 454 | TARGET_DIF_TYPE0_PROT, | ||
| 455 | TARGET_DIF_TYPE1_PROT, | ||
| 456 | TARGET_DIF_TYPE2_PROT, | ||
| 457 | TARGET_DIF_TYPE3_PROT, | ||
| 458 | }; | ||
| 459 | |||
| 460 | struct se_dif_v1_tuple { | ||
| 461 | __be16 guard_tag; | ||
| 462 | __be16 app_tag; | ||
| 463 | __be32 ref_tag; | ||
| 464 | }; | ||
| 465 | |||
| 438 | struct se_cmd { | 466 | struct se_cmd { |
| 439 | /* SAM response code being sent to initiator */ | 467 | /* SAM response code being sent to initiator */ |
| 440 | u8 scsi_status; | 468 | u8 scsi_status; |
| @@ -519,6 +547,17 @@ struct se_cmd { | |||
| 519 | 547 | ||
| 520 | /* Used for lun->lun_ref counting */ | 548 | /* Used for lun->lun_ref counting */ |
| 521 | bool lun_ref_active; | 549 | bool lun_ref_active; |
| 550 | |||
| 551 | /* DIF related members */ | ||
| 552 | enum target_prot_op prot_op; | ||
| 553 | enum target_prot_type prot_type; | ||
| 554 | u32 prot_length; | ||
| 555 | u32 reftag_seed; | ||
| 556 | struct scatterlist *t_prot_sg; | ||
| 557 | unsigned int t_prot_nents; | ||
| 558 | enum target_prot_ho prot_handover; | ||
| 559 | sense_reason_t pi_err; | ||
| 560 | u32 block_num; | ||
| 522 | }; | 561 | }; |
| 523 | 562 | ||
| 524 | struct se_ua { | 563 | struct se_ua { |
| @@ -629,6 +668,9 @@ struct se_dev_attrib { | |||
| 629 | int emulate_tpws; | 668 | int emulate_tpws; |
| 630 | int emulate_caw; | 669 | int emulate_caw; |
| 631 | int emulate_3pc; | 670 | int emulate_3pc; |
| 671 | int pi_prot_format; | ||
| 672 | enum target_prot_type pi_prot_type; | ||
| 673 | enum target_prot_type hw_pi_prot_type; | ||
| 632 | int enforce_pr_isids; | 674 | int enforce_pr_isids; |
| 633 | int is_nonrot; | 675 | int is_nonrot; |
| 634 | int emulate_rest_reord; | 676 | int emulate_rest_reord; |
| @@ -759,6 +801,8 @@ struct se_device { | |||
| 759 | /* Linked list for struct se_hba struct se_device list */ | 801 | /* Linked list for struct se_hba struct se_device list */ |
| 760 | struct list_head dev_list; | 802 | struct list_head dev_list; |
| 761 | struct se_lun xcopy_lun; | 803 | struct se_lun xcopy_lun; |
| 804 | /* Protection Information */ | ||
| 805 | int prot_length; | ||
| 762 | }; | 806 | }; |
| 763 | 807 | ||
| 764 | struct se_hba { | 808 | struct se_hba { |
