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