Lines Matching refs:tl_tpg
104 struct tcm_loop_tpg *tl_tpg; in tcm_loop_submission_work() local
110 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_submission_work()
116 if (!tl_tpg->tl_hba) { in tcm_loop_submission_work()
120 if (tl_tpg->tl_transport_status == TCM_TRANSPORT_OFFLINE) { in tcm_loop_submission_work()
124 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_submission_work()
202 static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, in tcm_loop_issue_tmr() argument
214 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_issue_tmr()
227 se_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_issue_tmr()
249 struct tcm_loop_tpg *tl_tpg; in tcm_loop_abort_task() local
256 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_abort_task()
257 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_abort_task()
269 struct tcm_loop_tpg *tl_tpg; in tcm_loop_device_reset() local
276 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_device_reset()
278 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_device_reset()
286 struct tcm_loop_tpg *tl_tpg; in tcm_loop_target_reset() local
299 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_reset()
300 if (tl_tpg) { in tcm_loop_target_reset()
301 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_target_reset()
468 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg) in tl_tpg() function
478 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0]; in tcm_loop_get_endpoint_wwn()
487 return tl_tpg(se_tpg)->tl_tpgt; in tcm_loop_get_tag()
525 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_check_prot_fabric_only() local
527 return tl_tpg->tl_fabric_prot_type; in tcm_loop_check_prot_fabric_only()
655 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_port_link() local
657 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_port_link()
659 atomic_inc_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_link()
663 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun); in tcm_loop_port_link()
675 struct tcm_loop_tpg *tl_tpg; in tcm_loop_port_unlink() local
677 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg); in tcm_loop_port_unlink()
678 tl_hba = tl_tpg->tl_hba; in tcm_loop_port_unlink()
680 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, in tcm_loop_port_unlink()
684 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun); in tcm_loop_port_unlink()
693 atomic_dec_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_unlink()
704 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_show() local
707 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type); in tcm_loop_tpg_attrib_fabric_prot_type_show()
714 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_store() local
727 tl_tpg->tl_fabric_prot_type = val; in tcm_loop_tpg_attrib_fabric_prot_type_store()
744 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_alloc_sess_cb() local
747 tl_tpg->tl_nexus = p; in tcm_loop_alloc_sess_cb()
752 struct tcm_loop_tpg *tl_tpg, in tcm_loop_make_nexus() argument
755 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_make_nexus()
759 if (tl_tpg->tl_nexus) { in tcm_loop_make_nexus()
768 tl_nexus->se_sess = target_setup_session(&tl_tpg->tl_se_tpg, 0, 0, in tcm_loop_make_nexus()
819 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_show() local
824 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_tpg_nexus_show()
838 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_store() local
840 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_nexus_store()
847 ret = tcm_loop_drop_nexus(tl_tpg); in tcm_loop_tpg_nexus_store()
902 ret = tcm_loop_make_nexus(tl_tpg, port_ptr); in tcm_loop_tpg_nexus_store()
913 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_show() local
918 switch (tl_tpg->tl_transport_status) { in tcm_loop_tpg_transport_status_show()
939 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_store() local
943 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_tpg_transport_status_store()
947 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE; in tcm_loop_tpg_transport_status_store()
948 if (tl_tpg->tl_nexus) { in tcm_loop_tpg_transport_status_store()
949 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_tpg_transport_status_store()
962 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_address_show() local
964 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_address_show()
967 tl_hba->sh->host_no, tl_tpg->tl_tpgt); in tcm_loop_tpg_address_show()
988 struct tcm_loop_tpg *tl_tpg; in tcm_loop_make_naa_tpg() local
1004 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; in tcm_loop_make_naa_tpg()
1005 tl_tpg->tl_hba = tl_hba; in tcm_loop_make_naa_tpg()
1006 tl_tpg->tl_tpgt = tpgt; in tcm_loop_make_naa_tpg()
1010 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id); in tcm_loop_make_naa_tpg()
1017 return &tl_tpg->tl_se_tpg; in tcm_loop_make_naa_tpg()
1024 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_drop_naa_tpg() local
1029 tl_hba = tl_tpg->tl_hba; in tcm_loop_drop_naa_tpg()
1030 tpgt = tl_tpg->tl_tpgt; in tcm_loop_drop_naa_tpg()
1034 tcm_loop_drop_nexus(tl_tpg); in tcm_loop_drop_naa_tpg()
1040 tl_tpg->tl_hba = NULL; in tcm_loop_drop_naa_tpg()
1041 tl_tpg->tl_tpgt = 0; in tcm_loop_drop_naa_tpg()