/* bnx2i_find_hba_for_cnic - maps cnic device instance to bnx2i adapter instance @cnic: pointer to cnic device instance  */
struct bnx2i_hba* bnx2i_find_hba_for_cnic(struct cnic_dev *cnic)
/* bnx2i_find_hba_for_cnic - maps cnic device instance to bnx2i adapter instance @cnic: pointer to cnic device instance  */
struct bnx2i_hba* bnx2i_find_hba_for_cnic(struct cnic_dev *cnic)
{
	struct bnx2i_hba *hba, *temp;
	mutex_lock(&bnx2i_dev_lock);
	list_for_each_entry_safe(hba, temp, &adapter_list, link) {
		if (hba->cnic == cnic) {
			mutex_unlock(&bnx2i_dev_lock);
			return hba;
		}
	}
	mutex_unlock(&bnx2i_dev_lock);
	return NULL;
}