diff options
author | Roderick Colenbrander <roderick.colenbrander@sony.com> | 2017-03-24 15:17:45 -0700 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2017-04-06 14:41:16 +0200 |
commit | 5a144be39c3a32b3072529ccee79e4ec9eb9b275 (patch) | |
tree | ee60744d6586f4dfc7c31e456f799b5b1b82b844 | |
parent | df848bc05db1c49756a2befbe03ab03ce34a6bcc (diff) | |
download | op-kernel-dev-5a144be39c3a32b3072529ccee79e4ec9eb9b275.zip op-kernel-dev-5a144be39c3a32b3072529ccee79e4ec9eb9b275.tar.gz |
HID: sony: Use DS3 MAC address as unique identifier on USB
The DS3 MAC address is reported as a unique identified when
using Bluetooth. For USB there is no unique identifier reported
yet, so use the MAC address.
Signed-off-by: Roderick Colenbrander <roderick.colenbrander@sony.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/hid-sony.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 5eb5ac9..38674f5 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2400,6 +2400,12 @@ static int sony_check_add(struct sony_sc *sc) */ for (n = 0; n < 6; n++) sc->mac_address[5-n] = buf[4+n]; + + snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), + "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", + sc->mac_address[5], sc->mac_address[4], + sc->mac_address[3], sc->mac_address[2], + sc->mac_address[1], sc->mac_address[0]); } else { return 0; } |