Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2527819pxy; Tue, 3 Aug 2021 08:29:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtvEZd9+v4W8R9BuDjH29kud6W8qth2T33qSGHUtvq3XTzo2Vn/yhGLOJnD7NlvBZPWXIn X-Received: by 2002:a17:906:c252:: with SMTP id bl18mr21276300ejb.519.1628004584460; Tue, 03 Aug 2021 08:29:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628004584; cv=none; d=google.com; s=arc-20160816; b=lU1yxjpUUZksJT5t7saKikLazuqUvD3Yn0bJfN1MWLvv7miKRD0F3DFdTyOYad9moy AspuhHZAIP7t7cfcERRTWa/GupRqDRoBqciuz2BIaFkgAzEc7jqvxB+wkn7FYOfSmUX1 KxVmo2ifymJyzTw9jg8Tmz+Bkb2F5smah2SK1JR/PfDnmkz/TsDn2Qo413YHYDaCeexJ 9wrxrluLS0yOtyj91+IwCZ7gTeV1bqWfOyY1GwrTfXOEt0hjByAVZOJEU1mnAINGiZZR raZ8PVmKGev+l+xc8OVe7+ItSAfR8xJda0xZk0AbcJF8t1ih3vvu/jXjOSBIyutpibNl hunw== 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=8XRuBGVk2TTwf9hGVxYImjah4Tr644Zkbwg4wofK/FY=; b=ifVaVSmRuqUrCi7JEM3QgiXjEDERfGvB7Uni6q2AyDtk6Duwwjtrn2MDfG4dZPt5C4 MeffoScdD/hV4NruY9gc5Wk+LEdJLwuMNmmVcRiy50ruBQBRb+CNpLa2ldNMggy30num 0nlszf/iSnDbmw2nt7Qa/3DDOgnK7LehqSCCm5jC/YzDMzo5V3i9HeM4fixtOkDZdCg9 tM+qn6gLZ34Rhggn0b9gJgoV/EdvyzqtbWDVcoqbNR+2Q2/Un1nsYO/WVh6rTSq4XaKq o5cxSJo8xUvOIwbL23THJ+8Yg3nI4IfgZBsF7SSp/F1dXej3pFhQYZxDNzMk+oRdug8z HySg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MQsgJNMf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pv18si13298118ejb.567.2021.08.03.08.29.00; Tue, 03 Aug 2021 08:29:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MQsgJNMf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236758AbhHCP1q (ORCPT + 99 others); Tue, 3 Aug 2021 11:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236743AbhHCP1o (ORCPT ); Tue, 3 Aug 2021 11:27:44 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C4E6C06179A for ; Tue, 3 Aug 2021 08:27:31 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id b1-20020a17090a8001b029017700de3903so3116188pjn.1 for ; Tue, 03 Aug 2021 08:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8XRuBGVk2TTwf9hGVxYImjah4Tr644Zkbwg4wofK/FY=; b=MQsgJNMfR+UCfzZoI3VN9d1zrZA9DLouL3DIB/inowYdG23QMuaAgMKtumqCbe60hU hfJrhY0YQ1N6DR4fseGUB/opus6JMgD2941bmDYk4RJv6Udt+vn6oDHGXJjmM6CYu743 En7wyZ2crsIcka5MgxJqoapjOOphI73cAQc0U= 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:mime-version:content-transfer-encoding; bh=8XRuBGVk2TTwf9hGVxYImjah4Tr644Zkbwg4wofK/FY=; b=cjhqQ0sZaDWGbFapO1YHD8Uv05h0KjNDMob6Eqosk6rLuQ8MJZQWqDn/kznQ7mzOkm 246V+2qqYpThsqy8GCWouUzmueuzYrBTLEafx/0hf8gY1m8sgTQcVTK9Su/mYNelJhSf RSVlh62xnrj6ZWCztyaTNzCb5QFX6ubAgWkizOqBk8kpYKdrtTt/kGX7VdB/wd1Egz23 opznCLcKkmDKv1lB3j9mQ5VmdzXuxhydV5WnLd+5LsFWbuZdVLpI7TU3d5TB4QLQq7Jk HZt0iJF6ALiANT31EnOvz/1zBoju/Cscx0ezu6Hl7RuupwrEVLKIDb+7zzUjs2MxsIX8 bjAQ== X-Gm-Message-State: AOAM533NAng9y0ylxpv/Zmph6N9lcF/WbwAxwQg1mi0c1rZb50p5cGho xIF6/wgwZM82z3IXrBtyw/kFcA== X-Received: by 2002:a17:90a:558c:: with SMTP id c12mr24183440pji.124.1628004451025; Tue, 03 Aug 2021 08:27:31 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:7cf5:7e9:5266:c8ba]) by smtp.gmail.com with ESMTPSA id v30sm14922493pgk.25.2021.08.03.08.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 08:27:30 -0700 (PDT) From: Joseph Hwang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com, pali@kernel.org Cc: chromeos-bluetooth-upstreaming@chromium.org, josephsih@google.com, Chethan T N , Miao-chen Chou , Kiran K , Joseph Hwang , Johan Hedberg , linux-kernel@vger.kernel.org Subject: [PATCH v5 2/4] Bluetooth: btintel: support link statistics telemetry events Date: Tue, 3 Aug 2021 23:27:17 +0800 Message-Id: <20210803232539.v5.2.Ifb35feb49ec588106b256c508259500583582125@changeid> X-Mailer: git-send-email 2.32.0.554.ge1b32706d8-goog In-Reply-To: <20210803232539.v5.1.I41aec59e65ffd3226d368dabeb084af13cc133c8@changeid> References: <20210803232539.v5.1.I41aec59e65ffd3226d368dabeb084af13cc133c8@changeid> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chethan T N This patch supports the link statistics telemetry events for intel controllers Reviewed-by: Miao-chen Chou Signed-off-by: Chethan T N Signed-off-by: Kiran K Signed-off-by: Joseph Hwang --- (no changes since v1) drivers/bluetooth/btintel.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index e44b6993cf91..fd21ddb76928 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -1248,8 +1248,10 @@ EXPORT_SYMBOL_GPL(btintel_read_debug_features); int btintel_set_debug_features(struct hci_dev *hdev, const struct intel_debug_features *features) { - u8 mask[11] = { 0x0a, 0x92, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, + u8 mask[11] = { 0x0a, 0x92, 0x02, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + u8 period[5] = { 0x04, 0x91, 0x02, 0x05, 0x00 }; + u8 trace_enable = 0x02; struct sk_buff *skb; if (!features) @@ -1266,8 +1268,24 @@ int btintel_set_debug_features(struct hci_dev *hdev, PTR_ERR(skb)); return PTR_ERR(skb); } + kfree_skb(skb); + + skb = __hci_cmd_sync(hdev, 0xfc8b, 5, period, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + bt_dev_err(hdev, "Setting periodicity for link statistics traces failed (%ld)", + PTR_ERR(skb)); + return PTR_ERR(skb); + } + kfree_skb(skb); + skb = __hci_cmd_sync(hdev, 0xfca1, 1, &trace_enable, HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + bt_dev_err(hdev, "Enable tracing of link statistics events failed (%ld)", + PTR_ERR(skb)); + return PTR_ERR(skb); + } kfree_skb(skb); + return 0; } EXPORT_SYMBOL_GPL(btintel_set_debug_features); -- 2.32.0.554.ge1b32706d8-goog