Lines Matching refs:cqp_request
350 struct i40iw_cqp_request *cqp_request = NULL; in i40iw_get_cqp_request() local
355 cqp_request = list_entry(cqp->cqp_avail_reqs.next, in i40iw_get_cqp_request()
357 list_del_init(&cqp_request->list); in i40iw_get_cqp_request()
360 if (!cqp_request) { in i40iw_get_cqp_request()
361 cqp_request = kzalloc(sizeof(*cqp_request), GFP_ATOMIC); in i40iw_get_cqp_request()
362 if (cqp_request) { in i40iw_get_cqp_request()
363 cqp_request->dynamic = true; in i40iw_get_cqp_request()
364 INIT_LIST_HEAD(&cqp_request->list); in i40iw_get_cqp_request()
365 init_waitqueue_head(&cqp_request->waitq); in i40iw_get_cqp_request()
368 if (!cqp_request) { in i40iw_get_cqp_request()
374 atomic_set(&cqp_request->refcount, 2); in i40iw_get_cqp_request()
375 cqp_request->waiting = true; in i40iw_get_cqp_request()
377 atomic_set(&cqp_request->refcount, 1); in i40iw_get_cqp_request()
379 return cqp_request; in i40iw_get_cqp_request()
387 void i40iw_free_cqp_request(struct i40iw_cqp *cqp, struct i40iw_cqp_request *cqp_request) in i40iw_free_cqp_request() argument
392 if (cqp_request->dynamic) { in i40iw_free_cqp_request()
393 kfree(cqp_request); in i40iw_free_cqp_request()
395 cqp_request->request_done = false; in i40iw_free_cqp_request()
396 cqp_request->callback_fcn = NULL; in i40iw_free_cqp_request()
397 cqp_request->waiting = false; in i40iw_free_cqp_request()
400 list_add_tail(&cqp_request->list, &cqp->cqp_avail_reqs); in i40iw_free_cqp_request()
412 struct i40iw_cqp_request *cqp_request) in i40iw_put_cqp_request() argument
414 if (atomic_dec_and_test(&cqp_request->refcount)) in i40iw_put_cqp_request()
415 i40iw_free_cqp_request(cqp, cqp_request); in i40iw_put_cqp_request()
424 struct i40iw_cqp_request *cqp_request) in i40iw_free_pending_cqp_request() argument
428 if (cqp_request->waiting) { in i40iw_free_pending_cqp_request()
429 cqp_request->compl_info.error = true; in i40iw_free_pending_cqp_request()
430 cqp_request->request_done = true; in i40iw_free_pending_cqp_request()
431 wake_up(&cqp_request->waitq); in i40iw_free_pending_cqp_request()
433 i40iw_put_cqp_request(cqp, cqp_request); in i40iw_free_pending_cqp_request()
435 !atomic_read(&cqp_request->refcount), in i40iw_free_pending_cqp_request()
447 struct i40iw_cqp_request *cqp_request = NULL; in i40iw_cleanup_pending_cqp_op() local
454 cqp_request = (struct i40iw_cqp_request *)(unsigned long)cqp->scratch_array[wqe_idx]; in i40iw_cleanup_pending_cqp_op()
455 if (cqp_request) in i40iw_cleanup_pending_cqp_op()
456 i40iw_free_pending_cqp_request(cqp, cqp_request); in i40iw_cleanup_pending_cqp_op()
462 cqp_request = container_of(pcmdinfo, struct i40iw_cqp_request, info); in i40iw_cleanup_pending_cqp_op()
463 if (cqp_request) in i40iw_cleanup_pending_cqp_op()
464 i40iw_free_pending_cqp_request(cqp, cqp_request); in i40iw_cleanup_pending_cqp_op()
473 static void i40iw_free_qp(struct i40iw_cqp_request *cqp_request, u32 num) in i40iw_free_qp() argument
475 struct i40iw_sc_qp *qp = (struct i40iw_sc_qp *)cqp_request->param; in i40iw_free_qp()
493 struct i40iw_cqp_request *cqp_request) in i40iw_wait_event() argument
495 struct cqp_commands_info *info = &cqp_request->info; in i40iw_wait_event()
503 if (wait_event_timeout(cqp_request->waitq, in i40iw_wait_event()
504 cqp_request->request_done, CQP_COMPL_WAIT_TIME)) in i40iw_wait_event()
520 cqp_error = cqp_request->compl_info.error; in i40iw_wait_event()
523 info->cqp_cmd, cqp_request->compl_info.maj_err_code, in i40iw_wait_event()
524 cqp_request->compl_info.min_err_code); in i40iw_wait_event()
529 i40iw_put_cqp_request(iwcqp, cqp_request); in i40iw_wait_event()
540 *cqp_request) in i40iw_handle_cqp_op()
544 struct cqp_commands_info *info = &cqp_request->info; in i40iw_handle_cqp_op()
548 i40iw_free_cqp_request(&iwdev->cqp, cqp_request); in i40iw_handle_cqp_op()
555 i40iw_free_cqp_request(&iwdev->cqp, cqp_request); in i40iw_handle_cqp_op()
558 if (cqp_request->waiting) in i40iw_handle_cqp_op()
559 err_code = i40iw_wait_event(iwdev, cqp_request); in i40iw_handle_cqp_op()
626 struct i40iw_cqp_request *cqp_request; in i40iw_rem_ref() local
643 cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false); in i40iw_rem_ref()
644 if (!cqp_request) in i40iw_rem_ref()
647 cqp_request->callback_fcn = i40iw_free_qp; in i40iw_rem_ref()
648 cqp_request->param = (void *)&iwqp->sc_qp; in i40iw_rem_ref()
649 cqp_info = &cqp_request->info; in i40iw_rem_ref()
653 cqp_info->in.u.qp_destroy.scratch = (uintptr_t)cqp_request; in i40iw_rem_ref()
655 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_rem_ref()
822 struct i40iw_cqp_request *cqp_request; in i40iw_cqp_sds_cmd() local
826 cqp_request = i40iw_get_cqp_request(&iwdev->cqp, true); in i40iw_cqp_sds_cmd()
827 if (!cqp_request) in i40iw_cqp_sds_cmd()
829 cqp_info = &cqp_request->info; in i40iw_cqp_sds_cmd()
835 cqp_info->in.u.update_pe_sds.scratch = (uintptr_t)cqp_request; in i40iw_cqp_sds_cmd()
836 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_cqp_sds_cmd()
851 struct i40iw_cqp_request *cqp_request; in i40iw_qp_suspend_resume() local
856 cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false); in i40iw_qp_suspend_resume()
857 if (!cqp_request) in i40iw_qp_suspend_resume()
860 cqp_info = &cqp_request->info; in i40iw_qp_suspend_resume()
864 cqp_info->in.u.suspend_resume.scratch = (uintptr_t)cqp_request; in i40iw_qp_suspend_resume()
865 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_qp_suspend_resume()
997 struct i40iw_cqp_request *cqp_request = in i40iw_cqp_manage_hmc_fcn_worker() local
998 ((struct virtchnl_work *)work)->cqp_request; in i40iw_cqp_manage_hmc_fcn_worker()
1001 &cqp_request->info.in.u.manage_hmc_pm.info; in i40iw_cqp_manage_hmc_fcn_worker()
1003 (struct i40iw_device *)cqp_request->info.in.u.manage_hmc_pm.dev->back_dev; in i40iw_cqp_manage_hmc_fcn_worker()
1006 ccq_cqe_info.maj_err_code = cqp_request->compl_info.maj_err_code; in i40iw_cqp_manage_hmc_fcn_worker()
1007 ccq_cqe_info.min_err_code = cqp_request->compl_info.min_err_code; in i40iw_cqp_manage_hmc_fcn_worker()
1008 ccq_cqe_info.op_code = cqp_request->compl_info.op_code; in i40iw_cqp_manage_hmc_fcn_worker()
1009 ccq_cqe_info.op_ret_val = cqp_request->compl_info.op_ret_val; in i40iw_cqp_manage_hmc_fcn_worker()
1011 ccq_cqe_info.error = cqp_request->compl_info.error; in i40iw_cqp_manage_hmc_fcn_worker()
1012 hmcfcninfo->callback_fcn(cqp_request->info.in.u.manage_hmc_pm.dev, in i40iw_cqp_manage_hmc_fcn_worker()
1014 i40iw_put_cqp_request(&iwdev->cqp, cqp_request); in i40iw_cqp_manage_hmc_fcn_worker()
1022 static void i40iw_cqp_manage_hmc_fcn_callback(struct i40iw_cqp_request *cqp_request, in i40iw_cqp_manage_hmc_fcn_callback() argument
1027 &cqp_request->info.in.u.manage_hmc_pm.info; in i40iw_cqp_manage_hmc_fcn_callback()
1029 (struct i40iw_device *)cqp_request->info.in.u.manage_hmc_pm.dev-> in i40iw_cqp_manage_hmc_fcn_callback()
1034 atomic_inc(&cqp_request->refcount); in i40iw_cqp_manage_hmc_fcn_callback()
1036 work->cqp_request = cqp_request; in i40iw_cqp_manage_hmc_fcn_callback()
1054 struct i40iw_cqp_request *cqp_request; in i40iw_cqp_manage_hmc_fcn_cmd() local
1059 cqp_request = i40iw_get_cqp_request(&iwdev->cqp, false); in i40iw_cqp_manage_hmc_fcn_cmd()
1060 if (!cqp_request) in i40iw_cqp_manage_hmc_fcn_cmd()
1062 cqp_info = &cqp_request->info; in i40iw_cqp_manage_hmc_fcn_cmd()
1063 cqp_request->callback_fcn = i40iw_cqp_manage_hmc_fcn_callback; in i40iw_cqp_manage_hmc_fcn_cmd()
1064 cqp_request->param = hmcfcninfo; in i40iw_cqp_manage_hmc_fcn_cmd()
1070 cqp_info->in.u.manage_hmc_pm.scratch = (uintptr_t)cqp_request; in i40iw_cqp_manage_hmc_fcn_cmd()
1071 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_cqp_manage_hmc_fcn_cmd()
1088 struct i40iw_cqp_request *cqp_request; in i40iw_cqp_query_fpm_values_cmd() local
1092 cqp_request = i40iw_get_cqp_request(&iwdev->cqp, true); in i40iw_cqp_query_fpm_values_cmd()
1093 if (!cqp_request) in i40iw_cqp_query_fpm_values_cmd()
1095 cqp_info = &cqp_request->info; in i40iw_cqp_query_fpm_values_cmd()
1096 cqp_request->param = NULL; in i40iw_cqp_query_fpm_values_cmd()
1103 cqp_info->in.u.query_fpm_values.scratch = (uintptr_t)cqp_request; in i40iw_cqp_query_fpm_values_cmd()
1104 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_cqp_query_fpm_values_cmd()
1121 struct i40iw_cqp_request *cqp_request; in i40iw_cqp_commit_fpm_values_cmd() local
1125 cqp_request = i40iw_get_cqp_request(&iwdev->cqp, true); in i40iw_cqp_commit_fpm_values_cmd()
1126 if (!cqp_request) in i40iw_cqp_commit_fpm_values_cmd()
1128 cqp_info = &cqp_request->info; in i40iw_cqp_commit_fpm_values_cmd()
1129 cqp_request->param = NULL; in i40iw_cqp_commit_fpm_values_cmd()
1136 cqp_info->in.u.commit_fpm_values.scratch = (uintptr_t)cqp_request; in i40iw_cqp_commit_fpm_values_cmd()
1137 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_cqp_commit_fpm_values_cmd()
1180 struct i40iw_cqp_request *cqp_request; in i40iw_cqp_cq_create_cmd() local
1184 cqp_request = i40iw_get_cqp_request(iwcqp, true); in i40iw_cqp_cq_create_cmd()
1185 if (!cqp_request) in i40iw_cqp_cq_create_cmd()
1188 cqp_info = &cqp_request->info; in i40iw_cqp_cq_create_cmd()
1192 cqp_info->in.u.cq_create.scratch = (uintptr_t)cqp_request; in i40iw_cqp_cq_create_cmd()
1193 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_cqp_cq_create_cmd()
1210 struct i40iw_cqp_request *cqp_request; in i40iw_cqp_qp_create_cmd() local
1215 cqp_request = i40iw_get_cqp_request(iwcqp, true); in i40iw_cqp_qp_create_cmd()
1216 if (!cqp_request) in i40iw_cqp_qp_create_cmd()
1219 cqp_info = &cqp_request->info; in i40iw_cqp_qp_create_cmd()
1220 qp_info = &cqp_request->info.in.u.qp_create.info; in i40iw_cqp_qp_create_cmd()
1230 cqp_info->in.u.qp_create.scratch = (uintptr_t)cqp_request; in i40iw_cqp_qp_create_cmd()
1231 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_cqp_qp_create_cmd()
1258 struct i40iw_cqp_request *cqp_request; in i40iw_cqp_qp_destroy_cmd() local
1262 cqp_request = i40iw_get_cqp_request(iwcqp, true); in i40iw_cqp_qp_destroy_cmd()
1263 if (!cqp_request) in i40iw_cqp_qp_destroy_cmd()
1266 cqp_info = &cqp_request->info; in i40iw_cqp_qp_destroy_cmd()
1272 cqp_info->in.u.qp_destroy.scratch = (uintptr_t)cqp_request; in i40iw_cqp_qp_destroy_cmd()
1274 status = i40iw_handle_cqp_op(iwdev, cqp_request); in i40iw_cqp_qp_destroy_cmd()