Subject: Re: [PATCH v4 03/10] fwctl: FWCTL_INFO to return basic information about the device

From: Jonathan Cameron <[email-masked]>
Date: Fri, 7 Feb 2025 13:06:41 +0000

On Thu,  6 Feb 2025 20:13:25 -0400
Jason Gunthorpe <[email-masked]> wrote:

> Userspace will need to know some details about the fwctl interface being
> used to locate the correct userspace code to communicate with the
> kernel. Provide a simple device_type enum indicating what the kernel
> driver is.
> 
> Allow the device to provide a device specific info struct that contains
> any additional information that the driver may need to provide to
> userspace.
> 
> Reviewed-by: Jonathan Cameron <[email-masked]>
> Signed-off-by: Jason Gunthorpe <[email-masked]>
Trivial comment inline.

> ---
>  drivers/fwctl/main.c       | 51 ++++++++++++++++++++++++++++++++++++++
>  include/linux/fwctl.h      | 12 +++++++++
>  include/uapi/fwctl/fwctl.h | 32 ++++++++++++++++++++++++
>  3 files changed, 95 insertions(+)
> 
> diff --git a/drivers/fwctl/main.c b/drivers/fwctl/main.c
> index d561deaf2b86d8..4b6792f2031e86 100644
> --- a/drivers/fwctl/main.c
> +++ b/drivers/fwctl/main.c
> @@ -27,8 +27,58 @@ struct fwctl_ucmd {

> diff --git a/include/uapi/fwctl/fwctl.h b/include/uapi/fwctl/fwctl.h
> index f4718a6240f281..ac66853200a5a8 100644
> --- a/include/uapi/fwctl/fwctl.h
> +++ b/include/uapi/fwctl/fwctl.h
> @@ -4,6 +4,9 @@
>  #ifndef _UAPI_FWCTL_H
>  #define _UAPI_FWCTL_H
>  
> +#include <linux/types.h>
> +#include <linux/ioctl.h>
> +
>  #define FWCTL_TYPE 0x9A
>  
>  /**
> @@ -33,6 +36,35 @@
>   */
>  enum {
>  	FWCTL_CMD_BASE = 0,
> +	FWCTL_CMD_INFO = 0,
> +	FWCTL_CMD_RPC = 1,

Trivial but in theory should perhaps leave RPC for patch 5?

>  };