From patchwork Sat Jul 29 00:45:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Rymanowski?= X-Patchwork-Id: 708007 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 039A8C001DF for ; Sat, 29 Jul 2023 00:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233689AbjG2Ar3 (ORCPT ); Fri, 28 Jul 2023 20:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235844AbjG2Ar0 (ORCPT ); Fri, 28 Jul 2023 20:47:26 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE2E44237 for ; Fri, 28 Jul 2023 17:46:51 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4fb7589b187so4628528e87.1 for ; Fri, 28 Jul 2023 17:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20221208.gappssmtp.com; s=20221208; t=1690591556; x=1691196356; 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=eQ3cPYEHW9sMNlIQBEkS+SFH6nsiO3HdBnY1xiKKbmM=; b=Xv4ygJ8DS0pFSs+kj9sI02zEaoQdEe5rTrhCYIFqN4F8oJrvX0wkrXkSEAAOReoFEe 5iwTgyfshJqB/DFQLevewku1YX5m5Y0rtGjvDfSKkmxf2k1HbkVtfiYm2HdkusjDePSo 0J9A+afajfd1H7svAYRNttI4/rW5vM8/qdmx2xbNLFVcpa0BtDSSHLKU6Yz8n45sUfVu YCOXUkc0dZogH10KmPrvPDsa0tWDc8oqEfq1GKNc183qJZiXJ9rptineR2RVh4AJccyz fOLmnbf8KeChOphTEmneWI2WD3UAQcKsAbSeP+5fCF6tOOuu15s5l5YxgGt7i5D6UmbS d2wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591556; x=1691196356; 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=eQ3cPYEHW9sMNlIQBEkS+SFH6nsiO3HdBnY1xiKKbmM=; b=GtpwdUJSGhPiMd7/E09bFtVS1H/gYLonykDts3bhV2zSzfEqJBgr58LohALhrwVsxG nq7+4kfcKF4jehydZtZhJiesHs4MqJhktl0MksNOxbozrzhlScC0XoQqPn1nqUTbTQt0 FTcodxj0iEJRkwnLOGJUk4RcBKyUmbXAOqapzJQyfS8ZNd2Kh3xqow6s6v4Eimctd2nd wm7F2C7Az3H6YmyFoAfQtSAminEZniDWq6cdlclUhluzNG90HgmDgh7D+rAwQIXv30QM dW2uuFkDv+ESovMihf8GGKHO5m5lxMCJ1V0PAsc26BU7QVw91KiP+TIEpjLAruDqCRO0 R17g== X-Gm-Message-State: ABy/qLZVR93VM/WK+kDaQzhmzngYtWaZHmiTYkOaqpjP4fq6nZYj2/35 OmGHhPF5HOi67idbUjLBtvOHlWKxjYRKwZT7kiA= X-Google-Smtp-Source: APBJJlF33Gno5QjXtayfXx7qAQ8Tz4hzoqNpsk+wze6LwwQstDYMvg3oyyNHAA+tbvvHxHjdiqlUPg== X-Received: by 2002:a19:654e:0:b0:4fe:1ac9:fe5a with SMTP id c14-20020a19654e000000b004fe1ac9fe5amr2853356lfj.39.1690591555709; Fri, 28 Jul 2023 17:45:55 -0700 (PDT) Received: from rymek.localdomain (217.96.255.138.ipv4.supernova.orange.pl. [217.96.255.138]) by smtp.gmail.com with ESMTPSA id r25-20020ac24d19000000b004fe1f1c0ee4sm617746lfi.82.2023.07.28.17.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:45:55 -0700 (PDT) From: =?utf-8?q?=C5=81ukasz_Rymanowski?= To: linux-bluetooth@vger.kernel.org Cc: =?utf-8?q?=C5=81ukasz_Rymanowski?= Subject: [PATCH BlueZ 1/5] monitor: Fix decoding Command Complete for Remove ISO Data path Date: Sat, 29 Jul 2023 02:45:48 +0200 Message-Id: <20230729004552.1422547-2-lukasz.rymanowski@codecoup.pl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> References: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Before < HCI Command: LE Remove Isochronous Data Path (0x08|0x006f) plen 3 #1061 139.246292 Connection Handle: 96 Data Path Direction: Output (Controller to Host) (0x01) > HCI Event: Command Complete (0x0e) plen 6 #1062 139.246954 LE Remove Isochronous Data Path (0x08|0x006f) ncmd 1 invalid packet size 00 60 00 After patch < HCI Command: LE Remove Isochronous Data Path (0x08|0x006f) plen 3 #1061 139.246292 Connection Handle: 96 Data Path Direction: 0x01 Input (Host to Controller) > HCI Event: Command Complete (0x0e) plen 6 #1062 139.246954 LE Remove Isochronous Data Path (0x08|0x006f) ncmd 1 Status: Success (0x00) Connection handle: 96 --- monitor/bt.h | 5 +++++ monitor/packet.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/monitor/bt.h b/monitor/bt.h index b60263fa0..fcc5478bf 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2862,6 +2862,11 @@ struct bt_hci_cmd_le_remove_iso_path { uint8_t direction; } __attribute__ ((packed)); +struct bt_hci_rsp_le_remove_iso_path { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)); + #define BT_HCI_CMD_LE_ISO_TX_TEST 0x2070 #define BT_HCI_BIT_LE_ISO_TX_TEST BT_HCI_CMD_BIT(43, 5) diff --git a/monitor/packet.c b/monitor/packet.c index f581a8e72..c7c0308db 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -9871,7 +9871,9 @@ static const struct opcode_data opcode_table[] = { "LE Remove Isochronous Data Path", le_remove_iso_path_cmd, sizeof(struct bt_hci_cmd_le_remove_iso_path), - true, status_rsp, 1, true }, + true, status_handle_rsp, + sizeof(struct bt_hci_rsp_le_remove_iso_path), + true }, { BT_HCI_CMD_LE_ISO_TX_TEST, BT_HCI_BIT_LE_ISO_TX_TEST, "LE Isochronous Transmit Test", NULL, 0, false }, From patchwork Sat Jul 29 00:45:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Rymanowski?= X-Patchwork-Id: 708598 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 077C4EB64DD for ; Sat, 29 Jul 2023 00:47:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229959AbjG2Ar1 (ORCPT ); Fri, 28 Jul 2023 20:47:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231288AbjG2ArY (ORCPT ); Fri, 28 Jul 2023 20:47:24 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84DF53C33 for ; Fri, 28 Jul 2023 17:46:48 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4fe0e34f498so4381791e87.2 for ; Fri, 28 Jul 2023 17:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20221208.gappssmtp.com; s=20221208; t=1690591556; x=1691196356; 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=JN9ulR1RTIM7xD12Rmyc+n5jrFHxZwEL7KSkU88Qtgg=; b=pKeh1vWetNDfZ8Fgpi4sne3SH0xdncjgy1dlbdA0MH/uJ2l+P+eJe+DYMecq3a88Fb DyAPeEdWeGyz6L5rOh2CyMf4axq3KYz0DVwSCduqRjCLqLcvHuvhjoGFmC0+LV/Pytwv fLEzHTn5pVuF24mefgHckDHzNfWup8U1llFrvdfp3YGKbVphJ3RpNr/1973JQnDPz0rJ m2wUco2Q1Eck2sVcJBoOCYINo1PIsTP/OtDjPEjZbe+CTqZnhAYpj9ClkDE+p7kfBMaR mWH2jmuQOEk1OzOAcm420hp4Egm4CjyhxSYZBzjLqYkwm+3DORtBnud6esFTGqwBRdvu JNpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591556; x=1691196356; 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=JN9ulR1RTIM7xD12Rmyc+n5jrFHxZwEL7KSkU88Qtgg=; b=XGPn2AaS8P5jANoCOT9Ptwf5mzw97XLjxe/LjFPnHx5k7ib4lJ6TgODrDUQm1u+a6O fSas6feuZUvnTGeGPLiK++Qg6eWhkg2EZSZbaFioxN9upd5Gt4p9XXadmck3yNAYjCSH lHvpVVb5O9DfkG3i0rGwX0tc8uZzfcxqqrPzJNDeyeVRiTD77yJ6FRy5NrkUvHjtE1dl PQ8g5tY+mJ+Zru/mC4xCCF5BZBMRHVjjGvMlU8rK37iwfTl/uOFhrMgnVINefl8wLSUz AlsbYm5wrx+LM9klqJ6IrlB8zXKQPAkh1stqKyVhBpopv+fBu1BtPkXRysGgCtTduDDH W2YQ== X-Gm-Message-State: ABy/qLZ2/SfvUBkvyzANF0D3TEOGqkZOLCnLkqsN5Ezxs0cykE4pUfQC AZ+DJJ+T/67QBKHe+s/CfPUJU5pQ9MhtCyH6Z9o= X-Google-Smtp-Source: APBJJlGLaSzgCIiaZKlOJwOSi+nv3nAC73T34OD708czi/Wa21h4qBbYCTjeQNOJx8AOv/GooC/aJQ== X-Received: by 2002:a05:6512:ad6:b0:4fb:8ee0:b8a5 with SMTP id n22-20020a0565120ad600b004fb8ee0b8a5mr2976878lfu.46.1690591556195; Fri, 28 Jul 2023 17:45:56 -0700 (PDT) Received: from rymek.localdomain (217.96.255.138.ipv4.supernova.orange.pl. [217.96.255.138]) by smtp.gmail.com with ESMTPSA id r25-20020ac24d19000000b004fe1f1c0ee4sm617746lfi.82.2023.07.28.17.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:45:55 -0700 (PDT) From: =?utf-8?q?=C5=81ukasz_Rymanowski?= To: linux-bluetooth@vger.kernel.org Cc: =?utf-8?q?=C5=81ukasz_Rymanowski?= Subject: [PATCH BlueZ 2/5] monitor: Update le event mask with bits 20-23 Date: Sat, 29 Jul 2023 02:45:49 +0200 Message-Id: <20230729004552.1422547-3-lukasz.rymanowski@codecoup.pl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> References: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- monitor/packet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index c7c0308db..fd8df7a8b 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3087,6 +3087,10 @@ static const struct bitfield_data events_le_table[] = { { 17, "LE Extended Advertising Set Terminated" }, { 18, "LE Scan Request Received" }, { 19, "LE Channel Selection Algorithm" }, + { 20, "LE Connectionless IQ Report" }, + { 21, "LE Connection IQ Report" }, + { 22, "LE CTE Request Failed" }, + { 23, "LE Periodic Advertising Sync Transfer Rvc"}, { 24, "LE CIS Established" }, { 25, "LE CIS Request" }, { 26, "LE Create BIG Complete" }, From patchwork Sat Jul 29 00:45:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Rymanowski?= X-Patchwork-Id: 708596 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA70FC001DE for ; Sat, 29 Jul 2023 00:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233739AbjG2Arb (ORCPT ); Fri, 28 Jul 2023 20:47:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235375AbjG2Ara (ORCPT ); Fri, 28 Jul 2023 20:47:30 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8C2744B1 for ; Fri, 28 Jul 2023 17:46:56 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4fb7373dd35so4865726e87.1 for ; Fri, 28 Jul 2023 17:46:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20221208.gappssmtp.com; s=20221208; t=1690591557; x=1691196357; 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=hQlKp1Eyp4oMP7RB5G+5J8r+sDCSBfQGnxxo3skLiWY=; b=Tf9StyjFhujGM5FdsYgysQgsH7vB6B3fUqpcyZ6Ao47+wHAX1vFdgfdwGJzuNYUDvM ieCw5uOaAKZ0/dnrx5wQtVOVSjEE+FjWJaB7K2OhuEHStMcEpRb1IV4EZ0JSm8kkvbcJ wI+KwWCqwLWcp5VIdUUFKtrdqUEbALC6+q05aVkqjVOPeeTrS+3oTKN/mWFKs6MUGG+M 9UgyxWaQ69PCbGFpa9GdThuun9lNQRQdeuwFvxZLa2nlAH8UAxF54yiDhIJtOisIfRiQ 3dy0m32Sey8ELBqNiK0woGNhNc06L/LeWyQOA1INWGnfF75ihms+oJnG2tHnUodNXNvM tSXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591557; x=1691196357; 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=hQlKp1Eyp4oMP7RB5G+5J8r+sDCSBfQGnxxo3skLiWY=; b=VEJW+/JwDlUKtfWAGmaYsLx0pCT7Ohvqi/CWQVh7kcY8jyr84Ft/a/uc6wnuoWxSiw 4qQuC9B9fWTmFUHQD1HAMP3R4TtgiGFs+y57t/Ms5935KcESlgS+sbFi6AI/Mn3lm768 CjiI+cpG46YmdZqHvp71ObMddQf7iafqROv7ABBWrWU+BHuzfpuZVx5KlR+hs+0hJW/e KbGQvrfjte2cRmVlfstRSPWz/v69/6L9HZTqeZZGo5T9WdvLzEaVftYc+gklA8K3sD6a uhya23KjHAcoWuWhuoQJg6R+nL3ZuceKRy0bdPFaKxFOsyGNiaWm537GlKaxJHJpE9zF d+fg== X-Gm-Message-State: ABy/qLYtVVLobQtOGyU71sfsuKnD1i3WX1UEJg6+CrJXZOHw/8k17unU QAQIRrNLTdgoytIS7jkyGfrZgA4tBPOhoOOXvCM= X-Google-Smtp-Source: APBJJlHay+abB08M/bgsi2prkSMExCQ8nqkDIUUaokitXdT9aKEsfglnUbpHQDvBxHzqNQrwAla/0A== X-Received: by 2002:ac2:5598:0:b0:4f8:6253:540 with SMTP id v24-20020ac25598000000b004f862530540mr1328000lfg.19.1690591556971; Fri, 28 Jul 2023 17:45:56 -0700 (PDT) Received: from rymek.localdomain (217.96.255.138.ipv4.supernova.orange.pl. [217.96.255.138]) by smtp.gmail.com with ESMTPSA id r25-20020ac24d19000000b004fe1f1c0ee4sm617746lfi.82.2023.07.28.17.45.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:45:56 -0700 (PDT) From: =?utf-8?q?=C5=81ukasz_Rymanowski?= To: linux-bluetooth@vger.kernel.org Cc: Szymon Czapracki Subject: [PATCH BlueZ 3/5] monitor/ll: Add support for connection parameter command. Date: Sat, 29 Jul 2023 02:45:50 +0200 Message-Id: <20230729004552.1422547-4-lukasz.rymanowski@codecoup.pl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> References: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Szymon Czapracki LL_CONNECTION_PARAM_REQ (0x0f) Interval min: 7.50 msec (0x0006) Interval max: 7.50 msec (0x0006) Latency: 0 (0x0000) Timeout: 5000 msec (0x01f4) Preffered periodicity: 0.00 (0x00) Reference connection event count: 4 (0x04) Offset 0: 0.00 msec (0x00) Offset 1: 0.00 msec (0x00) Offset 2: 1.25 msec (0x01) Offset 3: 0.00 msec (0x00) Offset 4: 2.50 msec (0x02) Offset 5: 0.00 msec (0x00) LL_CONNECTION_PARAM_RSP (0x10) Interval min: 7.50 msec (0x0006) Interval max: 7.50 msec (0x0006) Latency: 0 (0x0000) Timeout: 5000 msec (0x01f4) Preffered periodicity: 0.00 (0x00) Reference connection event count: 4 (0x04) Offset 0: 318.75 msec (0xff) Offset 1: 318.75 msec (0xff) Offset 2: 318.75 msec (0xff) Offset 3: 318.75 msec (0xff) Offset 4: 318.75 msec (0xff) Offset 5: 318.75 msec (0xff) --- monitor/bt.h | 28 ++++++++++++++++++++++++ monitor/ll.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/monitor/bt.h b/monitor/bt.h index fcc5478bf..4482e6e2c 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -95,8 +95,36 @@ struct bt_ll_peripheral_feature_req { } __attribute__ ((packed)); #define BT_LL_CONN_PARAM_REQ 0x0f +struct bt_ll_conn_param_req { + uint16_t interval_min; + uint16_t interval_max; + uint16_t latency; + uint16_t timeout; + uint8_t pref_period; + uint16_t pref_conn_evt_count; + uint8_t offset_0; + uint8_t offset_1; + uint8_t offset_2; + uint8_t offset_3; + uint8_t offset_4; + uint8_t offset_5; +} __attribute__ ((packed)); #define BT_LL_CONN_PARAM_RSP 0x10 +struct bt_ll_conn_param_rsp { + uint16_t interval_min; + uint16_t interval_max; + uint16_t latency; + uint16_t timeout; + uint8_t pref_period; + uint16_t pref_conn_evt_count; + uint8_t offset_0; + uint8_t offset_1; + uint8_t offset_2; + uint8_t offset_3; + uint8_t offset_4; + uint8_t offset_5; +} __attribute__ ((packed)); #define BT_LL_REJECT_IND_EXT 0x11 struct bt_ll_reject_ind_ext { diff --git a/monitor/ll.c b/monitor/ll.c index f588d5e99..feeb13e92 100644 --- a/monitor/ll.c +++ b/monitor/ll.c @@ -458,6 +458,64 @@ static void peripheral_feature_req(const void *data, uint8_t size) packet_print_features_ll(pdu->features); } +static void conn_param_req(const void *data, uint8_t size) +{ + const struct bt_ll_conn_param_req *pdu = data; + + print_field("Interval min: %.2f msec (0x%4.4x)", + pdu->interval_min * 1.25, pdu->interval_min); + print_field("Interval max: %.2f msec (0x%4.4x)", + pdu->interval_max * 1.25, pdu->interval_max); + print_field("Latency: %d (0x%4.4x)", pdu->latency, pdu->latency); + print_field("Timeout: %d msec (0x%4.4x)", pdu->timeout * 10, + pdu->timeout); + print_field("Preffered periodicity: %.2f (0x%2.2x)", + pdu->pref_period * 1.25, pdu->pref_period); + print_field("Reference connection event count: %d (0x%2.2x)", + pdu->pref_conn_evt_count, pdu->pref_conn_evt_count); + print_field("Offset 0: %.2f msec (0x%2.2x)", pdu->offset_0 * 1.25, + pdu->offset_0); + print_field("Offset 1: %.2f msec (0x%2.2x)", pdu->offset_1 * 1.25, + pdu->offset_1); + print_field("Offset 2: %.2f msec (0x%2.2x)", pdu->offset_2 * 1.25, + pdu->offset_2); + print_field("Offset 3: %.2f msec (0x%2.2x)", pdu->offset_3 * 1.25, + pdu->offset_3); + print_field("Offset 4: %.2f msec (0x%2.2x)", pdu->offset_4 * 1.25, + pdu->offset_4); + print_field("Offset 5: %.2f msec (0x%2.2x)", pdu->offset_5 * 1.25, + pdu->offset_5); +} + +static void conn_param_rsp(const void *data, uint8_t size) +{ + const struct bt_ll_conn_param_rsp *pdu = data; + + print_field("Interval min: %.2f msec (0x%4.4x)", + pdu->interval_min * 1.25, pdu->interval_min); + print_field("Interval max: %.2f msec (0x%4.4x)", + pdu->interval_max * 1.25, pdu->interval_max); + print_field("Latency: %d (0x%4.4x)", pdu->latency, pdu->latency); + print_field("Timeout: %d msec (0x%4.4x)", pdu->timeout * 10, + pdu->timeout); + print_field("Preffered periodicity: %.2f (0x%2.2x)", + pdu->pref_period * 1.25, pdu->pref_period); + print_field("Reference connection event count: %d (0x%2.2x)", + pdu->pref_conn_evt_count, pdu->pref_conn_evt_count); + print_field("Offset 0: %.2f msec (0x%2.2x)", pdu->offset_0 * 1.25, + pdu->offset_0); + print_field("Offset 1: %.2f msec (0x%2.2x)", pdu->offset_1 * 1.25, + pdu->offset_1); + print_field("Offset 2: %.2f msec (0x%2.2x)", pdu->offset_2 * 1.25, + pdu->offset_2); + print_field("Offset 3: %.2f msec (0x%2.2x)", pdu->offset_3 * 1.25, + pdu->offset_3); + print_field("Offset 4: %.2f msec (0x%2.2x)", pdu->offset_4 * 1.25, + pdu->offset_4); + print_field("Offset 5: %.2f msec (0x%2.2x)", pdu->offset_5 * 1.25, + pdu->offset_5); +} + static void reject_ind_ext(const void *data, uint8_t size) { const struct bt_ll_reject_ind_ext *pdu = data; @@ -707,8 +765,8 @@ static const struct llcp_data llcp_table[] = { { 0x0c, "LL_VERSION_IND", version_ind, 5, true }, { 0x0d, "LL_REJECT_IND", reject_ind, 1, true }, { 0x0e, "LL_PERIPHERAL_FEATURE_REQ", peripheral_feature_req, 8, true }, - { 0x0f, "LL_CONNECTION_PARAM_REQ", NULL, 23, true }, - { 0x10, "LL_CONNECTION_PARAM_RSP", NULL, 23, true }, + { 0x0f, "LL_CONNECTION_PARAM_REQ", conn_param_req, 23, true }, + { 0x10, "LL_CONNECTION_PARAM_RSP", conn_param_rsp, 23, true }, { 0x11, "LL_REJECT_IND_EXT", reject_ind_ext, 2, true }, { 0x12, "LL_PING_REQ", null_pdu, 0, true }, { 0x13, "LL_PING_RSP", null_pdu, 0, true }, From patchwork Sat Jul 29 00:45:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Rymanowski?= X-Patchwork-Id: 708006 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4A565EB64DD for ; Sat, 29 Jul 2023 00:47:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235936AbjG2Arh (ORCPT ); Fri, 28 Jul 2023 20:47:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234375AbjG2Arg (ORCPT ); Fri, 28 Jul 2023 20:47:36 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB4446B9 for ; Fri, 28 Jul 2023 17:47:03 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fb7dc16ff0so4647582e87.2 for ; Fri, 28 Jul 2023 17:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20221208.gappssmtp.com; s=20221208; t=1690591557; x=1691196357; 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=taXIayWUYn7caj+vvRUEtm9WjZHqMH5PPGsEOt5zeXc=; b=y5wNExmkKxSfp9XAUZDsXMZJ50qwIz+rw34Cs1//zZqm5xBhpOwUhh+BQb6EalPdkg mgWhswqiOZW2VNR92tYD3w9qaqImayj2zHM21RzsKagXq2Ef74u6JhXDzWHsC30EaOxA IHDgDm0mFzZ+hKB/sLyX0Jlgw30S8eJTfaw/OUC1Gfx72FGPPrYiTbpavolaKaNiD6Co aBruVi1wrp+1BD/qtLjj/7zdRPSfbjc4YHNhmJMt+bV3YRn6AxH1pU1NoXrhMkSDgLyz YDr8E5ZqZYFByJ+7ZmwHuL1gJW/GwK8sVg8gCr5XyfFqLXKrjc7dhNuit2PyLiuZUJGT 6Ptg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591557; x=1691196357; 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=taXIayWUYn7caj+vvRUEtm9WjZHqMH5PPGsEOt5zeXc=; b=aY+77yrtwn6dgfOFH4hw3U9vd0Thbr9nqOmOfOx1lJve03Grkr1Vo0eWo3Flp2fKA8 ZvZd3iCLxW4H/oeIfJNLNYTDz1Ss+qpYrG4pYyWkTMVJgDtdjSqEncqGB25g98xYyNFE 5lCfy4DnBg3AWFMH3zpaTJmvet/J/1YW6/0AY9/hTrims9dgFoh/PawR20dOBuQ3hDRT ZbZRfP+RnvhlAtdnhh0+in0fUsA9iyrADNgPW6tXnTk7j7xzruJZRGvB+Dqssh2fSPel BNRyvdC78TjmO2JlpyZbbCybvQR8C8a1e7RykdzCEcMXKyX32w5EjnyjEw0ry/TSA/iQ aseQ== X-Gm-Message-State: ABy/qLYUVPLg1rl0Na+OSOzaNYVooXTvCr1cABpuvxu8nFpCTwgqxAEP vvW9KLUxXFg8vl6sDLJJrKnIuu9w4sXFOM9W2Ls= X-Google-Smtp-Source: APBJJlGCFFzrZYFm9G90+xOa/NJYZq2KLWeQ0Mh+R7GUpcoH0CpkDrrz3/y+1BEd313bTQTsrpQK+g== X-Received: by 2002:a05:6512:290:b0:4fd:fef7:95ae with SMTP id j16-20020a056512029000b004fdfef795aemr2778155lfp.9.1690591557787; Fri, 28 Jul 2023 17:45:57 -0700 (PDT) Received: from rymek.localdomain (217.96.255.138.ipv4.supernova.orange.pl. [217.96.255.138]) by smtp.gmail.com with ESMTPSA id r25-20020ac24d19000000b004fe1f1c0ee4sm617746lfi.82.2023.07.28.17.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:45:57 -0700 (PDT) From: =?utf-8?q?=C5=81ukasz_Rymanowski?= To: linux-bluetooth@vger.kernel.org Cc: =?utf-8?q?=C5=81ukasz_Rymanowski?= Subject: [PATCH BlueZ 4/5] monitor: Add support to decode le read ISO link quality Date: Sat, 29 Jul 2023 02:45:51 +0200 Message-Id: <20230729004552.1422547-5-lukasz.rymanowski@codecoup.pl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> References: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org btmon: Add parsing LE Read ISO link quality > HCI Event: Command Complete (0x0e) plen 34 #14 24.982811 LE Read ISO link quality (0x08|0x0075) ncmd 1 Status: Success (0x00) Handle: 98 TX unacked packets 0 TX flushed packets 257602 TX last subevent packets 0 TX retrnansmitted packets 0 TX crc error packets 2594 RX unreceived packets 0 Duplicated packets 0 --- monitor/bt.h | 18 ++++++++++++++++++ monitor/packet.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index 4482e6e2c..dca2dc8b8 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2914,6 +2914,24 @@ struct bt_hci_cmd_le_set_host_feature { uint8_t bit_value; } __attribute__ ((packed)); +#define BT_HCI_CMD_LE_READ_ISO_LINK_QUALITY 0x2075 +#define BT_HCI_BIT_LE_READ_ISO_LINK_QUALITY BT_HCI_CMD_BIT(45, 1) +struct bt_hci_cmd_le_read_iso_link_quality { + uint16_t handle; +} __attribute__ ((packed)); + +struct bt_hci_rsp_le_read_iso_link_quality { + uint8_t status; + uint16_t handle; + uint32_t tx_unacked_packets; + uint32_t tx_flushed_packets; + uint32_t tx_last_subevent_packets; + uint32_t retransmitted_packets; + uint32_t crc_error_packets; + uint32_t rx_unreceived_packets; + uint32_t duplicated_packets; +} __attribute__ ((packed)); + #define BT_HCI_EVT_INQUIRY_COMPLETE 0x01 struct bt_hci_evt_inquiry_complete { uint8_t status; diff --git a/monitor/packet.c b/monitor/packet.c index fd8df7a8b..3031b028f 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -8946,6 +8946,34 @@ static void le_set_host_feature_cmd(uint16_t index, const void *data, print_field("Bit Value: %u", cmd->bit_value); } +static void le_read_iso_link_quality_cmd(uint16_t index, const void *data, uint8_t size) +{ + const struct bt_hci_cmd_le_read_iso_link_quality *cmd = data; + + print_field("Handle: %d", le16_to_cpu(cmd->handle)); +} + +static void status_le_read_iso_link_quality_rsp(uint16_t index, const void *data, uint8_t size) +{ + const struct bt_hci_rsp_le_read_iso_link_quality *rsp = data; + + print_status(rsp->status); + + if (size == 1) + return; + + print_field("Handle: %d", le16_to_cpu(rsp->handle)); + print_field("TX unacked packets %d", rsp->tx_unacked_packets); + print_field("TX flushed packets %d", rsp->tx_flushed_packets); + print_field("TX last subevent packets %d", + rsp->tx_last_subevent_packets); + print_field("TX retransmitted packets %d", + rsp->retransmitted_packets); + print_field("TX crc error packets %d", rsp->crc_error_packets); + print_field("RX unreceived packets %d", rsp->rx_unreceived_packets); + print_field("Duplicated packets %d", rsp->duplicated_packets); +} + struct opcode_data { uint16_t opcode; int bit; @@ -9895,6 +9923,16 @@ static const struct opcode_data opcode_table[] = { "LE Set Host Feature", le_set_host_feature_cmd, sizeof(struct bt_hci_cmd_le_set_host_feature), true, status_rsp, 1, true }, + { BT_HCI_CMD_LE_READ_ISO_LINK_QUALITY, + BT_HCI_BIT_LE_READ_ISO_LINK_QUALITY, + "LE Read ISO link quality", + le_read_iso_link_quality_cmd, + sizeof( + struct bt_hci_cmd_le_read_iso_link_quality), + true, status_le_read_iso_link_quality_rsp, + sizeof( + struct bt_hci_rsp_le_read_iso_link_quality), + true }, { } }; From patchwork Sat Jul 29 00:45:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Rymanowski?= X-Patchwork-Id: 708597 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BED70C001E0 for ; Sat, 29 Jul 2023 00:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232870AbjG2Ar3 (ORCPT ); Fri, 28 Jul 2023 20:47:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236233AbjG2Ar1 (ORCPT ); Fri, 28 Jul 2023 20:47:27 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B7F14497 for ; Fri, 28 Jul 2023 17:46:52 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4fe21e7f3d1so1826415e87.3 for ; Fri, 28 Jul 2023 17:46:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codecoup-pl.20221208.gappssmtp.com; s=20221208; t=1690591558; x=1691196358; 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=wzeMG6V94if0zmo//RHdve3uNRoFr/DpYxF05Wk0DKo=; b=Qtp63OnLN/96IblBcYoFrTxzSwX1fSz/ysskcwzgw9/uor8xzjtfpLLYU/Eu3Apkq9 12ECqCq5vd+a8wBbrjxrvVJscLQs4liyTs6DImLMnteOdjfPC7sQdKfDSNf9CzRXr3xY dqpv0D/yVnt2HLdVpvqhD5fPmN4kKEVH3K+nml96uC7FXFVJu9wfcZPt7eaEo/byVKgO NvFDVKS45Uq+Kg5sbY9hTCpywKs1bEFw/qJnsqgusSuv2YMrTreb5dmp1DkoyFDV4bmI wMusjBMJIh7zSG1Tk8/66IVADc+hygEXCpHsTUFERNM/eUlWsOJp49CP1Q5xJig3t+I3 9JHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591558; x=1691196358; 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=wzeMG6V94if0zmo//RHdve3uNRoFr/DpYxF05Wk0DKo=; b=N3QGRLBLbJJhcYluY1SVPjuwFAAWhKYK4SKnQiDOc2uNMLWyvpxltmbQAwfjNt1hzE ShfZBcwxH4yzKD/tJJ56unKEkcnWVUGsdGKGPwWngOtgOUse+pKzZJSC67OtyHU2aOQL S57LncGgBcCSR+W0tMQ93IQ7Cfj7UH0EpECWLoI+6zf7SO7UwG8UYULr2fLEWaq7bZTE cWFZ/UGuNOvxuUf32x184hQQSbpNbhyskyUCQQzQzSq5S16991apZ5subboEE86bBbhw 1nDmrMBFOTC6xyOhkhOGWpdhfQnIJLS4YT+SCTkAvtZ2noXEaHl9n83ePHxW5UDxN283 POLQ== X-Gm-Message-State: ABy/qLYqs8f0ET4wYEfwPG70wSxKAh28b23dvdEMMw8f8ymOFbL59RJr oqXorghO6mFT8w0Qoi7hOfq0QA1uQ+IAYJYqKys= X-Google-Smtp-Source: APBJJlFEqX8B41dg1cC11WPTqfKNwYvYqJC9zfICpgrywFtID8PEVHbJmeNRCfFuDJGlo2/Nm/wvWw== X-Received: by 2002:a05:6512:3da0:b0:4f8:a858:e60f with SMTP id k32-20020a0565123da000b004f8a858e60fmr3963949lfv.59.1690591558561; Fri, 28 Jul 2023 17:45:58 -0700 (PDT) Received: from rymek.localdomain (217.96.255.138.ipv4.supernova.orange.pl. [217.96.255.138]) by smtp.gmail.com with ESMTPSA id r25-20020ac24d19000000b004fe1f1c0ee4sm617746lfi.82.2023.07.28.17.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 17:45:58 -0700 (PDT) From: =?utf-8?q?=C5=81ukasz_Rymanowski?= To: linux-bluetooth@vger.kernel.org Cc: =?utf-8?q?=C5=81ukasz_Rymanowski?= Subject: [PATCH BlueZ 5/5] monitor: Add parsing Service Data of UUID 128 Date: Sat, 29 Jul 2023 02:45:52 +0200 Message-Id: <20230729004552.1422547-6-lukasz.rymanowski@codecoup.pl> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> References: <20230729004552.1422547-1-lukasz.rymanowski@codecoup.pl> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org In the advertising report, instead of deciding EIR 0x21 into this: Unknown EIR field 0x21: 3a048f2ba97ea6ae1b49c619e973a4a701480d130d We can do bit better Service Data UUID 128: Vendor specific Data: 01480d130d --- monitor/packet.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index 3031b028f..21e08ccef 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3997,6 +3997,18 @@ static void print_eir(const uint8_t *eir, uint8_t eir_len, bool le) print_service_data(data, data_len); break; + case BT_EIR_SERVICE_DATA128: + if (data_len <= 16) + break; + + print_field("Service Data UUID 128: %s ", + bt_uuid128_to_str(&data[0])); + + if (data_len > 16) + print_hex_field(" Data", &data[16], + data_len - 16); + + break; case BT_EIR_RANDOM_ADDRESS: if (data_len < 6) break;