Lines Matching defs:tl_hba
103 struct tcm_loop_hba *tl_hba;
109 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
110 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
116 if (!tl_tpg->tl_hba) {
240 struct tcm_loop_hba *tl_hba;
247 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
248 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
260 struct tcm_loop_hba *tl_hba;
267 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
268 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
277 struct tcm_loop_hba *tl_hba;
283 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
284 if (!tl_hba) {
291 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
320 struct tcm_loop_hba *tl_hba;
324 tl_hba = to_tcm_loop_hba(dev);
332 tl_hba->sh = sh;
337 *((struct tcm_loop_hba **)sh->hostdata) = tl_hba;
353 error = scsi_add_host(sh, &tl_hba->dev);
364 struct tcm_loop_hba *tl_hba;
367 tl_hba = to_tcm_loop_hba(dev);
368 sh = tl_hba->sh;
377 struct tcm_loop_hba *tl_hba = to_tcm_loop_hba(dev);
379 kfree(tl_hba);
385 static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host_id)
389 tl_hba->dev.bus = &tcm_loop_lld_bus;
390 tl_hba->dev.parent = tcm_loop_primary;
391 tl_hba->dev.release = &tcm_loop_release_adapter;
392 dev_set_name(&tl_hba->dev, "tcm_loop_adapter_%d", tcm_loop_host_id);
394 ret = device_register(&tl_hba->dev);
396 pr_err("device_register() failed for tl_hba->dev: %d\n", ret);
397 put_device(&tl_hba->dev);
459 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0];
603 static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba)
605 switch (tl_hba->tl_proto_id) {
627 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
633 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun);
644 struct tcm_loop_hba *tl_hba;
648 tl_hba = tl_tpg->tl_hba;
650 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt,
725 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
748 tcm_loop_dump_proto_id(tl_hba), name);
773 tcm_loop_dump_proto_id(tpg->tl_hba),
810 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
834 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_SAS) {
836 i_port, tcm_loop_dump_proto_id(tl_hba));
844 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_FCP) {
846 i_port, tcm_loop_dump_proto_id(tl_hba));
854 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_ISCSI) {
856 i_port, tcm_loop_dump_proto_id(tl_hba));
934 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
937 tl_hba->sh->host_no, tl_tpg->tl_tpgt);
956 struct tcm_loop_hba *tl_hba = container_of(wwn,
974 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt];
975 tl_tpg->tl_hba = tl_hba;
980 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id);
985 tcm_loop_dump_proto_id(tl_hba),
996 struct tcm_loop_hba *tl_hba;
999 tl_hba = tl_tpg->tl_hba;
1010 tl_tpg->tl_hba = NULL;
1014 tcm_loop_dump_proto_id(tl_hba),
1027 struct tcm_loop_hba *tl_hba;
1032 tl_hba = kzalloc(sizeof(*tl_hba), GFP_KERNEL);
1033 if (!tl_hba)
1042 tl_hba->tl_proto_id = SCSI_PROTOCOL_SAS;
1047 tl_hba->tl_proto_id = SCSI_PROTOCOL_FCP;
1058 tl_hba->tl_proto_id = SCSI_PROTOCOL_ISCSI;
1063 name, tcm_loop_dump_proto_id(tl_hba), TL_WWN_ADDR_LEN);
1067 snprintf(&tl_hba->tl_wwn_address[0], TL_WWN_ADDR_LEN, "%s", &name[off]);
1070 * Call device_register(tl_hba->dev) to register the emulated
1071 * Linux/SCSI LLD of type struct Scsi_Host at tl_hba->sh after
1074 ret = tcm_loop_setup_hba_bus(tl_hba, tcm_loop_hba_no_cnt);
1078 sh = tl_hba->sh;
1081 tcm_loop_dump_proto_id(tl_hba), name, sh->host_no);
1082 return &tl_hba->tl_hba_wwn;
1084 kfree(tl_hba);
1091 struct tcm_loop_hba *tl_hba = container_of(wwn,
1095 tcm_loop_dump_proto_id(tl_hba), tl_hba->tl_wwn_address,
1096 tl_hba->sh->host_no);
1098 * Call device_unregister() on the original tl_hba->dev.
1100 * release *tl_hba;
1102 device_unregister(&tl_hba->dev);