From: Frank Praznik <frank.praznik@oh.rr.com>
To: linux-input@vger.kernel.org
Cc: jkosina@suse.cz, dh.herrmann@gmail.com,
Frank Praznik <frank.praznik@oh.rr.com>
Subject: [PATCH 3/6] HID: Add support for setting client_addr in uhid.
Date: Fri, 31 Jan 2014 12:32:50 -0500 [thread overview]
Message-ID: <1391189573-2591-4-git-send-email-frank.praznik@oh.rr.com> (raw)
In-Reply-To: <1391189573-2591-1-git-send-email-frank.praznik@oh.rr.com>
Add support for setting the client address of a device in uhid.
Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
---
drivers/hid/uhid.c | 5 +++++
include/uapi/linux/uhid.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/drivers/hid/uhid.c b/drivers/hid/uhid.c
index cedc6da..cfd2b93 100644
--- a/drivers/hid/uhid.c
+++ b/drivers/hid/uhid.c
@@ -259,6 +259,7 @@ struct uhid_create_req_compat {
__u8 name[128];
__u8 phys[64];
__u8 uniq[64];
+ __u8 client_addr[6];
compat_uptr_t rd_data;
__u16 rd_size;
@@ -308,6 +309,8 @@ static int uhid_event_from_user(const char __user *buffer, size_t len,
sizeof(compat->phys));
memcpy(event->u.create.uniq, compat->uniq,
sizeof(compat->uniq));
+ memcpy(event->u.create.client_addr, compat->client_addr,
+ sizeof(compat->client_addr));
event->u.create.rd_data = compat_ptr(compat->rd_data);
event->u.create.rd_size = compat->rd_size;
@@ -375,6 +378,8 @@ static int uhid_dev_create(struct uhid_device *uhid,
hid->phys[63] = 0;
strncpy(hid->uniq, ev->u.create.uniq, 63);
hid->uniq[63] = 0;
+ memcpy(hid->client_addr, ev->u.create.client_addr,
+ sizeof(hid->client_addr));
hid->ll_driver = &uhid_hid_driver;
hid->hid_get_raw_report = uhid_hid_get_raw;
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
index 414b74b..5e48acc 100644
--- a/include/uapi/linux/uhid.h
+++ b/include/uapi/linux/uhid.h
@@ -40,6 +40,7 @@ struct uhid_create_req {
__u8 name[128];
__u8 phys[64];
__u8 uniq[64];
+ __u8 client_addr[6];
__u8 __user *rd_data;
__u16 rd_size;
--
1.8.5.3
next prev parent reply other threads:[~2014-01-31 17:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-31 17:32 [PATCH 0/6] HID: Add a stable method for retrieving the client MAC address of a HID device Frank Praznik
2014-01-31 17:32 ` [PATCH 1/6] HID: Add the client_addr member to the hid_device struct Frank Praznik
2014-01-31 19:12 ` Benjamin Tissoires
2014-01-31 17:32 ` [PATCH 2/6] HID: hidp: Store the device MAC in client_addr Frank Praznik
2014-01-31 17:32 ` Frank Praznik [this message]
2014-01-31 19:16 ` [PATCH 3/6] HID: Add support for setting client_addr in uhid Benjamin Tissoires
2014-01-31 17:32 ` [PATCH 4/6] HID: Add the HIDIOCGRAWCLIENTADDR ioctl to hidraw Frank Praznik
2014-01-31 19:19 ` Benjamin Tissoires
2014-01-31 17:32 ` [PATCH 5/6] HID: Add the HIDIOCGRAWCLIENTADDR ioctl to the hidraw documentation Frank Praznik
2014-01-31 19:17 ` Benjamin Tissoires
2014-01-31 17:32 ` [PATCH 6/6] HID: Update the hidraw sample with the usage of HIDIOCGRAWCLIENTADDR Frank Praznik
2014-01-31 19:18 ` Benjamin Tissoires
2014-01-31 19:10 ` [PATCH 0/6] HID: Add a stable method for retrieving the client MAC address of a HID device Benjamin Tissoires
2014-01-31 20:04 ` Frank Praznik
2014-01-31 20:45 ` Benjamin Tissoires
2014-02-01 16:06 ` Frank Praznik
2014-02-01 16:28 ` Benjamin Tissoires
2014-02-03 16:24 ` David Herrmann
2014-02-03 17:31 ` Frank Praznik
2014-02-03 17:45 ` David Herrmann
2014-02-03 17:57 ` Dmitry Torokhov
2014-02-03 18:06 ` David Herrmann
2014-02-03 18:33 ` Frank Praznik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1391189573-2591-4-git-send-email-frank.praznik@oh.rr.com \
--to=frank.praznik@oh.rr.com \
--cc=dh.herrmann@gmail.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).