Lines Matching defs:tl_tpg

104 	struct tcm_loop_tpg *tl_tpg;
110 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
113 * Ensure that this tl_tpg reference from the incoming sc->device->id
116 if (!tl_tpg->tl_hba) {
120 if (tl_tpg->tl_transport_status == TCM_TRANSPORT_OFFLINE) {
124 tl_nexus = tl_tpg->tl_nexus;
194 static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
206 tl_nexus = tl_tpg->tl_nexus;
219 se_sess = tl_tpg->tl_nexus->se_sess;
241 struct tcm_loop_tpg *tl_tpg;
248 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
249 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
261 struct tcm_loop_tpg *tl_tpg;
268 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
270 ret = tcm_loop_issue_tmr(tl_tpg, sc->device->lun,
278 struct tcm_loop_tpg *tl_tpg;
289 * Locate the tl_tpg pointer from TargetID in sc->device->id
291 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
292 if (tl_tpg) {
293 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE;
449 static inline struct tcm_loop_tpg *tl_tpg(struct se_portal_group *se_tpg)
459 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0];
468 return tl_tpg(se_tpg)->tl_tpgt;
506 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
508 return tl_tpg->tl_fabric_prot_type;
625 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
627 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
629 atomic_inc_mb(&tl_tpg->tl_tpg_port_count);
633 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun);
645 struct tcm_loop_tpg *tl_tpg;
647 tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, tl_se_tpg);
648 tl_hba = tl_tpg->tl_hba;
650 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt,
654 0, tl_tpg->tl_tpgt, se_lun->unpacked_lun);
663 atomic_dec_mb(&tl_tpg->tl_tpg_port_count);
674 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
677 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type);
684 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
697 tl_tpg->tl_fabric_prot_type = val;
714 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
717 tl_tpg->tl_nexus = p;
722 struct tcm_loop_tpg *tl_tpg,
725 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
729 if (tl_tpg->tl_nexus) {
730 pr_debug("tl_tpg->tl_nexus already exists\n");
738 tl_nexus->se_sess = target_setup_session(&tl_tpg->tl_se_tpg, 0, 0,
789 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
794 tl_nexus = tl_tpg->tl_nexus;
808 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
810 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
817 ret = tcm_loop_drop_nexus(tl_tpg);
872 ret = tcm_loop_make_nexus(tl_tpg, port_ptr);
883 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
888 switch (tl_tpg->tl_transport_status) {
909 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
913 tl_tpg->tl_transport_status = TCM_TRANSPORT_ONLINE;
917 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE;
918 if (tl_tpg->tl_nexus) {
919 struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess;
932 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
934 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
937 tl_hba->sh->host_no, tl_tpg->tl_tpgt);
958 struct tcm_loop_tpg *tl_tpg;
974 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt];
975 tl_tpg->tl_hba = tl_hba;
976 tl_tpg->tl_tpgt = tpgt;
978 * Register the tl_tpg as a emulated TCM Target Endpoint
980 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id);
987 return &tl_tpg->tl_se_tpg;
994 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
999 tl_hba = tl_tpg->tl_hba;
1000 tpgt = tl_tpg->tl_tpgt;
1004 tcm_loop_drop_nexus(tl_tpg);
1006 * Deregister the tl_tpg as a emulated TCM Target Endpoint
1010 tl_tpg->tl_hba = NULL;
1011 tl_tpg->tl_tpgt = 0;