Lines Matching refs:pwrb_context

951 beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context,  in beiscsi_get_wrb_handle()  argument
957 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
958 if (!pwrb_context->wrb_handles_available) { in beiscsi_get_wrb_handle()
959 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
962 pwrb_handle = pwrb_context->pwrb_handle_base[pwrb_context->alloc_index]; in beiscsi_get_wrb_handle()
963 pwrb_context->wrb_handles_available--; in beiscsi_get_wrb_handle()
964 if (pwrb_context->alloc_index == (wrbs_per_cxn - 1)) in beiscsi_get_wrb_handle()
965 pwrb_context->alloc_index = 0; in beiscsi_get_wrb_handle()
967 pwrb_context->alloc_index++; in beiscsi_get_wrb_handle()
968 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
987 struct hwi_wrb_context *pwrb_context; in alloc_wrb_handle() local
992 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in alloc_wrb_handle()
994 *pcontext = pwrb_context; in alloc_wrb_handle()
995 return beiscsi_get_wrb_handle(pwrb_context, phba->params.wrbs_per_cxn); in alloc_wrb_handle()
999 beiscsi_put_wrb_handle(struct hwi_wrb_context *pwrb_context, in beiscsi_put_wrb_handle() argument
1005 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1006 pwrb_context->pwrb_handle_base[pwrb_context->free_index] = pwrb_handle; in beiscsi_put_wrb_handle()
1007 pwrb_context->wrb_handles_available++; in beiscsi_put_wrb_handle()
1008 if (pwrb_context->free_index == (wrbs_per_cxn - 1)) in beiscsi_put_wrb_handle()
1009 pwrb_context->free_index = 0; in beiscsi_put_wrb_handle()
1011 pwrb_context->free_index++; in beiscsi_put_wrb_handle()
1013 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1025 free_wrb_handle(struct beiscsi_hba *phba, struct hwi_wrb_context *pwrb_context, in free_wrb_handle() argument
1028 beiscsi_put_wrb_handle(pwrb_context, in free_wrb_handle()
1035 pwrb_handle, pwrb_context->free_index, in free_wrb_handle()
1036 pwrb_context->wrb_handles_available); in free_wrb_handle()
1219 struct hwi_wrb_context *pwrb_context; in hwi_complete_drvr_msgs() local
1240 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_drvr_msgs()
1241 pwrb_handle = pwrb_context->pwrb_handle_basestd[wrb_index]; in hwi_complete_drvr_msgs()
1330 struct hwi_wrb_context *pwrb_context; in hwi_complete_cmd() local
1343 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_cmd()
1345 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()
3344 struct hwi_wrb_context *pwrb_context; in beiscsi_create_wrb_rings() local
3425 pwrb_context = &phwi_ctrlr->wrb_context[i]; in beiscsi_create_wrb_rings()
3426 BE_SET_CID_TO_CRI(i, pwrb_context->cid); in beiscsi_create_wrb_rings()
3436 struct hwi_wrb_context *pwrb_context; in free_wrb_handles() local
3440 pwrb_context = &phwi_ctrlr->wrb_context[index]; in free_wrb_handles()
3441 kfree(pwrb_context->pwrb_handle_base); in free_wrb_handles()
3442 kfree(pwrb_context->pwrb_handle_basestd); in free_wrb_handles()
4219 struct hwi_wrb_context *pwrb_context; in beiscsi_free_mgmt_task_handles() local
4225 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_free_mgmt_task_handles()
4230 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_free_mgmt_task_handles()
4260 struct hwi_wrb_context *pwrb_context; in beiscsi_cleanup_task() local
4266 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_cleanup_task()
4277 free_wrb_handle(phba, pwrb_context, in beiscsi_cleanup_task()
4303 struct hwi_wrb_context *pwrb_context = NULL; in beiscsi_offload_connection() local
4319 &pwrb_context); in beiscsi_offload_connection()
4325 pwrb_context); in beiscsi_offload_connection()
4328 pwrb_context); in beiscsi_offload_connection()
4346 beiscsi_put_wrb_handle(pwrb_context, pwrb_handle, in beiscsi_offload_connection()
4351 pwrb_handle, pwrb_context->free_index, in beiscsi_offload_connection()
4352 pwrb_context->wrb_handles_available); in beiscsi_offload_connection()
4379 struct hwi_wrb_context *pwrb_context; in beiscsi_alloc_pdu() local
4411 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4444 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4479 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4509 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_alloc_pdu()
4511 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_alloc_pdu()
4561 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask_v2()
4563 io_task->pwrb_context->plast_wrb, in beiscsi_iotask_v2()
4565 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask_v2()
4622 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask()
4624 io_task->pwrb_context->plast_wrb, in beiscsi_iotask()
4626 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask()
4666 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4668 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4670 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()
4684 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4686 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4688 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()