[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <nycvar.YFH.7.76.1912111532550.4603@cbobk.fhfr.pm>
Date: Wed, 11 Dec 2019 15:33:05 +0100 (CET)
From: Jiri Kosina <jikos@...nel.org>
To: Marcel Holtmann <marcel@...tmann.org>
cc: Benjamin Tissoires <benjamin.tissoires@...hat.com>,
abhishekpandit@...omium.org, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: hidraw: add support uniq ioctl
On Wed, 4 Dec 2019, Marcel Holtmann wrote:
> Add support for reading out the uniq information from the underlying HID
> device. This might be the iSerialNumber in case of USB or the BD_ADDR in
> case of Bluetooth.
>
> Signed-off-by: Marcel Holtmann <marcel@...tmann.org>
> ---
> drivers/hid/hidraw.c | 9 +++++++++
> include/uapi/linux/hidraw.h | 1 +
> 2 files changed, 10 insertions(+)
>
> diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c
> index bbc6ec1aa5cb..039304069fd0 100644
> --- a/drivers/hid/hidraw.c
> +++ b/drivers/hid/hidraw.c
> @@ -450,6 +450,15 @@ static long hidraw_ioctl(struct file *file, unsigned int cmd,
> -EFAULT : len;
> break;
> }
> +
> + if (_IOC_NR(cmd) == _IOC_NR(HIDIOCGRAWUNIQ(0))) {
> + int len = strlen(hid->uniq) + 1;
> + if (len > _IOC_SIZE(cmd))
> + len = _IOC_SIZE(cmd);
> + ret = copy_to_user(user_arg, hid->uniq, len) ?
> + -EFAULT : len;
> + break;
> + }
Queued for 5.6. Thanks,
--
Jiri Kosina
SUSE Labs
Powered by blists - more mailing lists