Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1076182rwb; Thu, 6 Oct 2022 08:11:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7EWWxl5tiai86hZlxzNrTdfZGIRk/jx/lScH3ymw2AwpmQI/v/ltcN4ri4mz0hlZMsvu0z X-Received: by 2002:a50:ff09:0:b0:456:fd61:83b3 with SMTP id a9-20020a50ff09000000b00456fd6183b3mr246449edu.166.1665069067936; Thu, 06 Oct 2022 08:11:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665069067; cv=none; d=google.com; s=arc-20160816; b=zbviBaLGpB9uiQEG7IPJ7cPl8GtF/fNSBTRQkUSP7IfcdrD4qYaulWNYD51bXlbAHE r3UdG007i5vvxLQCKP5++6rP1wP1AVAIkMkWjfo3e9Giu6Km8WkaQMjtFJ7HrXjYzuB1 KU4TVfxGG6feOg0dfR0K/Upz0xSsND3ZoMBhJoCYZAN47n40K5Yh7zC46aZa+/PVoDar pIsnqowlCvy5WlU/I8GS7lCXdZ/gHDB55OjTy5hAOzWE3lbEWGDF1nNiGFF3O5ng3PxO ZTffvfc3sjPyPkRJyBrCeIoJlCVm2Bzk3wn1WDhvDEytZXDeKhu+/NJWj4hbazkQi8zF /8tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bceuVvUJb3hxQm+ePCYNozIRIQ4HIe1CkvXUOasxSc0=; b=KOkay6OXFLn7vdywlzK35Wx6jX77eo9sbWzGFeom/RWIopFMwlcjk329+E1dmIJfRW 1FXUDnU4vEhuALuA3qitLJVLPDFgLq7BYNwu2kdeerYVbF1PvDUsrfImLBWs11ta2Ud8 b6ANUx2m1bCjKcmniAHcQfio5+mqaEcAFr+VpJ2tAS7pjeP54asrF6Qk6DzdFpw9LJ6A WqsujJE5I0xu/IJGiB7Tg7vCr5DLEAXDqUBmDpUJm6/7D6OS+YH3zEz+uH+V8FTd/bEs FLL10w7r/9ZiKcrLKfMY+78G+k2949dU7V0y/Bla0wCM1e2pyCaQPFozzOgHRgHIXuNF KNdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ajytUqcn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr1-20020a1709073f8100b00782faf12c6esi15731973ejc.78.2022.10.06.08.10.33; Thu, 06 Oct 2022 08:11:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ajytUqcn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230202AbiJFOxo (ORCPT + 99 others); Thu, 6 Oct 2022 10:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbiJFOxb (ORCPT ); Thu, 6 Oct 2022 10:53:31 -0400 Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 192733AE7F; Thu, 6 Oct 2022 07:53:31 -0700 (PDT) Received: by mail-oi1-x22c.google.com with SMTP id q10so2293205oib.5; Thu, 06 Oct 2022 07:53:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bceuVvUJb3hxQm+ePCYNozIRIQ4HIe1CkvXUOasxSc0=; b=ajytUqcnVpUIiUJPqr1uzTxRaxwz5XNCnPPwoAaAnKc5WRxa0ddxKNLqEGX/xgqmxR CdtpHygUjmM3n+tI4HWfUMSy14R60990h3moPIHh16uI0GVMKIogpgbIwDmJpzhuQJfa oH+zMjwGk2q4yvBWg+Vw4xs2cNBjPULCgukKb4nUSgBGqQ3jnWvnH1pFTNQaCx43mxcd N2VIJbjoAqB7FGSVUkNv+qjRulpv3mcCl5xdHEfN2NMjd+TnpawsOrWEtlQjOlvQex81 VukXbhmiFb7ZqJ7XpFzrT98lJ9xzYpURfynwvKnSD5K0i8GKae9Oubt0GDaxVy6nKjNP HlxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bceuVvUJb3hxQm+ePCYNozIRIQ4HIe1CkvXUOasxSc0=; b=682bvo+ZFtBLdeO7bN9hRSiSrj+DffqC5Mg4eL+KCnx5u6Cgfvosb7lEpsrgcJp6t9 Z97bRsFNByh+yrYUq50Oar5YzwDK2QszEzZYidYZzpEuKQiruKwRx+Kf6UwRopYwJuRx KfkGYQQB7/7VxmE9mmwC8mQ2j/JkxlnonVVWnP04WFdh9uqbY74Lm8P2IXPXraNsfL1N l3Ae7KkwV7rWL0d5ilkpYt8egY8XlCBGRqrsaAaw0tDcKZyjn+3GxbxiEjehORn15x0g djGC4yimThxTg6DNh8UM2zdfRYi1NHK7EA0Cfl/F3QK5wbJq4R0rsxGlU6IgzgOnmiH0 6VcA== X-Gm-Message-State: ACrzQf3EqSw2Quh/RSXn/Z1WQi4sVlkcbM/YjnK1Y/dhZl6b1IkoZHAn ucIal38HKC1VqblP0AWX73o= X-Received: by 2002:a05:6808:2026:b0:34e:5c1c:77c5 with SMTP id q38-20020a056808202600b0034e5c1c77c5mr30175oiw.76.1665068010433; Thu, 06 Oct 2022 07:53:30 -0700 (PDT) Received: from localhost.localdomain ([177.222.37.214]) by smtp.googlemail.com with ESMTPSA id f18-20020a9d5f12000000b00659579f505fsm5618043oti.64.2022.10.06.07.53.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 07:53:30 -0700 (PDT) From: Henry Castro To: thunderbird2k@gmail.com Cc: Henry Castro , Jiri Kosina , Benjamin Tissoires , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] drivers: hid: warn feature report 0x81 Date: Thu, 6 Oct 2022 10:53:08 -0400 Message-Id: <20221006145308.4393-1-hcvcastro@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unfortunately, my PS DualShock 4, does not support the feature 0x81 to get the MAC address. Instead, use a unique hash to fake a MAC address, so I can use DS4 to play Retroarch :) Signed-off-by: Henry Castro --- > Just for reference if you want to try out if 0x12 works, you can try > this code. This is from the new driver (ps_get_report is from > hid-playstation, but you can just use one of the existing hid calls) > if you wanted to try. It works with my 2 DS4 =) if (sc->hdev->bus == BUS_USB) { buf = kzalloc(DS4_FEATURE_REPORT_PAIRING_INFO_SIZE, GFP_KERNEL); if (!buf) return -ENOMEM; ret = hid_hw_raw_request(sc->hdev, DS4_FEATURE_REPORT_PAIRING_INFO, buf, DS4_FEATURE_REPORT_PAIRING_INFO_SIZE, HID_FEATURE_REPORT, HID_REQ_GET_REPORT); if (ret != DS4_FEATURE_REPORT_PAIRING_INFO_SIZE) { hid_err(sc->hdev, "Failed to retrieve DualShock4 pairing info:%pe\n", ERR_PTR(ret)); goto out_free; } memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); drivers/hid/hid-sony.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c index 656caa07b25f..e3e9c58887cf 100644 --- a/drivers/hid/hid-sony.c +++ b/drivers/hid/hid-sony.c @@ -2641,13 +2641,14 @@ static int sony_check_add(struct sony_sc *sc) HID_REQ_GET_REPORT); if (ret != DS4_FEATURE_REPORT_0x81_SIZE) { - hid_err(sc->hdev, "failed to retrieve feature report 0x81 with the DualShock 4 MAC address\n"); - ret = ret < 0 ? ret : -EINVAL; - goto out_free; + uint32_t hash = full_name_hash(NULL, dev_name(&sc->hdev->dev), + strlen(dev_name(&sc->hdev->dev))); + hid_warn(sc->hdev, "failed to retrieve feature report 0x81 with the DualShock 4 MAC address\n"); + memcpy(sc->mac_address, &hash, sizeof(hash)); + } else { + memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); } - memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); - snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), "%pMR", sc->mac_address); } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) || -- 2.20.1