From patchwork Fri Dec 9 03:09:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roderick Colenbrander X-Patchwork-Id: 9467473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4E25260231 for ; Fri, 9 Dec 2016 03:10:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4818928591 for ; Fri, 9 Dec 2016 03:10:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CF0C285F9; Fri, 9 Dec 2016 03:10:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAD6528591 for ; Fri, 9 Dec 2016 03:10:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932634AbcLIDKn (ORCPT ); Thu, 8 Dec 2016 22:10:43 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:35178 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932532AbcLIDKm (ORCPT ); Thu, 8 Dec 2016 22:10:42 -0500 Received: by mail-pf0-f180.google.com with SMTP id i88so1225674pfk.2 for ; Thu, 08 Dec 2016 19:10:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaikai-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/P8id39cT7UBUQfBkHUivlXPb6NVY3AHZVqhhm3IWD8=; b=WJJY7MLcDzjC8LknkLPi8sf+Wu2w410J1T3N2Qd0pdkT82Ey14lBTsUQvWyDoxvMCR rzmqNGlZpSZnYISq7+BzH4FsiHiZ8xr/HkIj0PIAOiUflIN2dNb4p9D3Yi1UI2nqiyDg rhqhq6UcK6Sn9OlycyaBDayTT2ZlXkLngYOdppkYptNK89EX+mj8axsRPC4ocRJdpXy4 uNAC2S4BQqVabZWEFg22cs+3xU6cehaNKaqJJAkzw/e4VAPDCFIT75DVWJR1QXI97LKc F199cG65EUCceZg833tZWFO1yT79B4kKUNoEYaZPTF96bCJ3Tsud5CYNcvK/BeCSWr7x pLuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/P8id39cT7UBUQfBkHUivlXPb6NVY3AHZVqhhm3IWD8=; b=Pm25DU5aqkO6ny2Xo1QCgZINWBew23x/imcTAUN84DL1NfuhoUnSBTJ99mN9KXBlO5 uIJpr4nVnVKq4wy4HiC3j+AFEVdv8fnxfpVjXnGLh0lK0acOavW9yPptZdtfMhUCm3R8 72PCH4bxoTTzqjFBdAkEs2PdrSdQ4bEEgdFrKGAPt5iJZ/2io7ojhhP3xijYnUWolGo7 tTxP1dXfhhyAhspf6a4jxj3VzMw3xLpYPkmm+wbeGd3w/NGm1Fmy2J74DKXMNQIoJgO9 QFT0yQItMVU71xFxkcklzXZttIBUGL+EgWBUK4Ke5Z0AWKbOTCFKOceSIHVpaRo2cs5V qceg== X-Gm-Message-State: AKaTC00vT1K4z5vEHkWcvGBS3pjimYQXQ4KgtlQV5C3YiA4I2hvPRtrThU/dGYXk7geMKWt9 X-Received: by 10.99.112.66 with SMTP id a2mr137483905pgn.43.1481253042065; Thu, 08 Dec 2016 19:10:42 -0800 (PST) Received: from konan1.dev.av1.ca.us.gaikai.int ([2607:fb90:4895:fcc2:b707:fa7d:679c:91b]) by smtp.gmail.com with ESMTPSA id q27sm53057416pfd.49.2016.12.08.19.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 19:10:41 -0800 (PST) From: Roderick Colenbrander To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Jiri Kosina , Benjamin Tissoires , Simon Wood , Frank Praznik , Tim Bird , Roderick Colenbrander Subject: [PATCH 2/7] HID: sony: Use DS4 MAC address as unique identifier on USB Date: Thu, 8 Dec 2016 19:09:51 -0800 Message-Id: <1481252996-25288-3-git-send-email-roderick@gaikai.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481252996-25288-1-git-send-email-roderick@gaikai.com> References: <1481252996-25288-1-git-send-email-roderick@gaikai.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roderick Colenbrander The DS4 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 --- 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 f68c921..c6982a2 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2390,6 +2390,12 @@ static int sony_check_add(struct sony_sc *sc) } memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); + + 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 if ((sc->quirks & SIXAXIS_CONTROLLER_USB) || (sc->quirks & NAVIGATION_CONTROLLER_USB)) { buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL);