Lines Matching refs:tl_tpg

114 	struct tcm_loop_tpg *tl_tpg;  in tcm_loop_target_queue_cmd()  local
119 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_queue_cmd()
125 if (!tl_tpg->tl_hba) { in tcm_loop_target_queue_cmd()
129 if (tl_tpg->tl_transport_status == TCM_TRANSPORT_OFFLINE) { in tcm_loop_target_queue_cmd()
133 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_target_queue_cmd()
196 static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, in tcm_loop_issue_tmr() argument
208 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_issue_tmr()
221 se_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_issue_tmr()
243 struct tcm_loop_tpg *tl_tpg; in tcm_loop_abort_task() local
250 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_abort_task()
251 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_abort_task()
263 struct tcm_loop_tpg *tl_tpg; in tcm_loop_device_reset() local
270 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_device_reset()
272 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_device_reset()
280 struct tcm_loop_tpg *tl_tpg; in tcm_loop_target_reset() local
293 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_reset()
294 if (tl_tpg) { in tcm_loop_target_reset()
295 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_target_reset()
452 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg) in tl_tpg() function
462 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0]; in tcm_loop_get_endpoint_wwn()
471 return tl_tpg(se_tpg)->tl_tpgt; in tcm_loop_get_tag()
509 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_check_prot_fabric_only() local
511 return tl_tpg->tl_fabric_prot_type; in tcm_loop_check_prot_fabric_only()
626 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_port_link() local
628 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_port_link()
630 atomic_inc_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_link()
634 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun); in tcm_loop_port_link()
646 struct tcm_loop_tpg *tl_tpg; in tcm_loop_port_unlink() local
648 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg); in tcm_loop_port_unlink()
649 tl_hba = tl_tpg->tl_hba; in tcm_loop_port_unlink()
651 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, in tcm_loop_port_unlink()
655 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun); in tcm_loop_port_unlink()
664 atomic_dec_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_unlink()
675 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_show() local
678 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type); in tcm_loop_tpg_attrib_fabric_prot_type_show()
685 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_store() local
698 tl_tpg->tl_fabric_prot_type = val; in tcm_loop_tpg_attrib_fabric_prot_type_store()
715 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_alloc_sess_cb() local
718 tl_tpg->tl_nexus = p; in tcm_loop_alloc_sess_cb()
723 struct tcm_loop_tpg *tl_tpg, in tcm_loop_make_nexus() argument
726 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_make_nexus()
730 if (tl_tpg->tl_nexus) { in tcm_loop_make_nexus()
739 tl_nexus->se_sess = target_setup_session(&tl_tpg->tl_se_tpg, 0, 0, in tcm_loop_make_nexus()
790 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_show() local
795 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_tpg_nexus_show()
809 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_store() local
811 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_nexus_store()
818 ret = tcm_loop_drop_nexus(tl_tpg); in tcm_loop_tpg_nexus_store()
873 ret = tcm_loop_make_nexus(tl_tpg, port_ptr); in tcm_loop_tpg_nexus_store()
884 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_show() local
889 switch (tl_tpg->tl_transport_status) { in tcm_loop_tpg_transport_status_show()
910 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_store() local
914 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_tpg_transport_status_store()
918 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE; in tcm_loop_tpg_transport_status_store()
919 if (tl_tpg->tl_nexus) { in tcm_loop_tpg_transport_status_store()
920 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_tpg_transport_status_store()
933 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_address_show() local
935 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_address_show()
938 tl_hba->sh->host_no, tl_tpg->tl_tpgt); in tcm_loop_tpg_address_show()
959 struct tcm_loop_tpg *tl_tpg; in tcm_loop_make_naa_tpg() local
975 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; in tcm_loop_make_naa_tpg()
976 tl_tpg->tl_hba = tl_hba; in tcm_loop_make_naa_tpg()
977 tl_tpg->tl_tpgt = tpgt; in tcm_loop_make_naa_tpg()
981 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id); in tcm_loop_make_naa_tpg()
988 return &tl_tpg->tl_se_tpg; in tcm_loop_make_naa_tpg()
995 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_drop_naa_tpg() local
1000 tl_hba = tl_tpg->tl_hba; in tcm_loop_drop_naa_tpg()
1001 tpgt = tl_tpg->tl_tpgt; in tcm_loop_drop_naa_tpg()
1005 tcm_loop_drop_nexus(tl_tpg); in tcm_loop_drop_naa_tpg()
1011 tl_tpg->tl_hba = NULL; in tcm_loop_drop_naa_tpg()
1012 tl_tpg->tl_tpgt = 0; in tcm_loop_drop_naa_tpg()