All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roderick Colenbrander <roderick@gaikai.com>
To: linux-input@vger.kernel.org
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>,
	Simon Wood <simon@mungewell.org>,
	Frank Praznik <frank.praznik@gmail.com>,
	Tim Bird <tim.bird@am.sony.com>,
	Roderick Colenbrander <roderick.colenbrander@sony.com>
Subject: [PATCH 1/6] HID: sony: Use DS3 MAC address as unique identifier on USB
Date: Fri, 24 Mar 2017 15:17:45 -0700	[thread overview]
Message-ID: <20170324221750.19543-2-roderick@gaikai.com> (raw)
In-Reply-To: <20170324221750.19543-1-roderick@gaikai.com>

From: Roderick Colenbrander <roderick.colenbrander@sony.com>

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>
---
 drivers/hid/hid-sony.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index bb124e3..2e14788 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;
 	}
-- 
2.9.3


  reply	other threads:[~2017-03-24 22:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-24 22:17 [PATCH 0/6] HID: sony: Various minor 4.12 fixes and improvements Roderick Colenbrander
2017-03-24 22:17 ` Roderick Colenbrander [this message]
2017-03-24 22:17 ` [PATCH 2/6] HID: sony: Improve navigation controller axis/button mapping Roderick Colenbrander
2017-03-24 22:17 ` [PATCH 3/6] HID: sony: DS4 use brighter LED colors Roderick Colenbrander
2017-03-24 22:17 ` [PATCH 4/6] HID: sony: Set proper bit flags on DS4 output report Roderick Colenbrander
2017-03-24 22:17 ` [PATCH 5/6] HID: sony: Make DS4 bt poll interval adjustable Roderick Colenbrander
2017-03-24 22:17 ` [PATCH 6/6] HID: sony: Make sure to unregister sensors on failure Roderick Colenbrander
2017-04-06 18:34 ` [PATCH 0/6] HID: sony: Various minor 4.12 fixes and improvements Jiri Kosina

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=20170324221750.19543-2-roderick@gaikai.com \
    --to=roderick@gaikai.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=frank.praznik@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=roderick.colenbrander@sony.com \
    --cc=simon@mungewell.org \
    --cc=tim.bird@am.sony.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.