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()
194 static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, in tcm_loop_issue_tmr() argument
206 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_issue_tmr()
219 se_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_issue_tmr()
241 struct tcm_loop_tpg *tl_tpg; in tcm_loop_abort_task() local
248 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_abort_task()
249 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_abort_task()
261 struct tcm_loop_tpg *tl_tpg; in tcm_loop_device_reset() local
268 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_device_reset()
270 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_device_reset()
278 struct tcm_loop_tpg *tl_tpg; in tcm_loop_target_reset() local
291 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_reset()
292 if (tl_tpg) { in tcm_loop_target_reset()
293 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_target_reset()
449 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg) in tl_tpg() function
459 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0]; in tcm_loop_get_endpoint_wwn()
468 return tl_tpg(se_tpg)->tl_tpgt; in tcm_loop_get_tag()
506 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_check_prot_fabric_only() local
508 return tl_tpg->tl_fabric_prot_type; in tcm_loop_check_prot_fabric_only()
625 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_port_link() local
627 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_port_link()
629 atomic_inc_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_link()
633 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun); in tcm_loop_port_link()
645 struct tcm_loop_tpg *tl_tpg; in tcm_loop_port_unlink() local
647 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg); in tcm_loop_port_unlink()
648 tl_hba = tl_tpg->tl_hba; in tcm_loop_port_unlink()
650 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, in tcm_loop_port_unlink()
654 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun); in tcm_loop_port_unlink()
663 atomic_dec_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_unlink()
674 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_show() local
677 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type); in tcm_loop_tpg_attrib_fabric_prot_type_show()
684 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_store() local
697 tl_tpg->tl_fabric_prot_type = val; in tcm_loop_tpg_attrib_fabric_prot_type_store()
714 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_alloc_sess_cb() local
717 tl_tpg->tl_nexus = p; in tcm_loop_alloc_sess_cb()
722 struct tcm_loop_tpg *tl_tpg, in tcm_loop_make_nexus() argument
725 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_make_nexus()
729 if (tl_tpg->tl_nexus) { in tcm_loop_make_nexus()
738 tl_nexus->se_sess = target_setup_session(&tl_tpg->tl_se_tpg, 0, 0, in tcm_loop_make_nexus()
789 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_show() local
794 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_tpg_nexus_show()
808 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_store() local
810 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_nexus_store()
817 ret = tcm_loop_drop_nexus(tl_tpg); in tcm_loop_tpg_nexus_store()
872 ret = tcm_loop_make_nexus(tl_tpg, port_ptr); in tcm_loop_tpg_nexus_store()
883 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_show() local
888 switch (tl_tpg->tl_transport_status) { in tcm_loop_tpg_transport_status_show()
909 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_store() local
913 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_tpg_transport_status_store()
917 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE; in tcm_loop_tpg_transport_status_store()
918 if (tl_tpg->tl_nexus) { in tcm_loop_tpg_transport_status_store()
919 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_tpg_transport_status_store()
932 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_address_show() local
934 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_address_show()
937 tl_hba->sh->host_no, tl_tpg->tl_tpgt); in tcm_loop_tpg_address_show()
958 struct tcm_loop_tpg *tl_tpg; in tcm_loop_make_naa_tpg() local
974 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; in tcm_loop_make_naa_tpg()
975 tl_tpg->tl_hba = tl_hba; in tcm_loop_make_naa_tpg()
976 tl_tpg->tl_tpgt = tpgt; in tcm_loop_make_naa_tpg()
980 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id); in tcm_loop_make_naa_tpg()
987 return &tl_tpg->tl_se_tpg; in tcm_loop_make_naa_tpg()
994 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_drop_naa_tpg() local
999 tl_hba = tl_tpg->tl_hba; in tcm_loop_drop_naa_tpg()
1000 tpgt = tl_tpg->tl_tpgt; in tcm_loop_drop_naa_tpg()
1004 tcm_loop_drop_nexus(tl_tpg); in tcm_loop_drop_naa_tpg()
1010 tl_tpg->tl_hba = NULL; in tcm_loop_drop_naa_tpg()
1011 tl_tpg->tl_tpgt = 0; in tcm_loop_drop_naa_tpg()