Lines Matching refs:pwrb_context
968 beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context, in beiscsi_get_wrb_handle() argument
974 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
975 if (!pwrb_context->wrb_handles_available) { in beiscsi_get_wrb_handle()
976 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
979 pwrb_handle = pwrb_context->pwrb_handle_base[pwrb_context->alloc_index]; in beiscsi_get_wrb_handle()
980 pwrb_context->wrb_handles_available--; in beiscsi_get_wrb_handle()
981 if (pwrb_context->alloc_index == (wrbs_per_cxn - 1)) in beiscsi_get_wrb_handle()
982 pwrb_context->alloc_index = 0; in beiscsi_get_wrb_handle()
984 pwrb_context->alloc_index++; in beiscsi_get_wrb_handle()
985 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
1004 struct hwi_wrb_context *pwrb_context; in alloc_wrb_handle() local
1009 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in alloc_wrb_handle()
1011 *pcontext = pwrb_context; in alloc_wrb_handle()
1012 return beiscsi_get_wrb_handle(pwrb_context, phba->params.wrbs_per_cxn); in alloc_wrb_handle()
1016 beiscsi_put_wrb_handle(struct hwi_wrb_context *pwrb_context, in beiscsi_put_wrb_handle() argument
1022 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1023 pwrb_context->pwrb_handle_base[pwrb_context->free_index] = pwrb_handle; in beiscsi_put_wrb_handle()
1024 pwrb_context->wrb_handles_available++; in beiscsi_put_wrb_handle()
1025 if (pwrb_context->free_index == (wrbs_per_cxn - 1)) in beiscsi_put_wrb_handle()
1026 pwrb_context->free_index = 0; in beiscsi_put_wrb_handle()
1028 pwrb_context->free_index++; in beiscsi_put_wrb_handle()
1030 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1042 free_wrb_handle(struct beiscsi_hba *phba, struct hwi_wrb_context *pwrb_context, in free_wrb_handle() argument
1045 beiscsi_put_wrb_handle(pwrb_context, in free_wrb_handle()
1052 pwrb_handle, pwrb_context->free_index, in free_wrb_handle()
1053 pwrb_context->wrb_handles_available); in free_wrb_handle()
1236 struct hwi_wrb_context *pwrb_context; in hwi_complete_drvr_msgs() local
1257 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_drvr_msgs()
1258 pwrb_handle = pwrb_context->pwrb_handle_basestd[wrb_index]; in hwi_complete_drvr_msgs()
1347 struct hwi_wrb_context *pwrb_context; in hwi_complete_cmd() local
1360 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_cmd()
1362 pwrb_handle = pwrb_context->pwrb_handle_basestd[ in hwi_complete_cmd()
2618 struct hwi_wrb_context *pwrb_context; in beiscsi_init_wrb_handle() local
2642 pwrb_context = &phwi_ctrlr->wrb_context[index]; in beiscsi_init_wrb_handle()
2643 pwrb_context->pwrb_handle_base = in beiscsi_init_wrb_handle()
2647 if (!pwrb_context->pwrb_handle_base) { in beiscsi_init_wrb_handle()
2652 pwrb_context->pwrb_handle_basestd = in beiscsi_init_wrb_handle()
2656 if (!pwrb_context->pwrb_handle_basestd) { in beiscsi_init_wrb_handle()
2669 pwrb_context->alloc_index = 0; in beiscsi_init_wrb_handle()
2670 pwrb_context->wrb_handles_available = 0; in beiscsi_init_wrb_handle()
2671 pwrb_context->free_index = 0; in beiscsi_init_wrb_handle()
2675 pwrb_context->pwrb_handle_base[j] = pwrb_handle; in beiscsi_init_wrb_handle()
2676 pwrb_context->pwrb_handle_basestd[j] = in beiscsi_init_wrb_handle()
2678 pwrb_context->wrb_handles_available++; in beiscsi_init_wrb_handle()
2684 spin_lock_init(&pwrb_context->wrb_lock); in beiscsi_init_wrb_handle()
2688 pwrb_context = &phwi_ctrlr->wrb_context[index]; in beiscsi_init_wrb_handle()
2699 pwrb_handle = pwrb_context->pwrb_handle_base[j]; in beiscsi_init_wrb_handle()
2709 pwrb_context = &phwi_ctrlr->wrb_context[j]; in beiscsi_init_wrb_handle()
2710 kfree(pwrb_context->pwrb_handle_base); in beiscsi_init_wrb_handle()
2711 kfree(pwrb_context->pwrb_handle_basestd); in beiscsi_init_wrb_handle()
3358 struct hwi_wrb_context *pwrb_context; in beiscsi_create_wrb_rings() local
3438 pwrb_context = &phwi_ctrlr->wrb_context[i]; in beiscsi_create_wrb_rings()
3439 BE_SET_CID_TO_CRI(i, pwrb_context->cid); in beiscsi_create_wrb_rings()
3449 struct hwi_wrb_context *pwrb_context; in free_wrb_handles() local
3453 pwrb_context = &phwi_ctrlr->wrb_context[index]; in free_wrb_handles()
3454 kfree(pwrb_context->pwrb_handle_base); in free_wrb_handles()
3455 kfree(pwrb_context->pwrb_handle_basestd); in free_wrb_handles()
4214 struct hwi_wrb_context *pwrb_context; in beiscsi_free_mgmt_task_handles() local
4220 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_free_mgmt_task_handles()
4225 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_free_mgmt_task_handles()
4255 struct hwi_wrb_context *pwrb_context; in beiscsi_cleanup_task() local
4261 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_cleanup_task()
4272 free_wrb_handle(phba, pwrb_context, in beiscsi_cleanup_task()
4298 struct hwi_wrb_context *pwrb_context = NULL; in beiscsi_offload_connection() local
4314 &pwrb_context); in beiscsi_offload_connection()
4320 pwrb_context); in beiscsi_offload_connection()
4323 pwrb_context); in beiscsi_offload_connection()
4341 beiscsi_put_wrb_handle(pwrb_context, pwrb_handle, in beiscsi_offload_connection()
4346 pwrb_handle, pwrb_context->free_index, in beiscsi_offload_connection()
4347 pwrb_context->wrb_handles_available); in beiscsi_offload_connection()
4374 struct hwi_wrb_context *pwrb_context; in beiscsi_alloc_pdu() local
4406 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4438 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4471 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4501 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_alloc_pdu()
4503 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_alloc_pdu()
4553 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask_v2()
4555 io_task->pwrb_context->plast_wrb, in beiscsi_iotask_v2()
4557 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask_v2()
4614 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask()
4616 io_task->pwrb_context->plast_wrb, in beiscsi_iotask()
4618 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask()
4658 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4660 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4662 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()
4676 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4678 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4680 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()