Lines Matching refs:hba
124 struct se_hba *hba; in core_alloc_hba() local
127 hba = kzalloc(sizeof(*hba), GFP_KERNEL); in core_alloc_hba()
128 if (!hba) { in core_alloc_hba()
133 spin_lock_init(&hba->device_lock); in core_alloc_hba()
134 mutex_init(&hba->hba_access_mutex); in core_alloc_hba()
136 hba->hba_index = scsi_get_new_index(SCSI_INST_INDEX); in core_alloc_hba()
137 hba->hba_flags |= hba_flags; in core_alloc_hba()
139 hba->backend = core_get_backend(plugin_name); in core_alloc_hba()
140 if (!hba->backend) { in core_alloc_hba()
145 ret = hba->backend->ops->attach_hba(hba, plugin_dep_id); in core_alloc_hba()
150 hba->hba_id = hba_id_counter++; in core_alloc_hba()
151 list_add_tail(&hba->hba_node, &hba_list); in core_alloc_hba()
155 " Core\n", hba->hba_id); in core_alloc_hba()
157 return hba; in core_alloc_hba()
160 module_put(hba->backend->ops->owner); in core_alloc_hba()
161 hba->backend = NULL; in core_alloc_hba()
163 kfree(hba); in core_alloc_hba()
168 core_delete_hba(struct se_hba *hba) in core_delete_hba() argument
170 WARN_ON(hba->dev_count); in core_delete_hba()
172 hba->backend->ops->detach_hba(hba); in core_delete_hba()
175 list_del(&hba->hba_node); in core_delete_hba()
179 " Core\n", hba->hba_id); in core_delete_hba()
181 module_put(hba->backend->ops->owner); in core_delete_hba()
183 hba->backend = NULL; in core_delete_hba()
184 kfree(hba); in core_delete_hba()