Lines Matching refs:hba
111 struct se_hba *hba; in core_alloc_hba() local
114 hba = kzalloc(sizeof(*hba), GFP_KERNEL); in core_alloc_hba()
115 if (!hba) { in core_alloc_hba()
120 spin_lock_init(&hba->device_lock); in core_alloc_hba()
121 mutex_init(&hba->hba_access_mutex); in core_alloc_hba()
123 hba->hba_index = scsi_get_new_index(SCSI_INST_INDEX); in core_alloc_hba()
124 hba->hba_flags |= hba_flags; in core_alloc_hba()
126 hba->backend = core_get_backend(plugin_name); in core_alloc_hba()
127 if (!hba->backend) { in core_alloc_hba()
132 ret = hba->backend->ops->attach_hba(hba, plugin_dep_id); in core_alloc_hba()
137 hba->hba_id = hba_id_counter++; in core_alloc_hba()
138 list_add_tail(&hba->hba_node, &hba_list); in core_alloc_hba()
142 " Core\n", hba->hba_id); in core_alloc_hba()
144 return hba; in core_alloc_hba()
147 module_put(hba->backend->ops->owner); in core_alloc_hba()
148 hba->backend = NULL; in core_alloc_hba()
150 kfree(hba); in core_alloc_hba()
155 core_delete_hba(struct se_hba *hba) in core_delete_hba() argument
157 WARN_ON(hba->dev_count); in core_delete_hba()
159 hba->backend->ops->detach_hba(hba); in core_delete_hba()
162 list_del(&hba->hba_node); in core_delete_hba()
166 " Core\n", hba->hba_id); in core_delete_hba()
168 module_put(hba->backend->ops->owner); in core_delete_hba()
170 hba->backend = NULL; in core_delete_hba()
171 kfree(hba); in core_delete_hba()