Lines Matching refs:hba
105 struct se_hba *hba; in core_alloc_hba() local
108 hba = kzalloc(sizeof(*hba), GFP_KERNEL); in core_alloc_hba()
109 if (!hba) { in core_alloc_hba()
114 spin_lock_init(&hba->device_lock); in core_alloc_hba()
115 mutex_init(&hba->hba_access_mutex); in core_alloc_hba()
117 hba->hba_index = scsi_get_new_index(SCSI_INST_INDEX); in core_alloc_hba()
118 hba->hba_flags |= hba_flags; in core_alloc_hba()
120 hba->transport = core_get_backend(plugin_name); in core_alloc_hba()
121 if (!hba->transport) { in core_alloc_hba()
126 ret = hba->transport->attach_hba(hba, plugin_dep_id); in core_alloc_hba()
131 hba->hba_id = hba_id_counter++; in core_alloc_hba()
132 list_add_tail(&hba->hba_node, &hba_list); in core_alloc_hba()
136 " Core\n", hba->hba_id); in core_alloc_hba()
138 return hba; in core_alloc_hba()
141 module_put(hba->transport->owner); in core_alloc_hba()
142 hba->transport = NULL; in core_alloc_hba()
144 kfree(hba); in core_alloc_hba()
149 core_delete_hba(struct se_hba *hba) in core_delete_hba() argument
151 WARN_ON(hba->dev_count); in core_delete_hba()
153 hba->transport->detach_hba(hba); in core_delete_hba()
156 list_del(&hba->hba_node); in core_delete_hba()
160 " Core\n", hba->hba_id); in core_delete_hba()
162 module_put(hba->transport->owner); in core_delete_hba()
164 hba->transport = NULL; in core_delete_hba()
165 kfree(hba); in core_delete_hba()