lkml.org 
[lkml]   [2024]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 2/5] vduse: Add new ioctl VDUSE_DEV_GET_STATUS
    Date
    The ioctl VDUSE_DEV_GET_STATUS is used by the Userspace App
    to get the device status

    Signed-off-by: Cindy Lu <lulu@redhat.com>
    ---
    drivers/vdpa/vdpa_user/vduse_dev.c | 7 +++++++
    include/uapi/linux/vduse.h | 2 ++
    2 files changed, 9 insertions(+)

    diff --git a/drivers/vdpa/vdpa_user/vduse_dev.c b/drivers/vdpa/vdpa_user/vduse_dev.c
    index ab246da27616..ef3c9681941e 100644
    --- a/drivers/vdpa/vdpa_user/vduse_dev.c
    +++ b/drivers/vdpa/vdpa_user/vduse_dev.c
    @@ -1389,6 +1389,13 @@ static long vduse_dev_ioctl(struct file *file, unsigned int cmd,
    ret = 0;
    break;
    }
    +
    + case VDUSE_DEV_GET_STATUS:
    + /*
    + * Returns the status read from device
    + */
    + ret = put_user(dev->status, (u8 __user *)argp);
    + break;
    default:
    ret = -ENOIOCTLCMD;
    break;
    diff --git a/include/uapi/linux/vduse.h b/include/uapi/linux/vduse.h
    index 125d7529d91b..f501173a9d69 100644
    --- a/include/uapi/linux/vduse.h
    +++ b/include/uapi/linux/vduse.h
    @@ -353,4 +353,6 @@ struct vduse_dev_response {
    /* get device configuration space */
    #define VDUSE_DEV_GET_CONFIG _IOR(VDUSE_BASE, 0x1b, struct vduse_config_data)

    +#define VDUSE_DEV_GET_STATUS _IOR(VDUSE_BASE, 0x1c, __u8)
    +
    #endif /* _UAPI_VDUSE_H_ */
    --
    2.43.0

    \
     
     \ /
      Last update: 2024-05-27 14:51    [W:4.858 / U:1.332 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site