Lines Matching defs:tl_hba
106 struct tcm_loop_hba *tl_hba;
111 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
112 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
118 if (!tl_tpg->tl_hba) {
235 struct tcm_loop_hba *tl_hba;
242 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
243 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
255 struct tcm_loop_hba *tl_hba;
262 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
263 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
272 struct tcm_loop_hba *tl_hba;
278 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host);
279 if (!tl_hba) {
286 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id];
314 struct tcm_loop_hba *tl_hba;
318 tl_hba = to_tcm_loop_hba(dev);
326 tl_hba->sh = sh;
331 *((struct tcm_loop_hba **)sh->hostdata) = tl_hba;
350 error = scsi_add_host(sh, &tl_hba->dev);
361 struct tcm_loop_hba *tl_hba;
364 tl_hba = to_tcm_loop_hba(dev);
365 sh = tl_hba->sh;
373 struct tcm_loop_hba *tl_hba = to_tcm_loop_hba(dev);
375 kfree(tl_hba);
381 static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host_id)
385 tl_hba->dev.bus = &tcm_loop_lld_bus;
386 tl_hba->dev.parent = tcm_loop_primary;
387 tl_hba->dev.release = &tcm_loop_release_adapter;
388 dev_set_name(&tl_hba->dev, "tcm_loop_adapter_%d", tcm_loop_host_id);
390 ret = device_register(&tl_hba->dev);
392 pr_err("device_register() failed for tl_hba->dev: %d\n", ret);
393 put_device(&tl_hba->dev);
455 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0];
563 static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba)
565 switch (tl_hba->tl_proto_id) {
587 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
593 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun);
604 struct tcm_loop_hba *tl_hba;
608 tl_hba = tl_tpg->tl_hba;
610 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt,
685 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
708 tcm_loop_dump_proto_id(tl_hba), name);
733 tcm_loop_dump_proto_id(tpg->tl_hba),
770 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
794 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_SAS) {
796 i_port, tcm_loop_dump_proto_id(tl_hba));
804 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_FCP) {
806 i_port, tcm_loop_dump_proto_id(tl_hba));
814 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_ISCSI) {
816 i_port, tcm_loop_dump_proto_id(tl_hba));
894 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
897 tl_hba->sh->host_no, tl_tpg->tl_tpgt);
916 struct tcm_loop_hba *tl_hba = container_of(wwn,
934 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt];
935 tl_tpg->tl_hba = tl_hba;
940 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id);
945 tcm_loop_dump_proto_id(tl_hba),
956 struct tcm_loop_hba *tl_hba;
959 tl_hba = tl_tpg->tl_hba;
970 tl_tpg->tl_hba = NULL;
974 tcm_loop_dump_proto_id(tl_hba),
987 struct tcm_loop_hba *tl_hba;
992 tl_hba = kzalloc(sizeof(*tl_hba), GFP_KERNEL);
993 if (!tl_hba)
1002 tl_hba->tl_proto_id = SCSI_PROTOCOL_SAS;
1007 tl_hba->tl_proto_id = SCSI_PROTOCOL_FCP;
1018 tl_hba->tl_proto_id = SCSI_PROTOCOL_ISCSI;
1023 name, tcm_loop_dump_proto_id(tl_hba), TL_WWN_ADDR_LEN);
1027 snprintf(&tl_hba->tl_wwn_address[0], TL_WWN_ADDR_LEN, "%s", &name[off]);
1030 * Call device_register(tl_hba->dev) to register the emulated
1031 * Linux/SCSI LLD of type struct Scsi_Host at tl_hba->sh after
1034 ret = tcm_loop_setup_hba_bus(tl_hba, tcm_loop_hba_no_cnt);
1038 sh = tl_hba->sh;
1041 tcm_loop_dump_proto_id(tl_hba), name, sh->host_no);
1042 return &tl_hba->tl_hba_wwn;
1044 kfree(tl_hba);
1051 struct tcm_loop_hba *tl_hba = container_of(wwn,
1055 tcm_loop_dump_proto_id(tl_hba), tl_hba->tl_wwn_address,
1056 tl_hba->sh->host_no);
1058 * Call device_unregister() on the original tl_hba->dev.
1060 * release *tl_hba;
1062 device_unregister(&tl_hba->dev);