Lines Matching refs:tl_hba

113 	struct tcm_loop_hba *tl_hba;  in tcm_loop_target_queue_cmd()  local
118 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host); in tcm_loop_target_queue_cmd()
119 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_queue_cmd()
125 if (!tl_tpg->tl_hba) { in tcm_loop_target_queue_cmd()
242 struct tcm_loop_hba *tl_hba; in tcm_loop_abort_task() local
249 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host); in tcm_loop_abort_task()
250 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_abort_task()
262 struct tcm_loop_hba *tl_hba; in tcm_loop_device_reset() local
269 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host); in tcm_loop_device_reset()
270 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_device_reset()
279 struct tcm_loop_hba *tl_hba; in tcm_loop_target_reset() local
285 tl_hba = *(struct tcm_loop_hba **)shost_priv(sc->device->host); in tcm_loop_target_reset()
286 if (!tl_hba) { in tcm_loop_target_reset()
293 tl_tpg = &tl_hba->tl_hba_tpgs[sc->device->id]; in tcm_loop_target_reset()
321 struct tcm_loop_hba *tl_hba; in tcm_loop_driver_probe() local
325 tl_hba = to_tcm_loop_hba(dev); in tcm_loop_driver_probe()
333 tl_hba->sh = sh; in tcm_loop_driver_probe()
338 *((struct tcm_loop_hba **)sh->hostdata) = tl_hba; in tcm_loop_driver_probe()
357 error = scsi_add_host(sh, &tl_hba->dev); in tcm_loop_driver_probe()
368 struct tcm_loop_hba *tl_hba; in tcm_loop_driver_remove() local
371 tl_hba = to_tcm_loop_hba(dev); in tcm_loop_driver_remove()
372 sh = tl_hba->sh; in tcm_loop_driver_remove()
380 struct tcm_loop_hba *tl_hba = to_tcm_loop_hba(dev); in tcm_loop_release_adapter() local
382 kfree(tl_hba); in tcm_loop_release_adapter()
388 static int tcm_loop_setup_hba_bus(struct tcm_loop_hba *tl_hba, int tcm_loop_host_id) in tcm_loop_setup_hba_bus() argument
392 tl_hba->dev.bus = &tcm_loop_lld_bus; in tcm_loop_setup_hba_bus()
393 tl_hba->dev.parent = tcm_loop_primary; in tcm_loop_setup_hba_bus()
394 tl_hba->dev.release = &tcm_loop_release_adapter; in tcm_loop_setup_hba_bus()
395 dev_set_name(&tl_hba->dev, "tcm_loop_adapter_%d", tcm_loop_host_id); in tcm_loop_setup_hba_bus()
397 ret = device_register(&tl_hba->dev); in tcm_loop_setup_hba_bus()
400 put_device(&tl_hba->dev); in tcm_loop_setup_hba_bus()
462 return &tl_tpg(se_tpg)->tl_hba->tl_wwn_address[0]; in tcm_loop_get_endpoint_wwn()
604 static char *tcm_loop_dump_proto_id(struct tcm_loop_hba *tl_hba) in tcm_loop_dump_proto_id() argument
606 switch (tl_hba->tl_proto_id) { in tcm_loop_dump_proto_id()
628 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_port_link() local
634 scsi_add_device(tl_hba->sh, 0, tl_tpg->tl_tpgt, lun->unpacked_lun); in tcm_loop_port_link()
645 struct tcm_loop_hba *tl_hba; in tcm_loop_port_unlink() local
649 tl_hba = tl_tpg->tl_hba; in tcm_loop_port_unlink()
651 sd = scsi_device_lookup(tl_hba->sh, 0, tl_tpg->tl_tpgt, in tcm_loop_port_unlink()
726 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_make_nexus() local
749 tcm_loop_dump_proto_id(tl_hba), name); in tcm_loop_make_nexus()
774 tcm_loop_dump_proto_id(tpg->tl_hba), in tcm_loop_drop_nexus()
811 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_nexus_store() local
835 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_SAS) { in tcm_loop_tpg_nexus_store()
837 i_port, tcm_loop_dump_proto_id(tl_hba)); in tcm_loop_tpg_nexus_store()
845 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_FCP) { in tcm_loop_tpg_nexus_store()
847 i_port, tcm_loop_dump_proto_id(tl_hba)); in tcm_loop_tpg_nexus_store()
855 if (tl_hba->tl_proto_id != SCSI_PROTOCOL_ISCSI) { in tcm_loop_tpg_nexus_store()
857 i_port, tcm_loop_dump_proto_id(tl_hba)); in tcm_loop_tpg_nexus_store()
935 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; in tcm_loop_tpg_address_show() local
938 tl_hba->sh->host_no, tl_tpg->tl_tpgt); in tcm_loop_tpg_address_show()
957 struct tcm_loop_hba *tl_hba = container_of(wwn, in tcm_loop_make_naa_tpg() local
975 tl_tpg = &tl_hba->tl_hba_tpgs[tpgt]; in tcm_loop_make_naa_tpg()
976 tl_tpg->tl_hba = tl_hba; in tcm_loop_make_naa_tpg()
981 ret = core_tpg_register(wwn, &tl_tpg->tl_se_tpg, tl_hba->tl_proto_id); in tcm_loop_make_naa_tpg()
986 tcm_loop_dump_proto_id(tl_hba), in tcm_loop_make_naa_tpg()
997 struct tcm_loop_hba *tl_hba; in tcm_loop_drop_naa_tpg() local
1000 tl_hba = tl_tpg->tl_hba; in tcm_loop_drop_naa_tpg()
1011 tl_tpg->tl_hba = NULL; in tcm_loop_drop_naa_tpg()
1015 tcm_loop_dump_proto_id(tl_hba), in tcm_loop_drop_naa_tpg()
1028 struct tcm_loop_hba *tl_hba; in tcm_loop_make_scsi_hba() local
1033 tl_hba = kzalloc(sizeof(*tl_hba), GFP_KERNEL); in tcm_loop_make_scsi_hba()
1034 if (!tl_hba) in tcm_loop_make_scsi_hba()
1043 tl_hba->tl_proto_id = SCSI_PROTOCOL_SAS; in tcm_loop_make_scsi_hba()
1048 tl_hba->tl_proto_id = SCSI_PROTOCOL_FCP; in tcm_loop_make_scsi_hba()
1059 tl_hba->tl_proto_id = SCSI_PROTOCOL_ISCSI; in tcm_loop_make_scsi_hba()
1064 name, tcm_loop_dump_proto_id(tl_hba), TL_WWN_ADDR_LEN); in tcm_loop_make_scsi_hba()
1068 snprintf(&tl_hba->tl_wwn_address[0], TL_WWN_ADDR_LEN, "%s", &name[off]); in tcm_loop_make_scsi_hba()
1075 ret = tcm_loop_setup_hba_bus(tl_hba, tcm_loop_hba_no_cnt); in tcm_loop_make_scsi_hba()
1079 sh = tl_hba->sh; in tcm_loop_make_scsi_hba()
1082 tcm_loop_dump_proto_id(tl_hba), name, sh->host_no); in tcm_loop_make_scsi_hba()
1083 return &tl_hba->tl_hba_wwn; in tcm_loop_make_scsi_hba()
1085 kfree(tl_hba); in tcm_loop_make_scsi_hba()
1092 struct tcm_loop_hba *tl_hba = container_of(wwn, in tcm_loop_drop_scsi_hba() local
1096 tcm_loop_dump_proto_id(tl_hba), tl_hba->tl_wwn_address, in tcm_loop_drop_scsi_hba()
1097 tl_hba->sh->host_no); in tcm_loop_drop_scsi_hba()
1103 device_unregister(&tl_hba->dev); in tcm_loop_drop_scsi_hba()