From patchwork Fri May 6 22:31:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 571323 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 D0D97C433F5 for ; Fri, 6 May 2022 22:31:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444766AbiEFWf1 (ORCPT ); Fri, 6 May 2022 18:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376814AbiEFWf0 (ORCPT ); Fri, 6 May 2022 18:35:26 -0400 Received: from mail-il1-x129.google.com (mail-il1-x129.google.com [IPv6:2607:f8b0:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC3322528F for ; Fri, 6 May 2022 15:31:41 -0700 (PDT) Received: by mail-il1-x129.google.com with SMTP id s14so5658992ild.6 for ; Fri, 06 May 2022 15:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZcmTdjLDG7vNZdhSiKPXKeV+gyyg0CAX0q35uYBnL4w=; b=c1c9ZKbfSOB4xTOGzoddW2nA6QnnHKlDDOgG70Y4fgjzIeS9id7SZMq2GIeWlfreHl swDj9nturfbS3lc0Ll+bTKUxe7TheP0p+4IVwU/ut1quTFYGmxZk/uPpGj/hH0FsEqgr g9z33ovPZrAJMnUnQxPAqZY/tLP1VWV8+VKJ8/EnJ6ICrN2X6n1Be+gM+VkZLUEsco7e wbFw5fzydE2yhH/tDNQpz/ZhDRPvuqzjCbmZo7HnoHzPCEsSMuuUU/R3mzKeErb30Avg gB2XV1/AftfRNF3e0Gol8JmrNdB5dyGQh6cMMPQoMdZJZOMjQXNU9lf2RnO8neoJ+Nm0 0Oyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZcmTdjLDG7vNZdhSiKPXKeV+gyyg0CAX0q35uYBnL4w=; b=A9lCC8qAVSPKd62pXdrFBraldZvM4BbTnhmlAs1kjMwA6W7Ho2Lrd0ylGHiKv+8ctk PMXCP5HP7dwHlbMyUcPSkvfn2jo6NUAa0gZuVQhEfSCLGQ5atOA3CWOabWTItpsFFweD FyVcBrxUZPfS0R056QYipEMElRJUsBYSvQ8icLefpvZ911Qxfgoo4YTDJRmfKVhLfayJ vXPcc7cT8uryx0Lz0CfQI4BIxkiG+P67EK7EPAmJrBD19TcRs6vUKbqA/E2cfqkGfDyg wp0CuoGIo495Z808dnQtZvEKasTXJ1VNNcyrB1nUJvXTksPMqBnTI/HsndIPpzha1GUh wesQ== X-Gm-Message-State: AOAM533mTh4JvTWN949bwexx7PUX5Ta7NtV+nohCoxJ9LeJzLP32evX7 OR01gEnNOEg1fFJMXyNgw6xgaw4tI9g= X-Google-Smtp-Source: ABdhPJyY6YF/3UC49jaAimpUE1EWh9arormgVdZKt0wDPc9f0oYbQNAgYhZnz9wiZ+JEEdpUuJNuVA== X-Received: by 2002:a05:6e02:ca4:b0:2cd:d46a:6928 with SMTP id 4-20020a056e020ca400b002cdd46a6928mr2145075ilg.287.1651876300752; Fri, 06 May 2022 15:31:40 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id p16-20020a92c110000000b002cbed258dcfsm1488375ile.0.2022.05.06.15.31.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 15:31:40 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 BlueZ 1/8] lib: Add definitions for ISO socket Date: Fri, 6 May 2022 15:31:27 -0700 Message-Id: <20220506223139.3950573-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz --- v2: Fix CI findings. v3: Add patch fixing mgmt-tester Read EXP Features tests Makefile.am | 2 +- lib/bluetooth.h | 38 +++++++++++++++++++++++++++++++++++++- lib/iso.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 lib/iso.h diff --git a/Makefile.am b/Makefile.am index 82125c482..c7b369606 100644 --- a/Makefile.am +++ b/Makefile.am @@ -69,7 +69,7 @@ lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \ lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \ lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h -extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h +extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h lib/iso.h extra_sources = lib/uuid.c local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file))) diff --git a/lib/bluetooth.h b/lib/bluetooth.h index 0fcf412c6..73297c147 100644 --- a/lib/bluetooth.h +++ b/lib/bluetooth.h @@ -37,6 +37,7 @@ extern "C" { #define BTPROTO_CMTP 5 #define BTPROTO_HIDP 6 #define BTPROTO_AVDTP 7 +#define BTPROTO_ISO 8 #define SOL_HCI 0 #define SOL_L2CAP 6 @@ -140,7 +141,39 @@ struct bt_voice { #define BT_SCM_PKT_STATUS 0x03 -#define BT_CODEC 19 +#define BT_ISO_QOS 17 + +#define BT_ISO_QOS_CIG_UNSET 0xff +#define BT_ISO_QOS_CIS_UNSET 0xff + +struct bt_iso_io_qos { + uint32_t interval; + uint16_t latency; + uint16_t sdu; + uint8_t phy; + uint8_t rtn; +}; + +struct bt_iso_qos { + union { + uint8_t cig; + uint8_t big; + }; + union { + uint8_t cis; + uint8_t bis; + }; + union { + uint8_t sca; + uint8_t sync_interval; + }; + uint8_t packing; + uint8_t framing; + struct bt_iso_io_qos in; + struct bt_iso_io_qos out; +}; + +#define BT_CODEC 19 struct bt_codec { uint8_t id; uint16_t cid; @@ -158,6 +191,7 @@ struct bt_codecs { struct bt_codec codecs[]; } __attribute__((packed)); + /* Connection and socket states */ enum { BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */ @@ -171,6 +205,8 @@ enum { BT_CLOSED }; +#define BT_ISO_BASE 20 + /* Byte order conversions */ #if __BYTE_ORDER == __LITTLE_ENDIAN #define htobs(d) (d) diff --git a/lib/iso.h b/lib/iso.h new file mode 100644 index 000000000..1e9f79ce5 --- /dev/null +++ b/lib/iso.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2022 Intel Corporation. + * + */ + +#ifndef __ISO_H +#define __ISO_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* ISO defaults */ +#define ISO_DEFAULT_MTU 251 +#define ISO_MAX_NUM_BIS 0x1f + +/* ISO socket broadcast address */ +struct sockaddr_iso_bc { + bdaddr_t bc_bdaddr; + uint8_t bc_bdaddr_type; + uint8_t bc_sid; + uint8_t bc_num_bis; + uint8_t bc_bis[ISO_MAX_NUM_BIS]; +}; + +/* ISO socket address */ +struct sockaddr_iso { + sa_family_t iso_family; + bdaddr_t iso_bdaddr; + uint8_t iso_bdaddr_type; + struct sockaddr_iso_bc iso_bc[]; +}; + +#ifdef __cplusplus +} +#endif + +#endif /* __ISO_H */ From patchwork Fri May 6 22:31:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 570237 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 72AE5C433EF for ; Fri, 6 May 2022 22:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444768AbiEFWf2 (ORCPT ); Fri, 6 May 2022 18:35:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444764AbiEFWf0 (ORCPT ); Fri, 6 May 2022 18:35:26 -0400 Received: from mail-il1-x12c.google.com (mail-il1-x12c.google.com [IPv6:2607:f8b0:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E6C562C2 for ; Fri, 6 May 2022 15:31:42 -0700 (PDT) Received: by mail-il1-x12c.google.com with SMTP id b5so5672441ile.0 for ; Fri, 06 May 2022 15:31:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=DWzlXByRiJK1GiKVTGwA5BAMQgPbPfK30A7wefmRXjI=; b=h1RNeAyOrtIm6ICcREmfCrZBw9tXreIEuFtBamSbBP6YEY2Pcih3hTKj2EHcgiiXIw Msl6mSvfPnv6EK7QyLVc7H3D4+bckyTvzWcJiWdNcE9N4nscuYjmEnbmJCa8K1BW3NgG T/WWOlomJ39/GzqSdBKxuyzmuIPdVZV2nQx6pnrPTmeSTJEeyMIONcvfTkDOO8L9L3px WMzZ5YPGGuVjOXFLgvowpLlMe4Y5qpvRqtHIqAWEogtg+JIwCjlzyEXeRl2H6W9TFZjJ 921MzcZSdIlyG4udIFcWHETBYvMUtARBhrWMi82hjEgDkM+36qo+OgxYknOjQP3K7ghq pOHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DWzlXByRiJK1GiKVTGwA5BAMQgPbPfK30A7wefmRXjI=; b=sPXLYNKuwCs1HZcmIqEkuHdzBKAENI+X1eylMe6F3I2ax8hk8ajRtqh711zOtJj8wq Q2gEEO8zgtjZ84gCu7/pqCA3DCfUtcArc/M62DxhtAAcTuCLhh2vLGXIOx7Y+jpffsNO 8gPgMQTNLsnheAl9Es7pxleAgcwJI5o8xlQNiAhdYdYrLq7hGq/b4+ApQWS5gjdY6To4 L/E7PqekmuBKl9YuGUtG5fCrLlnkHiiJ+6mkArDkk+bRZeINKplkesD0FxZfYcvFf8eQ o1pOasAl7y1Q8sgncVwp+DDI2ZCJQ7JZwYb2Ub9xg/0krg/KIGeJNAH0sr+auToRsq3x u6jw== X-Gm-Message-State: AOAM531wlJi39evs1odMXphqWXJpc+R2B3tt1uDrIAmnRcRd/QPeH2CD +4zm6wuM7acKoNB1CvET2lKFd0YioqA= X-Google-Smtp-Source: ABdhPJzwWuamAPpZK9B+ucLvFEc9MKYpgBThlBpISA5rY2+6us+lBI4HEGHnTtM4PAcdaC67KYePFw== X-Received: by 2002:a05:6e02:f52:b0:2ca:95e4:f4b5 with SMTP id y18-20020a056e020f5200b002ca95e4f4b5mr2066262ilj.240.1651876301604; Fri, 06 May 2022 15:31:41 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id p16-20020a92c110000000b002cbed258dcfsm1488375ile.0.2022.05.06.15.31.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 15:31:41 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 BlueZ 2/8] shared/util: Decode BlueZ Experimental ISO Socket UUID Date: Fri, 6 May 2022 15:31:28 -0700 Message-Id: <20220506223139.3950573-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220506223139.3950573-1-luiz.dentz@gmail.com> References: <20220506223139.3950573-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds BlueZ experimental ISO Socket UUID to uuid128_table so it is decoded by the likes of btmon. --- src/shared/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/util.c b/src/shared/util.c index 33196bf8b..b74a005ce 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -1149,6 +1149,8 @@ static const struct { { "330859bc-7506-492d-9370-9a6f0614037f", "BlueZ Experimental Bluetooth Quality Report" }, { "a6695ace-ee7f-4fb9-881a-5fac66c629af", "BlueZ Offload Codecs"}, + { "6fbaf188-05e0-496a-9885-d6ddfdb4e03e", + "BlueZ Experimental ISO Socket"}, { } }; From patchwork Fri May 6 22:31:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Augusto von Dentz X-Patchwork-Id: 570236 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 1EA93C433F5 for ; Fri, 6 May 2022 22:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444771AbiEFWfb (ORCPT ); Fri, 6 May 2022 18:35:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444769AbiEFWf3 (ORCPT ); Fri, 6 May 2022 18:35:29 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A46642528F for ; Fri, 6 May 2022 15:31:44 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id d3so5668162ilr.10 for ; Fri, 06 May 2022 15:31:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=EhF9CMCiGnnsQMWw2AcnUTFA1xJBYKvdFqXkKgpPp6A=; b=BeEIUEGDw0nZ1pc0j9VLJJI+4MwUU6JLHR6SNty36hxJc3ll0h71YH68ZFq1PZWZrN 37jZ69WKIKSSECkkiVa58BqwH9S+XZzCP5WU5ckimFVJanXNK0l8KwAUfKUKBYA0pzBV p2zIy/an8AWdvwYIrc8ES4An6D9jR4H1mvUXaJYdliKNp8ktJ2asDdgjWgLjOTmXQj+L jyGzA/cCBR/JlayTZyvHZW8fWjUIbLHXQrhEdJrJEzGq96wc8iL1QKphL1IsidV9COfh ri1ExQxJAB3bdwf0DXIuMbs5aVqvqbb0P5m9gRMEwtGdPmnoEqEWlacHfYaoyRx8b4Ar PRlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EhF9CMCiGnnsQMWw2AcnUTFA1xJBYKvdFqXkKgpPp6A=; b=VqzIFGtKEVgIGWudWba/e9oUq0Ps4FEF8tKA9+xFtw0PCBtKDierWawaQHSD5GhuSC Uj2tvLFU9vRyqA//4tAAoXel7cNCzgix4N4SHhLSukjCxuOIow4oxVvCniw9MxXvwsWx MlgLDW+3Xzqw/R4s65PcbXwV3Ot0NwoWLO4zZ9yvgSv+U2q3GMvOuwEeszG3JHfG1nxh QuWFJ698aszTvo+v0xQngnnYBXl3xO1CCB9MjbzGLWrqtIseEhS3AHHKALh+uWApS6bI FACb7qf36Yn4+PPm9XbLbpKo82KggLwym9s5TeAqOby1EDfwmLXNU1TqEaWTbjgLODen A0+w== X-Gm-Message-State: AOAM532GTJ0sGvLQ08wnpxvQeOPkfwxi8EfujKRoo0gWYZ4bUCL/Fx+J MYcp20VOn6JPYqIgCrebjEvlXDi4IVE= X-Google-Smtp-Source: ABdhPJw5CFft6pcLjFYZjagzxSGq5hno+Arkom7kiSebYkpAoG6dqe/dSvWruIkdav/n0HSGHxhthA== X-Received: by 2002:a92:6406:0:b0:2bb:f1de:e13e with SMTP id y6-20020a926406000000b002bbf1dee13emr2132214ilb.305.1651876303802; Fri, 06 May 2022 15:31:43 -0700 (PDT) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id p16-20020a92c110000000b002cbed258dcfsm1488375ile.0.2022.05.06.15.31.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 15:31:43 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests Date: Fri, 6 May 2022 15:31:30 -0700 Message-Id: <20220506223139.3950573-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220506223139.3950573-1-luiz.dentz@gmail.com> References: <20220506223139.3950573-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz This adds ISO Socket UUID as response to Read Exp Feature. --- tools/mgmt-tester.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c index e5319d123..bfa5905e0 100644 --- a/tools/mgmt-tester.c +++ b/tools/mgmt-tester.c @@ -9798,7 +9798,7 @@ static const struct generic_data set_dev_flags_fail_3 = { }; static const uint8_t read_exp_feat_param_success[] = { - 0x03, 0x00, /* Feature Count */ + 0x04, 0x00, /* Feature Count */ 0xd6, 0x49, 0xb0, 0xd1, 0x28, 0xeb, /* UUID - Simultaneous */ 0x27, 0x92, 0x96, 0x46, 0xc0, 0x42, /* Central Peripheral */ 0xb5, 0x10, 0x1b, 0x67, @@ -9810,7 +9810,11 @@ static const uint8_t read_exp_feat_param_success[] = { 0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */ 0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee, 0xce, 0x5a, 0x69, 0xa6, - 0x00, 0x00, 0x00, 0x00 /* Flags */ + 0x00, 0x00, 0x00, 0x00, /* Flags */ + 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, /* UUID - ISO Socket */ + 0x85, 0x98, 0x6a, 0x49, 0xe0, 0x05, + 0x88, 0xf1, 0xba, 0x6f, + 0x00, 0x00, 0x00, 0x00, /* Flags */ }; static const struct generic_data read_exp_feat_success = { @@ -9822,11 +9826,15 @@ static const struct generic_data read_exp_feat_success = { static const uint8_t read_exp_feat_param_success_index_none[] = { - 0x01, 0x00, /* Feature Count */ + 0x02, 0x00, /* Feature Count */ 0x1c, 0xda, 0x47, 0x1c, 0x48, 0x6c, /* UUID - Debug */ 0x01, 0xab, 0x9f, 0x46, 0xec, 0xb9, 0x30, 0x25, 0x99, 0xd4, 0x00, 0x00, 0x00, 0x00, /* Flags */ + 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, /* UUID - ISO Socket */ + 0x85, 0x98, 0x6a, 0x49, 0xe0, 0x05, + 0x88, 0xf1, 0xba, 0x6f, + 0x00, 0x00, 0x00, 0x00, /* Flags */ }; static const struct generic_data read_exp_feat_success_index_none = {