Lines Matching refs:pwrb_context

952 beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context,  in beiscsi_get_wrb_handle()  argument
958 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
959 if (!pwrb_context->wrb_handles_available) { in beiscsi_get_wrb_handle()
960 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
963 pwrb_handle = pwrb_context->pwrb_handle_base[pwrb_context->alloc_index]; in beiscsi_get_wrb_handle()
964 pwrb_context->wrb_handles_available--; in beiscsi_get_wrb_handle()
965 if (pwrb_context->alloc_index == (wrbs_per_cxn - 1)) in beiscsi_get_wrb_handle()
966 pwrb_context->alloc_index = 0; in beiscsi_get_wrb_handle()
968 pwrb_context->alloc_index++; in beiscsi_get_wrb_handle()
969 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
988 struct hwi_wrb_context *pwrb_context; in alloc_wrb_handle() local
993 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in alloc_wrb_handle()
995 *pcontext = pwrb_context; in alloc_wrb_handle()
996 return beiscsi_get_wrb_handle(pwrb_context, phba->params.wrbs_per_cxn); in alloc_wrb_handle()
1000 beiscsi_put_wrb_handle(struct hwi_wrb_context *pwrb_context, in beiscsi_put_wrb_handle() argument
1006 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1007 pwrb_context->pwrb_handle_base[pwrb_context->free_index] = pwrb_handle; in beiscsi_put_wrb_handle()
1008 pwrb_context->wrb_handles_available++; in beiscsi_put_wrb_handle()
1009 if (pwrb_context->free_index == (wrbs_per_cxn - 1)) in beiscsi_put_wrb_handle()
1010 pwrb_context->free_index = 0; in beiscsi_put_wrb_handle()
1012 pwrb_context->free_index++; in beiscsi_put_wrb_handle()
1014 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1026 free_wrb_handle(struct beiscsi_hba *phba, struct hwi_wrb_context *pwrb_context, in free_wrb_handle() argument
1029 beiscsi_put_wrb_handle(pwrb_context, in free_wrb_handle()
1036 pwrb_handle, pwrb_context->free_index, in free_wrb_handle()
1037 pwrb_context->wrb_handles_available); in free_wrb_handle()
1220 struct hwi_wrb_context *pwrb_context; in hwi_complete_drvr_msgs() local
1241 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_drvr_msgs()
1242 pwrb_handle = pwrb_context->pwrb_handle_basestd[wrb_index]; in hwi_complete_drvr_msgs()
1331 struct hwi_wrb_context *pwrb_context; in hwi_complete_cmd() local
1344 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_cmd()
1346 pwrb_handle = pwrb_context->pwrb_handle_basestd[ in hwi_complete_cmd()
2602 struct hwi_wrb_context *pwrb_context; in beiscsi_init_wrb_handle() local
2626 pwrb_context = &phwi_ctrlr->wrb_context[index]; in beiscsi_init_wrb_handle()
2627 pwrb_context->pwrb_handle_base = in beiscsi_init_wrb_handle()
2631 if (!pwrb_context->pwrb_handle_base) { in beiscsi_init_wrb_handle()
2636 pwrb_context->pwrb_handle_basestd = in beiscsi_init_wrb_handle()
2640 if (!pwrb_context->pwrb_handle_basestd) { in beiscsi_init_wrb_handle()
2653 pwrb_context->alloc_index = 0; in beiscsi_init_wrb_handle()
2654 pwrb_context->wrb_handles_available = 0; in beiscsi_init_wrb_handle()
2655 pwrb_context->free_index = 0; in beiscsi_init_wrb_handle()
2659 pwrb_context->pwrb_handle_base[j] = pwrb_handle; in beiscsi_init_wrb_handle()
2660 pwrb_context->pwrb_handle_basestd[j] = in beiscsi_init_wrb_handle()
2662 pwrb_context->wrb_handles_available++; in beiscsi_init_wrb_handle()
2668 spin_lock_init(&pwrb_context->wrb_lock); in beiscsi_init_wrb_handle()
2672 pwrb_context = &phwi_ctrlr->wrb_context[index]; in beiscsi_init_wrb_handle()
2683 pwrb_handle = pwrb_context->pwrb_handle_base[j]; in beiscsi_init_wrb_handle()
2693 pwrb_context = &phwi_ctrlr->wrb_context[j]; in beiscsi_init_wrb_handle()
2694 kfree(pwrb_context->pwrb_handle_base); in beiscsi_init_wrb_handle()
2695 kfree(pwrb_context->pwrb_handle_basestd); in beiscsi_init_wrb_handle()
3341 struct hwi_wrb_context *pwrb_context; in beiscsi_create_wrb_rings() local
3421 pwrb_context = &phwi_ctrlr->wrb_context[i]; in beiscsi_create_wrb_rings()
3422 BE_SET_CID_TO_CRI(i, pwrb_context->cid); in beiscsi_create_wrb_rings()
3432 struct hwi_wrb_context *pwrb_context; in free_wrb_handles() local
3436 pwrb_context = &phwi_ctrlr->wrb_context[index]; in free_wrb_handles()
3437 kfree(pwrb_context->pwrb_handle_base); in free_wrb_handles()
3438 kfree(pwrb_context->pwrb_handle_basestd); in free_wrb_handles()
4197 struct hwi_wrb_context *pwrb_context; in beiscsi_free_mgmt_task_handles() local
4203 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_free_mgmt_task_handles()
4208 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_free_mgmt_task_handles()
4238 struct hwi_wrb_context *pwrb_context; in beiscsi_cleanup_task() local
4244 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_cleanup_task()
4255 free_wrb_handle(phba, pwrb_context, in beiscsi_cleanup_task()
4281 struct hwi_wrb_context *pwrb_context = NULL; in beiscsi_offload_connection() local
4297 &pwrb_context); in beiscsi_offload_connection()
4303 pwrb_context); in beiscsi_offload_connection()
4306 pwrb_context); in beiscsi_offload_connection()
4324 beiscsi_put_wrb_handle(pwrb_context, pwrb_handle, in beiscsi_offload_connection()
4329 pwrb_handle, pwrb_context->free_index, in beiscsi_offload_connection()
4330 pwrb_context->wrb_handles_available); in beiscsi_offload_connection()
4357 struct hwi_wrb_context *pwrb_context; in beiscsi_alloc_pdu() local
4389 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4421 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4454 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4484 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_alloc_pdu()
4486 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_alloc_pdu()
4536 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask_v2()
4538 io_task->pwrb_context->plast_wrb, in beiscsi_iotask_v2()
4540 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask_v2()
4597 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask()
4599 io_task->pwrb_context->plast_wrb, in beiscsi_iotask()
4601 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask()
4641 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4643 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4645 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()
4659 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4661 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4663 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()