Lines Matching defs:tl_tpg

107 	struct tcm_loop_tpg *tl_tpg;
112 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
115 * Ensure that this tl_tpg reference from the incoming sc->device->id
118 if (!tl_tpg->tl_hba) {
122 if (tl_tpg->tl_transport_status == TCM_TRANSPORT_OFFLINE) {
126 tl_nexus = tl_tpg->tl_nexus;
189 static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
201 tl_nexus = tl_tpg->tl_nexus;
214 se_sess = tl_tpg->tl_nexus->se_sess;
236 struct tcm_loop_tpg *tl_tpg;
243 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
244 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
256 struct tcm_loop_tpg *tl_tpg;
263 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
265 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
273 struct tcm_loop_tpg *tl_tpg;
284 * Locate the tl_tpg pointer from TargetID in sc->device->id
286 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
287 if (tl_tpg) {
288 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE;
445 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg)
455 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0];
464 return tl_tpg(se_tpg)->tl_tpgt;
478 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
480 return tl_tpg->tl_fabric_prot_type;
585 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
587 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
589 atomic_inc_mb(&tl_tpg->tl_tpg_port_count);
593 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun);
605 struct tcm_loop_tpg *tl_tpg;
607 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg);
608 tl_hba = tl_tpg->tl_hba;
610 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt,
614 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun);
623 atomic_dec_mb(&tl_tpg->tl_tpg_port_count);
634 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
637 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type);
644 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
657 tl_tpg->tl_fabric_prot_type = val;
674 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
677 tl_tpg->tl_nexus = p;
682 struct tcm_loop_tpg *tl_tpg,
685 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
689 if (tl_tpg->tl_nexus) {
690 pr_debug("tl_tpg->tl_nexus already exists\n");
698 tl_nexus->se_sess = target_setup_session(&tl_tpg->tl_se_tpg, 0, 0,
749 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
754 tl_nexus = tl_tpg->tl_nexus;
768 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
770 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
777 ret = tcm_loop_drop_nexus(tl_tpg);
832 ret = tcm_loop_make_nexus(tl_tpg, port_ptr);
843 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
848 switch (tl_tpg->tl_transport_status) {
869 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
873 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE;
877 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE;
878 if (tl_tpg->tl_nexus) {
879 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess;
892 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
894 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
897 tl_hba->sh->host_no, tl_tpg->tl_tpgt);
918 struct tcm_loop_tpg *tl_tpg;
934 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt];
935 tl_tpg->tl_hba = tl_hba;
936 tl_tpg->tl_tpgt = tpgt;
938 * Register the tl_tpg as a emulated TCM Target Endpoint
940 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id);
947 return &tl_tpg->tl_se_tpg;
954 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
959 tl_hba = tl_tpg->tl_hba;
960 tpgt = tl_tpg->tl_tpgt;
964 tcm_loop_drop_nexus(tl_tpg);
966 * Deregister the tl_tpg as a emulated TCM Target Endpoint
970 tl_tpg->tl_hba = NULL;
971 tl_tpg->tl_tpgt = 0;