Lines Matching defs:pwrb_context

951 beiscsi_get_wrb_handle(struct hwi_wrb_context *pwrb_context,
957 spin_lock_irqsave(&pwrb_context->wrb_lock, flags);
958 if (!pwrb_context->wrb_handles_available) {
959 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags);
962 pwrb_handle = pwrb_context->pwrb_handle_base[pwrb_context->alloc_index];
963 pwrb_context->wrb_handles_available--;
964 if (pwrb_context->alloc_index == (wrbs_per_cxn - 1))
965 pwrb_context->alloc_index = 0;
967 pwrb_context->alloc_index++;
968 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags);
987 struct hwi_wrb_context *pwrb_context;
992 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
994 *pcontext = pwrb_context;
995 return beiscsi_get_wrb_handle(pwrb_context, phba->params.wrbs_per_cxn);
999 beiscsi_put_wrb_handle(struct hwi_wrb_context *pwrb_context,
1005 spin_lock_irqsave(&pwrb_context->wrb_lock, flags);
1006 pwrb_context->pwrb_handle_base[pwrb_context->free_index] = pwrb_handle;
1007 pwrb_context->wrb_handles_available++;
1008 if (pwrb_context->free_index == (wrbs_per_cxn - 1))
1009 pwrb_context->free_index = 0;
1011 pwrb_context->free_index++;
1013 spin_unlock_irqrestore(&pwrb_context->wrb_lock, flags);
1019 * @pwrb_context: The context to free from
1025 free_wrb_handle(struct beiscsi_hba *phba, struct hwi_wrb_context *pwrb_context,
1028 beiscsi_put_wrb_handle(pwrb_context,
1035 pwrb_handle, pwrb_context->free_index,
1036 pwrb_context->wrb_handles_available);
1219 struct hwi_wrb_context *pwrb_context;
1240 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
1241 pwrb_handle = pwrb_context->pwrb_handle_basestd[wrb_index];
1330 struct hwi_wrb_context *pwrb_context;
1343 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
1345 pwrb_handle = pwrb_context->pwrb_handle_basestd[
2602 struct hwi_wrb_context *pwrb_context;
2626 pwrb_context = &phwi_ctrlr->wrb_context[index];
2627 pwrb_context->pwrb_handle_base =
2631 if (!pwrb_context->pwrb_handle_base) {
2636 pwrb_context->pwrb_handle_basestd =
2640 if (!pwrb_context->pwrb_handle_basestd) {
2653 pwrb_context->alloc_index = 0;
2654 pwrb_context->wrb_handles_available = 0;
2655 pwrb_context->free_index = 0;
2659 pwrb_context->pwrb_handle_base[j] = pwrb_handle;
2660 pwrb_context->pwrb_handle_basestd[j] =
2662 pwrb_context->wrb_handles_available++;
2668 spin_lock_init(&pwrb_context->wrb_lock);
2672 pwrb_context = &phwi_ctrlr->wrb_context[index];
2683 pwrb_handle = pwrb_context->pwrb_handle_base[j];
2693 pwrb_context = &phwi_ctrlr->wrb_context[j];
2694 kfree(pwrb_context->pwrb_handle_base);
2695 kfree(pwrb_context->pwrb_handle_basestd);
3345 struct hwi_wrb_context *pwrb_context;
3426 pwrb_context = &phwi_ctrlr->wrb_context[i];
3427 BE_SET_CID_TO_CRI(i, pwrb_context->cid);
3437 struct hwi_wrb_context *pwrb_context;
3441 pwrb_context = &phwi_ctrlr->wrb_context[index];
3442 kfree(pwrb_context->pwrb_handle_base);
3443 kfree(pwrb_context->pwrb_handle_basestd);
4220 struct hwi_wrb_context *pwrb_context;
4226 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
4231 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle);
4261 struct hwi_wrb_context *pwrb_context;
4267 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
4278 free_wrb_handle(phba, pwrb_context,
4304 struct hwi_wrb_context *pwrb_context = NULL;
4320 &pwrb_context);
4326 pwrb_context);
4329 pwrb_context);
4347 beiscsi_put_wrb_handle(pwrb_context, pwrb_handle,
4352 pwrb_handle, pwrb_context->free_index,
4353 pwrb_context->wrb_handles_available);
4380 struct hwi_wrb_context *pwrb_context;
4412 &io_task->pwrb_context);
4445 &io_task->pwrb_context);
4480 &io_task->pwrb_context);
4510 pwrb_context = &phwi_ctrlr->wrb_context[cri_index];
4512 free_wrb_handle(phba, pwrb_context, io_task->pwrb_handle);
4562 if (io_task->pwrb_context->plast_wrb)
4564 io_task->pwrb_context->plast_wrb,
4566 io_task->pwrb_context->plast_wrb = pwrb;
4623 if (io_task->pwrb_context->plast_wrb)
4625 io_task->pwrb_context->plast_wrb,
4627 io_task->pwrb_context->plast_wrb = pwrb;
4667 if (io_task->pwrb_context->plast_wrb)
4669 io_task->pwrb_context->plast_wrb,
4671 io_task->pwrb_context->plast_wrb = pwrb;
4685 if (io_task->pwrb_context->plast_wrb)
4687 io_task->pwrb_context->plast_wrb,
4689 io_task->pwrb_context->plast_wrb = pwrb;