aboutsummaryrefslogtreecommitdiffstats
path: root/include/target/target_core_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/target/target_core_base.h')
-rw-r--r--include/target/target_core_base.h56
1 files changed, 16 insertions, 40 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index dc35d8660aa6..128ce46fa48a 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -145,12 +145,9 @@ enum transport_state_table {
145 TRANSPORT_NO_STATE = 0, 145 TRANSPORT_NO_STATE = 0,
146 TRANSPORT_NEW_CMD = 1, 146 TRANSPORT_NEW_CMD = 1,
147 TRANSPORT_WRITE_PENDING = 3, 147 TRANSPORT_WRITE_PENDING = 3,
148 TRANSPORT_PROCESS_WRITE = 4,
149 TRANSPORT_PROCESSING = 5, 148 TRANSPORT_PROCESSING = 5,
150 TRANSPORT_COMPLETE = 6, 149 TRANSPORT_COMPLETE = 6,
151 TRANSPORT_PROCESS_TMR = 9,
152 TRANSPORT_ISTATE_PROCESSING = 11, 150 TRANSPORT_ISTATE_PROCESSING = 11,
153 TRANSPORT_NEW_CMD_MAP = 16,
154 TRANSPORT_COMPLETE_QF_WP = 18, 151 TRANSPORT_COMPLETE_QF_WP = 18,
155 TRANSPORT_COMPLETE_QF_OK = 19, 152 TRANSPORT_COMPLETE_QF_OK = 19,
156}; 153};
@@ -160,25 +157,20 @@ enum se_cmd_flags_table {
160 SCF_SUPPORTED_SAM_OPCODE = 0x00000001, 157 SCF_SUPPORTED_SAM_OPCODE = 0x00000001,
161 SCF_TRANSPORT_TASK_SENSE = 0x00000002, 158 SCF_TRANSPORT_TASK_SENSE = 0x00000002,
162 SCF_EMULATED_TASK_SENSE = 0x00000004, 159 SCF_EMULATED_TASK_SENSE = 0x00000004,
163 SCF_SCSI_DATA_SG_IO_CDB = 0x00000008, 160 SCF_SCSI_DATA_CDB = 0x00000008,
164 SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010, 161 SCF_SCSI_TMR_CDB = 0x00000010,
165 SCF_SCSI_NON_DATA_CDB = 0x00000020, 162 SCF_SCSI_CDB_EXCEPTION = 0x00000020,
166 SCF_SCSI_TMR_CDB = 0x00000040, 163 SCF_SCSI_RESERVATION_CONFLICT = 0x00000040,
167 SCF_SCSI_CDB_EXCEPTION = 0x00000080, 164 SCF_FUA = 0x00000080,
168 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, 165 SCF_SE_LUN_CMD = 0x00000100,
169 SCF_FUA = 0x00000200, 166 SCF_BIDI = 0x00000400,
170 SCF_SE_LUN_CMD = 0x00000800, 167 SCF_SENT_CHECK_CONDITION = 0x00000800,
171 SCF_SE_ALLOW_EOO = 0x00001000, 168 SCF_OVERFLOW_BIT = 0x00001000,
172 SCF_BIDI = 0x00002000, 169 SCF_UNDERFLOW_BIT = 0x00002000,
173 SCF_SENT_CHECK_CONDITION = 0x00004000, 170 SCF_SENT_DELAYED_TAS = 0x00004000,
174 SCF_OVERFLOW_BIT = 0x00008000, 171 SCF_ALUA_NON_OPTIMIZED = 0x00008000,
175 SCF_UNDERFLOW_BIT = 0x00010000, 172 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000,
176 SCF_SENT_DELAYED_TAS = 0x00020000, 173 SCF_ACK_KREF = 0x00040000,
177 SCF_ALUA_NON_OPTIMIZED = 0x00040000,
178 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000,
179 SCF_UNUSED = 0x00100000,
180 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00200000,
181 SCF_ACK_KREF = 0x00400000,
182}; 174};
183 175
184/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 176/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -220,6 +212,7 @@ enum tcm_sense_reason_table {
220 TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, 212 TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e,
221 TCM_CHECK_CONDITION_NOT_READY = 0x0f, 213 TCM_CHECK_CONDITION_NOT_READY = 0x0f,
222 TCM_RESERVATION_CONFLICT = 0x10, 214 TCM_RESERVATION_CONFLICT = 0x10,
215 TCM_ADDRESS_OUT_OF_RANGE = 0x11,
223}; 216};
224 217
225enum target_sc_flags_table { 218enum target_sc_flags_table {
@@ -471,13 +464,6 @@ struct t10_reservation {
471 struct t10_reservation_ops pr_ops; 464 struct t10_reservation_ops pr_ops;
472}; 465};
473 466
474struct se_queue_obj {
475 atomic_t queue_cnt;
476 spinlock_t cmd_queue_lock;
477 struct list_head qobj_list;
478 wait_queue_head_t thread_wq;
479};
480
481struct se_tmr_req { 467struct se_tmr_req {
482 /* Task Management function to be performed */ 468 /* Task Management function to be performed */
483 u8 function; 469 u8 function;
@@ -486,11 +472,8 @@ struct se_tmr_req {
486 int call_transport; 472 int call_transport;
487 /* Reference to ITT that Task Mgmt should be performed */ 473 /* Reference to ITT that Task Mgmt should be performed */
488 u32 ref_task_tag; 474 u32 ref_task_tag;
489 /* 64-bit encoded SAM LUN from $FABRIC_MOD TMR header */
490 u64 ref_task_lun;
491 void *fabric_tmr_ptr; 475 void *fabric_tmr_ptr;
492 struct se_cmd *task_cmd; 476 struct se_cmd *task_cmd;
493 struct se_cmd *ref_cmd;
494 struct se_device *tmr_dev; 477 struct se_device *tmr_dev;
495 struct se_lun *tmr_lun; 478 struct se_lun *tmr_lun;
496 struct list_head tmr_list; 479 struct list_head tmr_list;
@@ -537,7 +520,6 @@ struct se_cmd {
537 /* Only used for internal passthrough and legacy TCM fabric modules */ 520 /* Only used for internal passthrough and legacy TCM fabric modules */
538 struct se_session *se_sess; 521 struct se_session *se_sess;
539 struct se_tmr_req *se_tmr_req; 522 struct se_tmr_req *se_tmr_req;
540 struct list_head se_queue_node;
541 struct list_head se_cmd_list; 523 struct list_head se_cmd_list;
542 struct completion cmd_wait_comp; 524 struct completion cmd_wait_comp;
543 struct kref cmd_kref; 525 struct kref cmd_kref;
@@ -575,7 +557,6 @@ struct se_cmd {
575 struct scatterlist *t_bidi_data_sg; 557 struct scatterlist *t_bidi_data_sg;
576 unsigned int t_bidi_data_nents; 558 unsigned int t_bidi_data_nents;
577 559
578 struct list_head execute_list;
579 struct list_head state_list; 560 struct list_head state_list;
580 bool state_active; 561 bool state_active;
581 562
@@ -633,7 +614,6 @@ struct se_session {
633 struct list_head sess_list; 614 struct list_head sess_list;
634 struct list_head sess_acl_list; 615 struct list_head sess_acl_list;
635 struct list_head sess_cmd_list; 616 struct list_head sess_cmd_list;
636 struct list_head sess_wait_list;
637 spinlock_t sess_cmd_lock; 617 spinlock_t sess_cmd_lock;
638 struct kref sess_kref; 618 struct kref sess_kref;
639}; 619};
@@ -780,13 +760,11 @@ struct se_device {
780 /* Active commands on this virtual SE device */ 760 /* Active commands on this virtual SE device */
781 atomic_t simple_cmds; 761 atomic_t simple_cmds;
782 atomic_t dev_ordered_id; 762 atomic_t dev_ordered_id;
783 atomic_t execute_tasks;
784 atomic_t dev_ordered_sync; 763 atomic_t dev_ordered_sync;
785 atomic_t dev_qf_count; 764 atomic_t dev_qf_count;
786 struct se_obj dev_obj; 765 struct se_obj dev_obj;
787 struct se_obj dev_access_obj; 766 struct se_obj dev_access_obj;
788 struct se_obj dev_export_obj; 767 struct se_obj dev_export_obj;
789 struct se_queue_obj dev_queue_obj;
790 spinlock_t delayed_cmd_lock; 768 spinlock_t delayed_cmd_lock;
791 spinlock_t execute_task_lock; 769 spinlock_t execute_task_lock;
792 spinlock_t dev_reservation_lock; 770 spinlock_t dev_reservation_lock;
@@ -802,11 +780,9 @@ struct se_device {
802 struct t10_pr_registration *dev_pr_res_holder; 780 struct t10_pr_registration *dev_pr_res_holder;
803 struct list_head dev_sep_list; 781 struct list_head dev_sep_list;
804 struct list_head dev_tmr_list; 782 struct list_head dev_tmr_list;
805 /* Pointer to descriptor for processing thread */ 783 struct workqueue_struct *tmr_wq;
806 struct task_struct *process_thread;
807 struct work_struct qf_work_queue; 784 struct work_struct qf_work_queue;
808 struct list_head delayed_cmd_list; 785 struct list_head delayed_cmd_list;
809 struct list_head execute_list;
810 struct list_head state_list; 786 struct list_head state_list;
811 struct list_head qf_cmd_list; 787 struct list_head qf_cmd_list;
812 /* Pointer to associated SE HBA */ 788 /* Pointer to associated SE HBA */