Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp952243pxb; Fri, 13 Aug 2021 09:54:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc2qHziy62Tu8wV0PUceZichAlvh2DhEfEVIwKong4IdI8YyLJEzK+ZqJuULSVX6ElrYxr X-Received: by 2002:a05:6402:202d:: with SMTP id ay13mr4300256edb.249.1628873692110; Fri, 13 Aug 2021 09:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628873692; cv=none; d=google.com; s=arc-20160816; b=AlPVl9h+BjrLd0oo7krfJ4E9qTSfQlE4HAcYzOlqReA7rpLAa2HMvs9Jnn/1H0T3Y1 dRBmZq1xyv7qwiirQ/ubLt1GqWyRTAGeT1xChzusVxe4D4AunR9AJaWctVMgdz6UFdnk 5uLnrDtyQjrh4/kZVgcqWLJxNI8aXw7QWIz6kTI7rvXDqLEKIck8zJEnj1mDFvxKiHTC CM7pWwC1Ml8Na1ongQrOLeKrpcEx4+72N5eNxDntsu5wIIVgcGaa+RethPCcdtowFbsP kFERDyC2lUwqqJJwzIp3LJldWTkOeKhMqFa9zfPQRE0aPI0Ye+D4mioT+yWwMi8dtXyY 8mHA== 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=eFA69i6hcXDHmIcHg92qE1Me9tWDfkAMJZYxzK2xT7U=; b=ESKLov/ZY/qCn52ekyadHD+si7eBgvIn5/ef2cWAVbHB08p/nZz2pv1MbPQylFN/iU HFj0XLygTAjYq+c4jpcewLRhOSw8jedrxuGzAzhYLp1w2QoBXXvKPGEUoc0v/7huKKXk 4H7MuT7c++0FSA3W3f39iMxrjaoQIrSmctpjM+98joAqHYcPP/mnTQRUFAXmwJv5Gx4P Aj8qX+4UvTwpqFxPn/ZK6Ze7T8mU7dznvNWBjw7YwOxX2JjPJjp8zcRm30ki0OyYNlqG 4rU/3w4h374MpzyXXkKshebBfhskREAWil8zlv/iuxb1zur8bFuWLhCkk8XCvv0XuBRN BfBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TpUTdVOI; 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 be9si2333768edb.159.2021.08.13.09.54.29; Fri, 13 Aug 2021 09:54:52 -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=TpUTdVOI; 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 S237299AbhHMQwn (ORCPT + 99 others); Fri, 13 Aug 2021 12:52:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237100AbhHMQw0 (ORCPT ); Fri, 13 Aug 2021 12:52:26 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B45FAC061756 for ; Fri, 13 Aug 2021 09:51:57 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id oa17so16175952pjb.1 for ; Fri, 13 Aug 2021 09:51:57 -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=eFA69i6hcXDHmIcHg92qE1Me9tWDfkAMJZYxzK2xT7U=; b=TpUTdVOIxxBS5XmDY4DUA0cn8A8aMa07BozY2b7t3/yGqObHPKbn8+gm3m1gVFVA2G xE3NPnB7OQVXXdZ7eXWQhDzZ1aZ5i7oeuszKvvNK8rySlKies3w9FRDsHiYn7ypudYxU skPgbZgLyWlrhfEPFtMWeHlYINFQrlx63t+Us= 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=eFA69i6hcXDHmIcHg92qE1Me9tWDfkAMJZYxzK2xT7U=; b=I/GiMpOWHsL1v7Sn2cA2IlO//8fjKqS9tWZKRBGSSdQVmT20vYYjsuYDA4RF6n1k9U hoqcS5JbJiDPxhFHKfO5TAd6wfeUd4vuiCpVK63Zf45/j3sMLQ52iyMuHkblpd+JcpD2 McmrLRORtQlYI8Hf+dCc9KNQJcuwA3dJMJPC4B5AIuCHIOgjMMDzXayMFjuMOnQCwDnP P6ekP2S/zLP1YAz/hlhfIDo0sf3dcFylz/0m0bsZGQbuElPu3f1XzBpUMRoBWpMn0Yyu UV7dQeqirr/OVldximDm+UWOaIcXJ7MQIkxV1EIOLFdOIYGC4veH4dURIsKJjARvqCxN u6jw== X-Gm-Message-State: AOAM530djBTd3j5zJY9fUA/8LinZ5uRxqL24gPZl0rwsNiOUdAyKRmFo 9lYz/fYmH22zsh26ePcZyJ2tXg== X-Received: by 2002:a17:90a:d181:: with SMTP id fu1mr3429050pjb.137.1628873517273; Fri, 13 Aug 2021 09:51:57 -0700 (PDT) Received: from josephsih-z840.tpe.corp.google.com ([2401:fa00:1:10:755d:cdee:3203:71c5]) by smtp.gmail.com with ESMTPSA id w3sm2907407pfn.96.2021.08.13.09.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 09:51:56 -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 v8 2/5] Bluetooth: btintel: support link statistics telemetry events Date: Sat, 14 Aug 2021 00:51:45 +0800 Message-Id: <20210814005024.v8.2.Ifb35feb49ec588106b256c508259500583582125@changeid> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog In-Reply-To: <20210814005024.v8.1.I41aec59e65ffd3226d368dabeb084af13cc133c8@changeid> References: <20210814005024.v8.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 v7) Changes in v7: - Rebase on Tedd's patches that moved functionality from btusb to btintel. 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 0fe093fa5158..643e2194ca01 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -1285,8 +1285,10 @@ static int btintel_read_debug_features(struct hci_dev *hdev, static 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) @@ -1303,8 +1305,24 @@ static 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; } -- 2.33.0.rc1.237.g0d66db33f3-goog