Lines Matching refs:pwrb_context
949 beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context, in beiscsi_get_wrb_handle() argument
955 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
956 if (!pwrb_context->wrb_handles_available) { in beiscsi_get_wrb_handle()
957 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
960 pwrb_handle = pwrb_context->pwrb_handle_base[pwrb_context->alloc_index]; in beiscsi_get_wrb_handle()
961 pwrb_context->wrb_handles_available--; in beiscsi_get_wrb_handle()
962 if (pwrb_context->alloc_index == (wrbs_per_cxn - 1)) in beiscsi_get_wrb_handle()
963 pwrb_context->alloc_index = 0; in beiscsi_get_wrb_handle()
965 pwrb_context->alloc_index++; in beiscsi_get_wrb_handle()
966 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_get_wrb_handle()
985 struct hwi_wrb_context *pwrb_context; in alloc_wrb_handle() local
990 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in alloc_wrb_handle()
992 *pcontext = pwrb_context; in alloc_wrb_handle()
993 return beiscsi_get_wrb_handle(pwrb_context, phba->params.wrbs_per_cxn); in alloc_wrb_handle()
997 beiscsi_put_wrb_handle(struct hwi_wrb_context *pwrb_context, in beiscsi_put_wrb_handle() argument
1003 spin_lock_irqsave(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1004 pwrb_context->pwrb_handle_base[pwrb_context->free_index] = pwrb_handle; in beiscsi_put_wrb_handle()
1005 pwrb_context->wrb_handles_available++; in beiscsi_put_wrb_handle()
1006 if (pwrb_context->free_index == (wrbs_per_cxn - 1)) in beiscsi_put_wrb_handle()
1007 pwrb_context->free_index = 0; in beiscsi_put_wrb_handle()
1009 pwrb_context->free_index++; in beiscsi_put_wrb_handle()
1011 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags); in beiscsi_put_wrb_handle()
1023 free_wrb_handle(struct beiscsi_hba *phba, struct hwi_wrb_context *pwrb_context, in free_wrb_handle() argument
1026 beiscsi_put_wrb_handle(pwrb_context, in free_wrb_handle()
1033 pwrb_handle, pwrb_context->free_index, in free_wrb_handle()
1034 pwrb_context->wrb_handles_available); in free_wrb_handle()
1217 struct hwi_wrb_context *pwrb_context; in hwi_complete_drvr_msgs() local
1238 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_drvr_msgs()
1239 pwrb_handle = pwrb_context->pwrb_handle_basestd[wrb_index]; in hwi_complete_drvr_msgs()
1328 struct hwi_wrb_context *pwrb_context; in hwi_complete_cmd() local
1341 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in hwi_complete_cmd()
1343 pwrb_handle = pwrb_context->pwrb_handle_basestd[ in hwi_complete_cmd()
2599 struct hwi_wrb_context *pwrb_context; in beiscsi_init_wrb_handle() local
2623 pwrb_context = &phwi_ctrlr->wrb_context[index]; in beiscsi_init_wrb_handle()
2624 pwrb_context->pwrb_handle_base = in beiscsi_init_wrb_handle()
2628 if (!pwrb_context->pwrb_handle_base) { in beiscsi_init_wrb_handle()
2633 pwrb_context->pwrb_handle_basestd = in beiscsi_init_wrb_handle()
2637 if (!pwrb_context->pwrb_handle_basestd) { in beiscsi_init_wrb_handle()
2650 pwrb_context->alloc_index = 0; in beiscsi_init_wrb_handle()
2651 pwrb_context->wrb_handles_available = 0; in beiscsi_init_wrb_handle()
2652 pwrb_context->free_index = 0; in beiscsi_init_wrb_handle()
2656 pwrb_context->pwrb_handle_base[j] = pwrb_handle; in beiscsi_init_wrb_handle()
2657 pwrb_context->pwrb_handle_basestd[j] = in beiscsi_init_wrb_handle()
2659 pwrb_context->wrb_handles_available++; in beiscsi_init_wrb_handle()
2665 spin_lock_init(&pwrb_context->wrb_lock); in beiscsi_init_wrb_handle()
2669 pwrb_context = &phwi_ctrlr->wrb_context[index]; in beiscsi_init_wrb_handle()
2680 pwrb_handle = pwrb_context->pwrb_handle_base[j]; in beiscsi_init_wrb_handle()
2690 pwrb_context = &phwi_ctrlr->wrb_context[j]; in beiscsi_init_wrb_handle()
2691 kfree(pwrb_context->pwrb_handle_base); in beiscsi_init_wrb_handle()
2692 kfree(pwrb_context->pwrb_handle_basestd); in beiscsi_init_wrb_handle()
3338 struct hwi_wrb_context *pwrb_context; in beiscsi_create_wrb_rings() local
3418 pwrb_context = &phwi_ctrlr->wrb_context[i]; in beiscsi_create_wrb_rings()
3419 BE_SET_CID_TO_CRI(i, pwrb_context->cid); in beiscsi_create_wrb_rings()
3429 struct hwi_wrb_context *pwrb_context; in free_wrb_handles() local
3433 pwrb_context = &phwi_ctrlr->wrb_context[index]; in free_wrb_handles()
3434 kfree(pwrb_context->pwrb_handle_base); in free_wrb_handles()
3435 kfree(pwrb_context->pwrb_handle_basestd); in free_wrb_handles()
4194 struct hwi_wrb_context *pwrb_context; in beiscsi_free_mgmt_task_handles() local
4200 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_free_mgmt_task_handles()
4205 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_free_mgmt_task_handles()
4235 struct hwi_wrb_context *pwrb_context; in beiscsi_cleanup_task() local
4241 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_cleanup_task()
4252 free_wrb_handle(phba, pwrb_context, in beiscsi_cleanup_task()
4278 struct hwi_wrb_context *pwrb_context = NULL; in beiscsi_offload_connection() local
4294 &pwrb_context); in beiscsi_offload_connection()
4300 pwrb_context); in beiscsi_offload_connection()
4303 pwrb_context); in beiscsi_offload_connection()
4321 beiscsi_put_wrb_handle(pwrb_context, pwrb_handle, in beiscsi_offload_connection()
4326 pwrb_handle, pwrb_context->free_index, in beiscsi_offload_connection()
4327 pwrb_context->wrb_handles_available); in beiscsi_offload_connection()
4354 struct hwi_wrb_context *pwrb_context; in beiscsi_alloc_pdu() local
4386 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4418 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4451 &io_task->pwrb_context); in beiscsi_alloc_pdu()
4481 pwrb_context = &phwi_ctrlr->wrb_context[cri_index]; in beiscsi_alloc_pdu()
4483 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle); in beiscsi_alloc_pdu()
4533 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask_v2()
4535 io_task->pwrb_context->plast_wrb, in beiscsi_iotask_v2()
4537 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask_v2()
4594 if (io_task->pwrb_context->plast_wrb) in beiscsi_iotask()
4596 io_task->pwrb_context->plast_wrb, in beiscsi_iotask()
4598 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_iotask()
4638 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4640 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4642 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()
4656 if (io_task->pwrb_context->plast_wrb) in beiscsi_mtask()
4658 io_task->pwrb_context->plast_wrb, in beiscsi_mtask()
4660 io_task->pwrb_context->plast_wrb = pwrb; in beiscsi_mtask()