Lines Matching refs:tl_tpg

116 	struct tcm_loop_tpg *tl_tpg;  in tcm_loop_submission_work()  local
122 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_submission_work()
128 if (!tl_tpg->tl_hba) { in tcm_loop_submission_work()
132 if (tl_tpg->tl_transport_status == TCM_TRANSPORT_OFFLINE) { in tcm_loop_submission_work()
136 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_submission_work()
216 static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, in tcm_loop_issue_tmr() argument
230 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_issue_tmr()
251 se_tpg = &tl_tpg->tl_se_tpg; in tcm_loop_issue_tmr()
252 se_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_issue_tmr()
297 struct tcm_loop_tpg *tl_tpg; in tcm_loop_abort_task() local
304 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_abort_task()
305 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_abort_task()
317 struct tcm_loop_tpg *tl_tpg; in tcm_loop_device_reset() local
324 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_device_reset()
326 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_device_reset()
334 struct tcm_loop_tpg *tl_tpg; in tcm_loop_target_reset() local
348 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_reset()
349 if (tl_tpg) { in tcm_loop_target_reset()
350 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_target_reset()
519 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg) in tl_tpg() function
529 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0]; in tcm_loop_get_endpoint_wwn()
538 return tl_tpg(se_tpg)->tl_tpgt; in tcm_loop_get_tag()
576 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_check_prot_fabric_only() local
578 return tl_tpg->tl_fabric_prot_type; in tcm_loop_check_prot_fabric_only()
719 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_port_link() local
721 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_port_link()
723 atomic_inc_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_link()
727 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun); in tcm_loop_port_link()
739 struct tcm_loop_tpg *tl_tpg; in tcm_loop_port_unlink() local
741 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg); in tcm_loop_port_unlink()
742 tl_hba = tl_tpg->tl_hba; in tcm_loop_port_unlink()
744 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, in tcm_loop_port_unlink()
748 "%llu\n", 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun); in tcm_loop_port_unlink()
757 atomic_dec_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_unlink()
768 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_show() local
771 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type); in tcm_loop_tpg_attrib_fabric_prot_type_show()
778 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_store() local
791 tl_tpg->tl_fabric_prot_type = val; in tcm_loop_tpg_attrib_fabric_prot_type_store()
806 struct tcm_loop_tpg *tl_tpg, in tcm_loop_make_nexus() argument
810 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_make_nexus()
814 if (tl_tpg->tl_nexus) { in tcm_loop_make_nexus()
818 se_tpg = &tl_tpg->tl_se_tpg; in tcm_loop_make_nexus()
848 tl_tpg->tl_nexus = tl_nexus; in tcm_loop_make_nexus()
897 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_show() local
902 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_tpg_nexus_show()
916 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_store() local
918 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_nexus_store()
925 ret = tcm_loop_drop_nexus(tl_tpg); in tcm_loop_tpg_nexus_store()
983 ret = tcm_loop_make_nexus(tl_tpg, port_ptr); in tcm_loop_tpg_nexus_store()
994 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_show() local
999 switch (tl_tpg->tl_transport_status) { in tcm_loop_tpg_transport_status_show()
1020 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_store() local
1024 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_tpg_transport_status_store()
1028 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE; in tcm_loop_tpg_transport_status_store()
1029 if (tl_tpg->tl_nexus) { in tcm_loop_tpg_transport_status_store()
1030 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_tpg_transport_status_store()
1057 struct tcm_loop_tpg *tl_tpg; in tcm_loop_make_naa_tpg() local
1074 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; in tcm_loop_make_naa_tpg()
1075 tl_tpg->tl_hba = tl_hba; in tcm_loop_make_naa_tpg()
1076 tl_tpg->tl_tpgt = tpgt; in tcm_loop_make_naa_tpg()
1080 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id); in tcm_loop_make_naa_tpg()
1088 return &tl_tpg->tl_se_tpg; in tcm_loop_make_naa_tpg()
1095 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_drop_naa_tpg() local
1100 tl_hba = tl_tpg->tl_hba; in tcm_loop_drop_naa_tpg()
1101 tpgt = tl_tpg->tl_tpgt; in tcm_loop_drop_naa_tpg()
1105 tcm_loop_drop_nexus(tl_tpg); in tcm_loop_drop_naa_tpg()
1111 tl_tpg->tl_hba = NULL; in tcm_loop_drop_naa_tpg()
1112 tl_tpg->tl_tpgt = 0; in tcm_loop_drop_naa_tpg()