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()
257 struct tcm_loop_tpg *tl_tpg; in tcm_loop_device_reset() local
264 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_device_reset()
266 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun, in tcm_loop_device_reset()
274 struct tcm_loop_tpg *tl_tpg; in tcm_loop_target_reset() local
287 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_reset()
288 if (tl_tpg) { in tcm_loop_target_reset()
289 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_target_reset()
446 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg) in tl_tpg() function
456 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0]; in tcm_loop_get_endpoint_wwn()
465 return tl_tpg(se_tpg)->tl_tpgt; in tcm_loop_get_tag()
479 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_check_prot_fabric_only() local
481 return tl_tpg->tl_fabric_prot_type; in tcm_loop_check_prot_fabric_only()
586 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_port_link() local
588 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_port_link()
590 atomic_inc_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_link()
594 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun); in tcm_loop_port_link()
606 struct tcm_loop_tpg *tl_tpg; in tcm_loop_port_unlink() local
608 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg); in tcm_loop_port_unlink()
609 tl_hba = tl_tpg->tl_hba; in tcm_loop_port_unlink()
611 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, in tcm_loop_port_unlink()
615 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun); in tcm_loop_port_unlink()
624 atomic_dec_mb(&tl_tpg->tl_tpg_port_count); in tcm_loop_port_unlink()
635 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_show() local
638 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type); in tcm_loop_tpg_attrib_fabric_prot_type_show()
645 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, in tcm_loop_tpg_attrib_fabric_prot_type_store() local
658 tl_tpg->tl_fabric_prot_type = val; in tcm_loop_tpg_attrib_fabric_prot_type_store()
675 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_alloc_sess_cb() local
678 tl_tpg->tl_nexus = p; in tcm_loop_alloc_sess_cb()
683 struct tcm_loop_tpg *tl_tpg, in tcm_loop_make_nexus() argument
686 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_make_nexus()
690 if (tl_tpg->tl_nexus) { in tcm_loop_make_nexus()
699 tl_nexus->se_sess = target_setup_session(&tl_tpg->tl_se_tpg, 0, 0, in tcm_loop_make_nexus()
750 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_show() local
755 tl_nexus = tl_tpg->tl_nexus; in tcm_loop_tpg_nexus_show()
769 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_nexus_store() local
771 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_nexus_store()
778 ret = tcm_loop_drop_nexus(tl_tpg); in tcm_loop_tpg_nexus_store()
833 ret = tcm_loop_make_nexus(tl_tpg, port_ptr); in tcm_loop_tpg_nexus_store()
844 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_show() local
849 switch (tl_tpg->tl_transport_status) { in tcm_loop_tpg_transport_status_show()
870 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_transport_status_store() local
874 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE; in tcm_loop_tpg_transport_status_store()
878 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE; in tcm_loop_tpg_transport_status_store()
879 if (tl_tpg->tl_nexus) { in tcm_loop_tpg_transport_status_store()
880 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess; in tcm_loop_tpg_transport_status_store()
893 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_tpg_address_show() local
895 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_address_show()
898 tl_hba->sh->host_no, tl_tpg->tl_tpgt); in tcm_loop_tpg_address_show()
919 struct tcm_loop_tpg *tl_tpg; in tcm_loop_make_naa_tpg() local
935 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; in tcm_loop_make_naa_tpg()
936 tl_tpg->tl_hba = tl_hba; in tcm_loop_make_naa_tpg()
937 tl_tpg->tl_tpgt = tpgt; in tcm_loop_make_naa_tpg()
941 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id); in tcm_loop_make_naa_tpg()
948 return &tl_tpg->tl_se_tpg; in tcm_loop_make_naa_tpg()
955 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, in tcm_loop_drop_naa_tpg() local
960 tl_hba = tl_tpg->tl_hba; in tcm_loop_drop_naa_tpg()
961 tpgt = tl_tpg->tl_tpgt; in tcm_loop_drop_naa_tpg()
965 tcm_loop_drop_nexus(tl_tpg); in tcm_loop_drop_naa_tpg()
971 tl_tpg->tl_hba = NULL; in tcm_loop_drop_naa_tpg()
972 tl_tpg->tl_tpgt = 0; in tcm_loop_drop_naa_tpg()