summaryrefslogtreecommitdiff
path: root/include/linux/fwctl.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2025-02-27 20:26:33 -0400
committerJason Gunthorpe <jgg@nvidia.com>2025-03-06 15:13:13 -0400
commit840cfb7cf570b681f5d20e19f7c2675a9d991732 (patch)
tree1191ab6cccfb508e37c618ae759257a47ea22008 /include/linux/fwctl.h
parent8eea4e74475804285507c077bec87d40be87ff06 (diff)
fwctl: FWCTL_RPC to execute a Remote Procedure Call to device firmware
Add the FWCTL_RPC ioctl which allows a request/response RPC call to device firmware. Drivers implementing this call must follow the security guidelines under Documentation/userspace-api/fwctl.rst The core code provides some memory management helpers to get the messages copied from and back to userspace. The driver is responsible for allocating the output message memory and delivering the message to the device. Link: https://patch.msgid.link/r/5-v5-642aa0c94070+4447f-fwctl_jgg@nvidia.com Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Tested-by: Dave Jiang <dave.jiang@intel.com> Tested-by: Shannon Nelson <shannon.nelson@amd.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'include/linux/fwctl.h')
-rw-r--r--include/linux/fwctl.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/fwctl.h b/include/linux/fwctl.h
index 700a5be940e3..5d61fc8a6871 100644
--- a/include/linux/fwctl.h
+++ b/include/linux/fwctl.h
@@ -47,6 +47,14 @@ struct fwctl_ops {
* ignore length on input, the core code will handle everything.
*/
void *(*info)(struct fwctl_uctx *uctx, size_t *length);
+ /**
+ * @fw_rpc: Implement FWCTL_RPC. Deliver rpc_in/in_len to the FW and
+ * return the response and set out_len. rpc_in can be returned as the
+ * response pointer. Otherwise the returned pointer is freed with
+ * kvfree().
+ */
+ void *(*fw_rpc)(struct fwctl_uctx *uctx, enum fwctl_rpc_scope scope,
+ void *rpc_in, size_t in_len, size_t *out_len);
};
/**