From patchwork Fri May 6 22:32:38 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: 12841695 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 62553C433EF for ; Fri, 6 May 2022 22:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444779AbiEFWgg (ORCPT ); Fri, 6 May 2022 18:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444769AbiEFWgd (ORCPT ); Fri, 6 May 2022 18:36:33 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2628C2528F for ; Fri, 6 May 2022 15:32:48 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id r27so9571870iot.1 for ; Fri, 06 May 2022 15:32:48 -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=B5rWOg2IiJ+vkJGUPciMJTL6X2pPOeBcb0+fcIZ9mZI=; b=jw+t5lQINB1Rv6d0BHyr8Wtp4JpYiWH/HxAF962obZtNtuqAmt+PJMJhHCUIN1FAoz WipACrRmv4glHX32g/xP6HDEAsyi08mP68v1cCJnDUq02lSWFcj1dYKxzDQBoNK9MVnf +uyseXe0GKa6rqbHwk7sxezKVdPjAf9CAtzQyliPyDAmj1PyPrTjvazRdIPKApQcTvkf DXMsWE8lkil6w4cRYKkwhdHd526yN4wyA4hzxZl1LIh+cc7okXM32UdGd+ANGBXeli6p /PBklKZNWd69XS2FElUoufRgS8c47aq6f76CwxfbiVskHmDO6Z6GBIWYpLLO7PUX+7yc qSGQ== 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=B5rWOg2IiJ+vkJGUPciMJTL6X2pPOeBcb0+fcIZ9mZI=; b=pS9HOWNGGLrIXSsziBdWIMyjB76ADw9Ckck6qqXror47T+02tEKc2UfQi61kmQ+7MV P/xlUDluO4AceEt/bWTv3fONM9fDcCpY+JD/kRjT2PbE87o8VNHgBT/iBWjz3zpcwDgt RUTMCWm4benZ4m8hCLRofeRVoo8l4RDCTVCFeA2GXerTd7sDE4mN1Pi0wKsCPWz3sRQW p/krKGIrC5jBTwkEms02V929FFwKltlmwgP7u+6SBiBdnC1d6WwEevX0l1MRTOAMoQad BiC/mmBfJQo+Qk+GqJ2+A0qbtJ8Pp+Qf26hRvDfVIArTyEJC2A7zD+venmniy5xLhOi6 RhwA== X-Gm-Message-State: AOAM5338F6JEPIt0pUc/Mu9IxBUBeTr24WLkMhgqtYlSQTEyrlxeS75B Oi0l9wHrdG52Yw2AfjaFxur99bq8UUo= X-Google-Smtp-Source: ABdhPJx1BRQtpErRZJgPy7eYbiVUK0ew5TMfQRtF28v+xz2hOuql+tYTRt1spjrdhPd1VRbm8dPpqw== X-Received: by 2002:a02:6f56:0:b0:32a:ff25:1fe3 with SMTP id b22-20020a026f56000000b0032aff251fe3mr2480981jae.21.1651876367260; Fri, 06 May 2022 15:32:47 -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 x20-20020a056638249400b0032b3a7817d3sm1647254jat.151.2022.05.06.15.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 15:32:46 -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:32:38 -0700 Message-Id: <20220506223245.3950871-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:32:39 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: 12841696 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 CC835C433F5 for ; Fri, 6 May 2022 22:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444780AbiEFWgg (ORCPT ); Fri, 6 May 2022 18:36:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444776AbiEFWgf (ORCPT ); Fri, 6 May 2022 18:36:35 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFB2E562C2 for ; Fri, 6 May 2022 15:32:49 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id e3so9555245ios.6 for ; Fri, 06 May 2022 15:32:49 -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=hFhLFnIhhLSjSJ7tykaepmYL61H/XKeaAXTk0PXuWBCF2mvc5twJxvP22Mjo9KfXDv qJBAJD91FS30Hco6hR1magC+YPmYhS2q3JcMjkPIs2Tv2ZTFngnM5G8HC8J3ZXsqlVKL WPZpKlPcBnjFBum6vqsv3JXmOrEafcYtLWbkw9M9u3eNH2X8cswe4sGfQkWEwnHzgQJ1 vwvkkoCXl0lafQ3H7p+cduU8NMswT8ReqIb7pmyl5FLlWB23Q3dN/GWCcRSPwJGamH1z ykdJ/al6ShooLZJUXc/1yZeXF8qS/X+BX6bcIrY1TLvnuLsmY6vDA/bCr+B8CLYqZwvg 4KPw== 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=4Q1KBkdXA8pfc4cn9YpGFTmPiTOyofXd2HhYAS4TTFjAG4oH1vPs0b1VqQbcL1yD8q loVpR0xly0hqLFDSG3YjY3lzLN6pDlRgozcA6mZjlaO8cOx+7noHKF17pBiw9d5A092f swyv6gIqGlNYEEUekbDL7iy09/sAM+Pfd34BkuEAHbkp++dtcAwnANJlrXaSfxSj/Zd8 NqINRYOxEdKnn2jVD0YyPF08zQuUu875IoGBlufg6U9/f3gZ2rfQCNZIj8kGU6/CrFy1 nBccwbDy35GAb6fZ2xUAZbkqEUtWkFOZyEGERwQb1YIJIjwAoKmlFxAjAYrPTnp1GONH gRdA== X-Gm-Message-State: AOAM531lVxh0OIC5AgVBY6SokVSlbe37ORmfw2vF48sP6tcjs3hvn2D4 aQ8+ySnZkNV98uNl6WZMp+VTXANE9t8= X-Google-Smtp-Source: ABdhPJynw8MZskoCQpe97JgXM9gxSVuq5fHtB/fw28fxg53d31tUI82QdkP3mYOLi2CBoCFosIkM3w== X-Received: by 2002:a02:694d:0:b0:32b:3dd2:2e4a with SMTP id e74-20020a02694d000000b0032b3dd22e4amr2436165jac.15.1651876368817; Fri, 06 May 2022 15:32:48 -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 x20-20020a056638249400b0032b3a7817d3sm1647254jat.151.2022.05.06.15.32.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 15:32:48 -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:32:39 -0700 Message-Id: <20220506223245.3950871-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220506223245.3950871-1-luiz.dentz@gmail.com> References: <20220506223245.3950871-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: 12841694 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 = { From patchwork Fri May 6 22:32:41 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: 12841697 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 772E7C433EF for ; Fri, 6 May 2022 22:32:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444782AbiEFWgh (ORCPT ); Fri, 6 May 2022 18:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444778AbiEFWgf (ORCPT ); Fri, 6 May 2022 18:36:35 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D1785B898 for ; Fri, 6 May 2022 15:32:51 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id r27so9571870iot.1 for ; Fri, 06 May 2022 15:32:51 -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=vvRnIZ14qQwpmNqfTRjQS+GOr22GgxtCuDvEgGckJUE=; b=H/2tGTbDuHnTaI9QBPRr9t1pRFnHJGew/FnYfA9kDPGAAT89a9zg0zE6TnPQc2q2AM fh4gIWuyQG5Dk7RJwIPn5ZeWnNLRYZQ9YifDD1it7eqM5f2AQLiHu8gOMzeZG1ZCoGPM CbZt3ZbyTzcJjPm9FAlbjQ8DQBIjvadsMp281gVZ7zXCDtb3p2Qro6ec9qJELvXTJ8a/ 0HFGqegdZKUDFw/Iqrm3IcFLXnbqwjaOL9KQj4/W8UhWhmfFdhw7IN1sInDeWyRuwqmi +sELCrkVUTma7zChwsmvK+6z63ZetohZskZUpLS1k0DNv839YIVB7Fr2uSuLoPZ3kkTh Dwyg== 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=vvRnIZ14qQwpmNqfTRjQS+GOr22GgxtCuDvEgGckJUE=; b=sQz2Tl4gykB3VJEoiYnLfUAURSsvwpT9fPEPPNqOlgS9yYe8XSQEgUmnzRQoaJy05Z Gq2cSbZ7zcmY8i9jiKM6iG2a9IEj/1QJGdJUaMIGMMsER13sMC/lrjVrOJvTWIqJNnZj Smu7qy1Nn5SxLnP56UMeDviMezSLzjWY55Jeuk3J61jmK4NLsFHu7SKgh7tNs8Zoi9VH sw0ZaH67wcMqKs6fxIGd1Tspaxvl+SucHfHGeA8cS1BO1QtX3rrZEQN9QgAMRoFm88Yp Szebgd7qf9V7tRD0ErFu8f1kwsHs0k/mVY1ncJX/GcGR/daguEGYV0hWXnWDqQuyv/mb YyTw== X-Gm-Message-State: AOAM531HMRgAG2T+nAgjjSovDSgskfEph57ZLkoJ4WeVDtiPowg0HxPK rNfc1VCTTLhRIWFff7JbQirvnayxvtA= X-Google-Smtp-Source: ABdhPJz3YHtBuWieTVqKUkf8b8SFsuBK7a8pX7NxG0NiVFT3FjFXhYCoOj7SSozEBte+cxUZW+38Aw== X-Received: by 2002:a05:6638:38a2:b0:32b:a5a4:7d97 with SMTP id b34-20020a05663838a200b0032ba5a47d97mr2508085jav.276.1651876370822; Fri, 06 May 2022 15:32:50 -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 x20-20020a056638249400b0032b3a7817d3sm1647254jat.151.2022.05.06.15.32.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 May 2022 15:32:50 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v3 BlueZ 4/8] adapter: Add support for setting ISO Socket experimental feature Date: Fri, 6 May 2022 15:32:41 -0700 Message-Id: <20220506223245.3950871-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220506223245.3950871-1-luiz.dentz@gmail.com> References: <20220506223245.3950871-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 support for setting ISO Socket experimental UUID which enables the use of BTPROTO_ISO on the system. --- src/adapter.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/main.c | 1 + src/main.conf | 1 + 3 files changed, 44 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index db2624c60..1ede58494 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -141,6 +141,13 @@ static const struct mgmt_exp_uuid codec_offload_uuid = { .str = "a6695ace-ee7f-4fb9-881a-5fac66c629af" }; +/* 6fbaf188-05e0-496a-9885-d6ddfdb4e03e */ +static const struct mgmt_exp_uuid iso_socket_uuid = { + .val = { 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, 0x85, 0x98, + 0x6a, 0x49, 0xe0, 0x05, 0x88, 0xf1, 0xba, 0x6f }, + .str = "6fbaf188-05e0-496a-9885-d6ddfdb4e03e" +}; + static DBusConnection *dbus_conn = NULL; static uint32_t kernel_features = 0; @@ -9691,6 +9698,40 @@ static void codec_offload_func(struct btd_adapter *adapter, uint8_t action) btd_error(adapter->dev_id, "Failed to set Codec Offload"); } +static void iso_socket_complete(uint8_t status, uint16_t len, + const void *param, void *user_data) +{ + struct btd_adapter *adapter = user_data; + uint8_t action = btd_opts.experimental ? 0x01 : 0x00; + + if (status != 0) { + error("Set ISO Socket failed with status 0x%02x (%s)", + status, mgmt_errstr(status)); + return; + } + + DBG("ISO Socket successfully set"); + + if (action) + queue_push_tail(adapter->exps, (void *)iso_socket_uuid.val); +} + +static void iso_socket_func(struct btd_adapter *adapter, uint8_t action) +{ + struct mgmt_cp_set_exp_feature cp; + + memset(&cp, 0, sizeof(cp)); + memcpy(cp.uuid, iso_socket_uuid.val, 16); + cp.action = action; + + if (mgmt_send(adapter->mgmt, MGMT_OP_SET_EXP_FEATURE, + MGMT_INDEX_NONE, sizeof(cp), &cp, + iso_socket_complete, adapter, NULL) > 0) + return; + + btd_error(adapter->dev_id, "Failed to set ISO Socket"); +} + static const struct exp_feat { const struct mgmt_exp_uuid *uuid; void (*func)(struct btd_adapter *adapter, uint8_t action); @@ -9701,6 +9742,7 @@ static const struct exp_feat { EXP_FEAT(&quality_report_uuid, quality_report_func), EXP_FEAT(&rpa_resolution_uuid, rpa_resolution_func), EXP_FEAT(&codec_offload_uuid, codec_offload_func), + EXP_FEAT(&iso_socket_uuid, iso_socket_func), }; static void read_exp_features_complete(uint8_t status, uint16_t length, diff --git a/src/main.c b/src/main.c index 12cc21372..011d66d5a 100644 --- a/src/main.c +++ b/src/main.c @@ -606,6 +606,7 @@ static const char *valid_uuids[] = { "15c0a148-c273-11ea-b3de-0242ac130004", "330859bc-7506-492d-9370-9a6f0614037f", "a6695ace-ee7f-4fb9-881a-5fac66c629af", + "6fbaf188-05e0-496a-9885-d6ddfdb4e03e", "*" }; diff --git a/src/main.conf b/src/main.conf index 91b98b8c4..9d0319318 100644 --- a/src/main.conf +++ b/src/main.conf @@ -120,6 +120,7 @@ # 15c0a148-c273-11ea-b3de-0242ac130004 (BlueZ Experimental LL privacy) # 330859bc-7506-492d-9370-9a6f0614037f (BlueZ Experimental Bluetooth Quality Report) # a6695ace-ee7f-4fb9-881a-5fac66c629af (BlueZ Experimental Offload Codecs) +# 6fbaf188-05e0-496a-9885-d6ddfdb4e03e (BlueZ Experimental ISO socket) # Defaults to false. #Experimental = false