Lines Matching refs:rpc
282 struct fwctl_rpc_pds *rpc, in pdsfc_validate_rpc() argument
294 if (rpc->in.len > le32_to_cpu(pdsfc->ident.max_req_sz)) { in pdsfc_validate_rpc()
296 rpc->in.len, le32_to_cpu(pdsfc->ident.max_req_sz)); in pdsfc_validate_rpc()
300 if (rpc->out.len > le32_to_cpu(pdsfc->ident.max_resp_sz)) { in pdsfc_validate_rpc()
302 rpc->out.len, le32_to_cpu(pdsfc->ident.max_resp_sz)); in pdsfc_validate_rpc()
308 if (pdsfc->endpoint_info[i].endpoint == rpc->in.ep) { in pdsfc_validate_rpc()
314 dev_dbg(dev, "Invalid endpoint %d\n", rpc->in.ep); in pdsfc_validate_rpc()
325 rpc->in.ep); in pdsfc_validate_rpc()
338 if (PDS_FWCTL_RPC_OPCODE_CMP(rpc->in.op, le32_to_cpu(op_entry[i].id))) { in pdsfc_validate_rpc()
345 dev_dbg(dev, "Invalid operation %d for endpoint %d\n", rpc->in.op, rpc->in.ep); in pdsfc_validate_rpc()
358 struct fwctl_rpc_pds *rpc = in; in pdsfc_fw_rpc() local
365 err = pdsfc_validate_rpc(pdsfc, rpc, scope); in pdsfc_fw_rpc()
369 if (rpc->in.len > 0) { in pdsfc_fw_rpc()
370 in_payload = memdup_user(u64_to_user_ptr(rpc->in.payload), rpc->in.len); in pdsfc_fw_rpc()
377 rpc->in.len, DMA_TO_DEVICE); in pdsfc_fw_rpc()
385 if (rpc->out.len > 0) { in pdsfc_fw_rpc()
386 out_payload = kzalloc(rpc->out.len, GFP_KERNEL); in pdsfc_fw_rpc()
394 rpc->out.len, DMA_FROM_DEVICE); in pdsfc_fw_rpc()
406 .ep = cpu_to_le32(rpc->in.ep), in pdsfc_fw_rpc()
407 .op = cpu_to_le32(rpc->in.op), in pdsfc_fw_rpc()
409 .req_sz = cpu_to_le32(rpc->in.len), in pdsfc_fw_rpc()
411 .resp_sz = cpu_to_le32(rpc->out.len), in pdsfc_fw_rpc()
418 __func__, rpc->in.ep, rpc->in.op, in pdsfc_fw_rpc()
425 dynamic_hex_dump("out ", DUMP_PREFIX_OFFSET, 16, 1, out_payload, rpc->out.len, true); in pdsfc_fw_rpc()
427 if (copy_to_user(u64_to_user_ptr(rpc->out.payload), out_payload, rpc->out.len)) { in pdsfc_fw_rpc()
433 rpc->out.retval = le32_to_cpu(comp.fwctl_rpc.err); in pdsfc_fw_rpc()
440 rpc->out.len, DMA_FROM_DEVICE); in pdsfc_fw_rpc()
446 rpc->in.len, DMA_TO_DEVICE); in pdsfc_fw_rpc()