Lines Matching refs:tl_tpg
107 struct tcm_loop_tpg *tl_tpg; in tcm_loop_target_queue_cmd() local
112 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_queue_cmd()
118 if (!tl_tpg->tl_hba) { in tcm_loop_target_queue_cmd()
122 if (tl_tpg->tl_transport_status == TCM_TRANSPORT_OFFLINE) { in tcm_loop_target_queue_cmd()
126 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_target_queue_cmd()
189 static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg, in tcm_loop_issue_tmr() argument
201 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_issue_tmr()
214 se_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_issue_tmr()
236 struct tcm_loop_tpg *tl_tpg; in tcm_loop_abort_task() local
243 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_abort_task()
244 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_abort_task()
256 struct tcm_loop_tpg *tl_tpg; in tcm_loop_device_reset() local
263 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_device_reset()
265 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_device_reset()
273 struct tcm_loop_tpg *tl_tpg; in tcm_loop_target_reset() local
286 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_reset()
287 if (tl_tpg) { in tcm_loop_target_reset()
288 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_target_reset()
445 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg) in tl_tpg() function
455 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0]; in tcm_loop_get_endpoint_wwn()
464 return tl_tpg(se_tpg)->tl_tpgt; in tcm_loop_get_tag()
478 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_check_prot_fabric_only() local
480 return tl_tpg->tl_fabric_prot_type; in tcm_loop_check_prot_fabric_only()
585 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_port_link() local
587 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_port_link()
589 atomic_inc_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_link()
593 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun); in tcm_loop_port_link()
605 struct tcm_loop_tpg *tl_tpg; in tcm_loop_port_unlink() local
607 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg); in tcm_loop_port_unlink()
608 tl_hba = tl_tpg->tl_hba; in tcm_loop_port_unlink()
610 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, in tcm_loop_port_unlink()
614 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun); in tcm_loop_port_unlink()
623 atomic_dec_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_unlink()
634 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_show() local
637 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type); in tcm_loop_tpg_attrib_fabric_prot_type_show()
644 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_store() local
657 tl_tpg->tl_fabric_prot_type = val; in tcm_loop_tpg_attrib_fabric_prot_type_store()
674 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_alloc_sess_cb() local
677 tl_tpg->tl_nexus = p; in tcm_loop_alloc_sess_cb()
682 struct tcm_loop_tpg *tl_tpg, in tcm_loop_make_nexus() argument
685 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_make_nexus()
689 if (tl_tpg->tl_nexus) { in tcm_loop_make_nexus()
698 tl_nexus->se_sess = target_setup_session(&tl_tpg->tl_se_tpg, 0, 0, in tcm_loop_make_nexus()
749 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_show() local
754 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_tpg_nexus_show()
768 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_store() local
770 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_nexus_store()
777 ret = tcm_loop_drop_nexus(tl_tpg); in tcm_loop_tpg_nexus_store()
832 ret = tcm_loop_make_nexus(tl_tpg, port_ptr); in tcm_loop_tpg_nexus_store()
843 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_show() local
848 switch (tl_tpg->tl_transport_status) { in tcm_loop_tpg_transport_status_show()
869 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_store() local
873 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_tpg_transport_status_store()
877 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE; in tcm_loop_tpg_transport_status_store()
878 if (tl_tpg->tl_nexus) { in tcm_loop_tpg_transport_status_store()
879 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_tpg_transport_status_store()
892 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_address_show() local
894 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_address_show()
897 tl_hba->sh->host_no, tl_tpg->tl_tpgt); in tcm_loop_tpg_address_show()
918 struct tcm_loop_tpg *tl_tpg; in tcm_loop_make_naa_tpg() local
934 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; in tcm_loop_make_naa_tpg()
935 tl_tpg->tl_hba = tl_hba; in tcm_loop_make_naa_tpg()
936 tl_tpg->tl_tpgt = tpgt; in tcm_loop_make_naa_tpg()
940 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id); in tcm_loop_make_naa_tpg()
947 return &tl_tpg->tl_se_tpg; in tcm_loop_make_naa_tpg()
954 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_drop_naa_tpg() local
959 tl_hba = tl_tpg->tl_hba; in tcm_loop_drop_naa_tpg()
960 tpgt = tl_tpg->tl_tpgt; in tcm_loop_drop_naa_tpg()
964 tcm_loop_drop_nexus(tl_tpg); in tcm_loop_drop_naa_tpg()
970 tl_tpg->tl_hba = NULL; in tcm_loop_drop_naa_tpg()
971 tl_tpg->tl_tpgt = 0; in tcm_loop_drop_naa_tpg()