From patchwork Fri Mar 24 22:17:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roderick Colenbrander X-Patchwork-Id: 9644099 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 C1843602C9 for ; Fri, 24 Mar 2017 22:17:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B35B823E64 for ; Fri, 24 Mar 2017 22:17:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7CF225D99; Fri, 24 Mar 2017 22:17:58 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 41B1B23E64 for ; Fri, 24 Mar 2017 22:17:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754965AbdCXWR5 (ORCPT ); Fri, 24 Mar 2017 18:17:57 -0400 Received: from mail-it0-f47.google.com ([209.85.214.47]:38768 "EHLO mail-it0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754916AbdCXWR5 (ORCPT ); Fri, 24 Mar 2017 18:17:57 -0400 Received: by mail-it0-f47.google.com with SMTP id y18so3847442itc.1 for ; Fri, 24 Mar 2017 15:17:56 -0700 (PDT) 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=AN4WmE79N3PGojjAMMe3h8TMPWdSkk8UacNKFWYkzH4=; b=JlPMVMkOK1kt7BKym5c/W1Ob50bxbVV/6EDjk43iu+aQ3baWWNm11isADD8r/VXoJX OcrDSLKAE0e1vTQbqRyShXz31XxxKoxFPJ9kX95Y7ENIr/g/eVeu8Dq1ko/aRf+V1xHE xt7lh0FwPKzlWq3Y3qSR7FZADQ+WQqtEI4uu61zOHWo7RrI5rlrejQ+c/eZpOIYP7c6U mU9zYc3j8K/EVwP1979zmILiMbfsVxzInAEMAo4DJi7C8nJFjXUUNNmUX2X5cf089n2k sfLXY27ClU85W6OBswbcRI3dFis/OCljs5ca7ijgvp8ZAFTOzHCuvvdiJNdb+++tdTUv /Wzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AN4WmE79N3PGojjAMMe3h8TMPWdSkk8UacNKFWYkzH4=; b=IjpYGXr1sIJJGUM8asbDOgunPT8PCPU8K/7pwbC5LebSRARwn3SAhyw0aID0DTbwOD IPGdzyX3VRxl/e1EbBNL+csTqrfyqDTfXLDiuxSUYRsavAncAInvLShUfC3um0/a7j2q Uvdb2AtEG7vebT0DPswaaKkQU5DcxklVt42hDWnTlMOC5FDYnWNj6w2eR+VP6wajps1w EbvgsZeMGXhMn7iOUrJoEaBR690MwnaJvpr+6vgWygDsS/Sc+8v14kVtlXaV5DRQA1mJ rz5UUJdLJkgS62zIqLL5yU9mTuOXP8sERDX3brC5vXmx+OQ/2b78xX3XNC5e8YaGB1QD J2Lg== X-Gm-Message-State: AFeK/H1+3wee7EfAiXl8CUbrCr4dau1IaGZiFa0D/V1HdMLnR6JkhU4ufI9fwWZ9M7jKjPar X-Received: by 10.36.33.73 with SMTP id e70mr5210978ita.9.1490393875805; Fri, 24 Mar 2017 15:17:55 -0700 (PDT) Received: from roderick.ad.gaikai.biz ([100.42.98.197]) by smtp.gmail.com with ESMTPSA id m100sm1842120iod.14.2017.03.24.15.17.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 15:17:55 -0700 (PDT) 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 1/6] HID: sony: Use DS3 MAC address as unique identifier on USB Date: Fri, 24 Mar 2017 15:17:45 -0700 Message-Id: <20170324221750.19543-2-roderick@gaikai.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170324221750.19543-1-roderick@gaikai.com> References: <20170324221750.19543-1-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 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 --- 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; }