From patchwork Thu Feb 1 19:10:09 2024 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: 768931 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCD138526D for ; Thu, 1 Feb 2024 19:10:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814621; cv=none; b=Q8Uv8zGiCucztYw2A2yk6rYlUBjJf0TwMzLxTbP7rgPU2cTtkrk7CRq0+a8XFOidY+EjxQjUbG2ZFrAWVwqgk/wvtOuNRwKu1Y9NcRCnWI/4BeDupWrPpvc0ggoQLONx7aytLUQAnGcwUTLuEquZeoUKTIbwWVpqq/RVUaZ4NNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814621; c=relaxed/simple; bh=dOOpHAPXm8BsA8Z11Lydd2TjPtVhfXvcQFXbe/GdLVY=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=laKwcEsvzEeehVxfC1n/p9zojqQ3VlRWOpUhxEkBLjKu7hNcn/gpVuSUiDRZftUsRntf4LthY9d2SJWkMTHQcb3g0yXLJx9IGu77b2Eo5F/DROtQnzucHYHYPh7Jd0iotLqP0Px+VsbeAR0ihFyAIcGPKKu+X5QSXBt/6iUsCD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=P4XkQsTr; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="P4XkQsTr" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-6e132fef7baso725403a34.3 for ; Thu, 01 Feb 2024 11:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814618; x=1707419418; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=85jg8ARE52zUhjrDENCBAFvfpYN6H2nEwrS36GRf8bc=; b=P4XkQsTrHzmY+IAIe2yuWovUgs3JOroSeTV06zy4zuwc1+9vdxqYgUtKTOZNLczjOf p59MatSd89SmfPhRqHAwlagj2euVrW3Nnys4RIcSVp3+FsztS6OChGWg2388AEbgoSyJ WBR4q29WtPiWWtx7NM7oHz4AE2YuzYae602h8WEPDgWyC32AMXopOfQveVGizGFyxbOt zfNytg2bSPz+QA6qhwWdCggE7WuPoaLOUXT+lYFYYSOJRRBOvbt4WWvhK1W5kj4i+Vnv faoBzzQKJgYaaQD5SAU3jRG6AQXIDqLCwqn1349/SYlJptIH5kuGk0ixPC4PACDImcuR Igvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814618; x=1707419418; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=85jg8ARE52zUhjrDENCBAFvfpYN6H2nEwrS36GRf8bc=; b=welecCwDxubeeLkMwUg/oKGCt5FpIEDzPMldY/KvlTip2xyRXjV/P2Dl4Lp7rBOnpn JIiuyAza8YIwnd2HOKr/w1qSS8FWKkT2j6KTmtliHFV6anNEfjHb737XMpKQcUClWOSa D+wbv+UjWpMyqZ6ROqoE8x2EM5HnIYnge+YOyWRScESaWGdXDD9Tn5D+YlIoMannnMwi iYlI5Pej4aXMuC2y+gUZ0YU0xibVjXMb2DQ6ZtYVrY4bikGXvWcIdWoVxndy8YkgJT0Z 7yiW0og8D2Kk2VAP0duYDhEjoKwZcEfHe8I+VEb3BA+ZVXS/jIFR6+Ek8fSPRhQuyhp5 8h/A== X-Gm-Message-State: AOJu0YzYACstF5oEQJoDBUxg6h8bfmip7+DUsqct/3Ql/bfPXyZbsRzH +DrVY9pLGlCTZ59yPAB4gN775ezf/4a9dTKLZPdxFTYC2Ou2XqWfFN+4f+Py X-Google-Smtp-Source: AGHT+IGb07gs/s+TEFLVHcXPVLE/2U+KAti0gCRjrzKI9ONi/EobkShJW8wnQ02wFALtsWpC9AWcBg== X-Received: by 2002:a05:6830:348d:b0:6dd:e799:1d27 with SMTP id c13-20020a056830348d00b006dde7991d27mr6137038otu.26.1706814618304; Thu, 01 Feb 2024 11:10:18 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:17 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 1/8] client/mgmt: Add missing settings strings Date: Thu, 1 Feb 2024 14:10:09 -0500 Message-ID: <20240201191016.1122194-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This adds "iso-broadcaster" and "sync-receiver" which were missing. --- client/mgmt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/mgmt.c b/client/mgmt.c index 62167727c1c0..44bf4d2019ea 100644 --- a/client/mgmt.c +++ b/client/mgmt.c @@ -359,6 +359,8 @@ static const char *settings_str[] = { "wide-band-speech", "cis-central", "cis-peripheral", + "iso-broadcaster", + "sync-receiver" }; static const char *settings2str(uint32_t settings) From patchwork Thu Feb 1 19:10:10 2024 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: 769599 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB1C385283 for ; Thu, 1 Feb 2024 19:10:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814623; cv=none; b=gzHiOecftVCJILAkt8TeiBQUyBAk53biH9uKRNMHVn8jkJO1olyiYpyoJwRbMq4AFGSR475wUYWFtSXPSiwesn+3XBQaHCLE9fepWWErpeUR0ORHVJNL7pRPJwN/K6VMjAjJYmPJselufCScPMwi1LpEK7TCmJiNSPk/PVaub1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814623; c=relaxed/simple; bh=K2Utrlr0vp3zrSHviTPgil48gK7pFEhzpZMuTmocHs0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pMeqx4AxUq8RKp2rCSpWMAFC3hPR3fmFfqSf2frywELfG8vWcLXO+qAOSfULSggYnKh7XbjvelBcw8lv/VWOJbKpdBFRRFNx+7dim3CTo85JZpf8nMbjRs37+u6hsVlQKNo52HpSVlH1X2c2ZbW7rJb+W4c3GYPXzFEXslHC0jg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nlsUYIaJ; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nlsUYIaJ" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6e1352dd653so796006a34.2 for ; Thu, 01 Feb 2024 11:10:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814620; x=1707419420; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WYVVWhi5KB9maEQKsM0GSDViu6LAYuo+A4YUpEmhnjc=; b=nlsUYIaJvtYc1IUlrXnALARDCR4/m0C/Dfu8o3YVSNtJj+ho4tAalexzPm6zeQZzRn 6aaBFS5f4F2dm1nlYU4Mq4+fz9vu+cjmDrfaERgZEAlXn/k5LUxiWe7BnkvnKZLeGZhA kNe0lNcfzfV9xUws6v++A13TJp37s2PrvPv1tqs2mAs0/2iHFQIuD08lv+62/SuoEPBG BxCsXYYawmsQbJEFlk0GRsVWLrVFGIxYiSgBlL2czm7m+7JJw9ac6whcc7KAlFvw7Buy pC5Q+QeraRnTkVo4CC9Jfwmn3VLwZwsPIG7WKXpltQq6XNtcKW1leSARXSs8/UwFvHY7 vEYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814620; x=1707419420; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WYVVWhi5KB9maEQKsM0GSDViu6LAYuo+A4YUpEmhnjc=; b=Jo1mkEFdlbgSpZW8vys0WGqGCcXrNORB5F/Y7Os8SAqZVEj/EGE37v2WxR2l+eCydD d0UMm+0FzXTqg5U6yujaY85w7oA2Bp5Q0eBqHnNdAAn1B7Txm9IyQeFREGmFjCoWFloO vFHXdVaSGiN4dyc2exx9GR3QxGgnwE72h1E7vA9dkdjW2urbua2TLs9uNQ/4a7XWt5yA 8aHu9DJSu5Y2hWS7VR269pFvzZmZUJghRYWFLcw3SLU4eG6mOdcTeLNUMui151BKYNvJ pzJ09oH8FF78HhL7lHAttSxR3+8qDm05IhscPfrltQcW96KCZq9jOLSOBRI98ZzK/3Ud H2Sw== X-Gm-Message-State: AOJu0YzvH7K6PnPoo/OUNff5rHExJu/tgeOHyWkCO65gdGfIVezMu9Bl AUCcHLUcliAT0/yp7tLNlq/eAJ3LkXlAm9DoJH2ftnq9KOLwt2EQ1yh7ArhJ X-Google-Smtp-Source: AGHT+IGdosW7d6khLv6dIwVV6kdkVLQWRcNgw8fz75D0/F8IyADyQxhe7Yi6PcANzcnQg43xIgO19A== X-Received: by 2002:a9d:6387:0:b0:6e0:af93:f88f with SMTP id w7-20020a9d6387000000b006e0af93f88fmr6165829otk.0.1706814620089; Thu, 01 Feb 2024 11:10:20 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:18 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 2/8] bap: Fix passing ep instead of setup to config_cb Date: Thu, 1 Feb 2024 14:10:10 -0500 Message-ID: <20240201191016.1122194-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz config_cb expects setup pointer not ep. --- profiles/audio/bap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 7faa6be7f90b..7e87d12d02f1 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -948,7 +948,7 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, &setup->qos, setup->caps); setup->id = bt_bap_stream_config(setup->stream, &setup->qos, - setup->caps, config_cb, ep); + setup->caps, config_cb, setup); if (!setup->id) { DBG("Unable to config stream"); setup_free(setup); From patchwork Thu Feb 1 19:10:11 2024 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: 768930 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C843185292 for ; Thu, 1 Feb 2024 19:10:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814625; cv=none; b=Ak/3+HOL7+fyunPwIqYHQMFl2Zz9VaaOoO2NMNWAv9vP+etr8gw1yuFz0XkchOBN5yvyl63hIV1Bb21ll3R0NHsGajsDGaAzo4MnG87j0sMUzkRXrYY3aMek7TZPDIW+kEK1MKaPUfnJpnPSlTFOJc7nap8i4uD3FF5ryKWfvYs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814625; c=relaxed/simple; bh=J/kS8l2g9RZhxNAzKJ52nEU68D48vn31wNKus36nRsc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i8xYQS6JQuzG/rlKrCU+VT6T8zuqWkrZwavTKNd6qiLpD0BBAqgXDipn2GM6qo8ArBBwF1gLnCW6VyNqCp8P3izBRQ1s4rfLK9L9Z+EgMMw/hjmOmJTSSxamIXxFY5hkIcc76McRzWbOvQLo4ykjDmYwG9Zyht/GxWdicg3H+Vo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=azBpCr1o; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="azBpCr1o" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3bda4bd14e2so1030180b6e.2 for ; Thu, 01 Feb 2024 11:10:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814622; x=1707419422; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=+HC5SdNvCWeKEwtYq4o6Mizban1zGXB05RzkUe4htxw=; b=azBpCr1o8HtVe+YGe0BcKXnahnhYWC5bDFUZ+Lt4BGHReI6LL7Fimxr4nP9wVowlFq HxQWSyeyNqg0914yU1FAVvvwCnsLQrdBAtZlnG/SuJAuJ2ae0tsfG2ct8C9aEj56Y0OU ydANONblHKbo56h1+EGAhW/wEerNdZjGsh9FcusCsZdKF+7G55cxdzBfwTRbzO9qlYgg BU7TcKSea7hMCN2sEmMIOLxVRwe7z6cH0Mgz8BfzzLRHkpY7YBMizTwMmguI0A8kVJKb MvbZ8gmF1I825UJD9uTusRUXsSmLMI5cyTpuURM3SiIKKE+pbPMzXfcg4uI8jEbj8nao pvOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814622; x=1707419422; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+HC5SdNvCWeKEwtYq4o6Mizban1zGXB05RzkUe4htxw=; b=mlAJapBMZjxCJ/asEL9XOSTZeQXVdIKqzLsQdVsNOlM6Feo6yGBE+3c8rwze7ikPg0 n2A7CnRJNXgKzTBa+WqzPQefSNO5NQgJYXPnPZOkidJEwGWFFTsYLRGhzOzfaWmkWkRp F95Mf/1PLidMswxWzLeMyLalj4Ebwia0kkzA1ZOxLF4QOinM4w8MofnRfTAyxl7wnIL7 zrATbK0UsUGOsbIGL/rohi48f1CiNWvHw+B7Z/ldiVEj0B2bocC/KRAa9guAiIRwIP/d qAtizBfZ/9E9P6/D2t8yjjDbLQgLqGzbhMaDR5JAb/MNhMa/eSNdvDr0JyEbtMq1uLFP aBaQ== X-Gm-Message-State: AOJu0YwH2VSjFpGejnZLrVlh3uDalewuRgr/nUKR5tYdf7TyXWgemtZU IVUGtzHS2M1fsIelcQzHTK68DdVEAKo1pNruA5mXr24bxvEo+GclIiF5tbr/ X-Google-Smtp-Source: AGHT+IH5GHUZzdJ4kl/vW01hOPK8N9AH5bQVU43ZH6jvNsSDmRbtX9tj6qhgf8OcuRY5sNG4Gkq/yg== X-Received: by 2002:a05:6808:178d:b0:3be:aed3:5d84 with SMTP id bg13-20020a056808178d00b003beaed35d84mr7102627oib.26.1706814621780; Thu, 01 Feb 2024 11:10:21 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:20 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 3/8] device: Don't remove object if a service is connecting Date: Thu, 1 Feb 2024 14:10:11 -0500 Message-ID: <20240201191016.1122194-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz If a service is connecting just restart the timer to give it more time to complete the connection or disconnect. --- src/device.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/device.c b/src/device.c index afd073c6c2a5..1db96d9a672c 100644 --- a/src/device.c +++ b/src/device.c @@ -3276,6 +3276,13 @@ static bool device_disappeared(gpointer user_data) { struct btd_device *dev = user_data; + /* If there are services connecting restart the timer to give more time + * for the service to either complete the connection or disconnect. + */ + if (find_service_with_state(dev->services, + BTD_SERVICE_STATE_CONNECTING)) + return TRUE; + dev->temporary_timer = 0; btd_adapter_remove_device(dev->adapter, dev); From patchwork Thu Feb 1 19:10:12 2024 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: 769598 Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CBEB8529A for ; Thu, 1 Feb 2024 19:10:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814627; cv=none; b=pCAAG8Rxn6T5YNucMiAuITD6PYgmD42NkTqyTDsB57USHYIhfUV7mMZafxEoG5woRQ683hfTiqaNU6X8E7esumkNTKQWf9KQ+6vgKwcmf2GnTpqR/EnCh4VgQERl5/J8V74ZWPws7Jd1KNZqgU/P8WatXkWb9C5gyPStv1737gg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814627; c=relaxed/simple; bh=gyuyQ/aK4rZwWgwe0gruyYcDUQyzIfPAlXAzVb6Vozg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ObGy5PEi1SiU+Pwdiy7HprnbyA79XuAN0VYFi8Xy+FZoBUxPykJ4Ko2tUXtLiBJ4jbfpbwFMoFBDt3b+4PP7EfsIT6mJ7cn4ed0dkLBUs40c/PYhKDXd4X7eY9jnf1VtQx4elYfJku9fU90QY5TW0GP8UgOM4kL4okcYCc5qBxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ke3Wxw+x; arc=none smtp.client-ip=209.85.161.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ke3Wxw+x" Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-59a7682486aso544103eaf.2 for ; Thu, 01 Feb 2024 11:10:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814624; x=1707419424; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NfocMJ4OgAO3HX5ciQuRwEHA66Qb0abBxdrZu7QgJK8=; b=Ke3Wxw+x1A0YaqZmGxC5ie1Zk7kAL6noDc0t/aCJEX94FUrVGTJYSlaqIcvX1EFz3d JvEMvnPu+IqFhwvljb1bkP58pZKt9jrwTLIUx8ppTlyWbo7UpOTFaDpLkORTu2GJHgVZ +52yY8saXRlAvt1JgVhzeGWmBozfrVxvDwSV3jB4FK18U2XwXDlu7jb5wE5O4FyfTw2z p6CNJyOjouzcaySfiKNdgnqMa9mC8hfH7HnYeA9A8bAl4joewsbHt5B7OGaDAwMPAW9d JFouGrnj/xDeBpdqMBEO8xkX1ldtIQwlh+ixOB86LvSQ5yumXK4EHkMjm8lGV0dyRO6d xq5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814624; x=1707419424; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NfocMJ4OgAO3HX5ciQuRwEHA66Qb0abBxdrZu7QgJK8=; b=nJtVgQVrOWAc9eYWnMbNVbQpb0Lkg7Fomo7I9qpyB9fIHCDFd010TvOBn7d3fyNsH2 pADUsie4COW/UloRYWabiPwEfT8c1JkUs+T0JH9FPAjHYsi5fl2thWALFu3qYmfQQfxp yHJW+dRhsDp06FOR2N9McI3G9wJmGtQQWLFJTYNBI4w3drUqtWH1rfFx8GzArLE1elDV VjFhuCQ2RuYmXiuuV/uLXDp0zOmQKow/hlG93qOltfkGYlsSWCiS0VXidz60wqx4auhd tRLli8pgxCkQAXyDZmk/z/WGlsuLO5U6/m3nWrsgJBuYVcrSP1/nOHt9A1KaZiTVr01t KLUA== X-Gm-Message-State: AOJu0Ywh+hlxTHqRRvkA2vY57+UMUrVi/AT9IBCQbpRqdH/4B4J1uuFv KvFLns/1tvs1piOU82fOcXFQTxbztTlVIxINwuy9xB5lm5D0GkgnmR6pafNy X-Google-Smtp-Source: AGHT+IHio+u3quunxNJBTesdFHZYxJAFYMlS49XEsZH1oydtct2EGjuWRWZfNk6OyUmConeNA+kwqg== X-Received: by 2002:a4a:b249:0:b0:599:e74c:ce3a with SMTP id i9-20020a4ab249000000b00599e74cce3amr3120505ooo.7.1706814623989; Thu, 01 Feb 2024 11:10:23 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:22 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 4/8] shared/bap: Allow using bt_bap_attach for broadcast Date: Thu, 1 Feb 2024 14:10:12 -0500 Message-ID: <20240201191016.1122194-4-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This enables use of bt_bap_attach for broadcast by checking if there is a client or ATT instance. --- src/shared/bap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 851d6a5facc3..ce8d35f86af3 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -4156,7 +4156,8 @@ bool bt_bap_attach(struct bt_bap *bap, struct bt_gatt_client *client) queue_foreach(bap_cbs, bap_attached, bap); if (!client) { - bap_attach_att(bap, bap->att); + if (bap->att) + bap_attach_att(bap, bap->att); return true; } From patchwork Thu Feb 1 19:10:13 2024 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: 768929 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD0EC8526A for ; Thu, 1 Feb 2024 19:10:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814629; cv=none; b=BmKjblBcb9ySyVTFyAH6rEtMc/VLw+srKUphRsJSF+zv5ytsOtWJdTzvKq1Zyj/3ACYpEtDXMxZ0Kz+AdU6uZp4vR1ZmNUrGSt7bN45f0oWAqPCOjKYgoU3edcy8VlRUq4DWqYu//87EUobShdAq5evHLfSGWVOKQc2H+cY1ijI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814629; c=relaxed/simple; bh=AAOtZ8xC+h1vmDpGmod5czlcvsYkjYt1Bxoa+kp7CgA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EVjqco66Aeim8xVDM3OHt99Hi4J6rE7lzeV0XBSN8lxSC2JYzzFXc4r1sxfF/qh1xUDT7Zl2HRFxwgoTM/WYRdP0TjNCgMwLX0Tl+U9ckRZWZIRog7G1C1eH5QwrbBjyji5MFZDbhYqsOKWVno/T3CgQgdpAYIglCsAX2jYpdA4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ew+6pOfz; arc=none smtp.client-ip=209.85.167.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ew+6pOfz" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-3becd4658e1so684097b6e.1 for ; Thu, 01 Feb 2024 11:10:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814626; x=1707419426; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=G+0d8Hy5JsXKOl1rOEs9vku4hGWhA4odGKzZJQAiN/U=; b=ew+6pOfzkzXwihaPelTzMyREvbRxLBlSKAkpRvBdUv6cp1ZULkiPfLUpkzqIUhf9ej 1nWt9drO50zFpFrH65ojq5TNMaBEEvwBwzAGwikusYoRJENNRrmczr1TF+sM42d1lf2L j+VgsbXPMz1xxcVo9n78odaYY8xFp1HKiq+iNs15Bc7mavULdAmjj6vjhgihhj6LGPD/ o9f8lexIMHFvTZLyQYheC92kMuF14y9Gyl2jspeabvT5HCY2LEVeDFUKCOk5PopNYDGX 9tWURnsk1AUMz5Bey8JEQxTcJT3KT2j48PP1iJTuyTs0v/tkr0QFBi1OgjmrhoD3hZE7 lUGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814626; x=1707419426; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G+0d8Hy5JsXKOl1rOEs9vku4hGWhA4odGKzZJQAiN/U=; b=mZW6nJylWr6bUkVDdrsicd3V2u6GHXUY/HeMBxseXsrKrzUUR+pCggxPXZvpHIhMDm 6vhJSl4AiZ0aHhVoRqU4H+jLvXVvtR+Yv4CqMuNJ5vrvdQ5+RA5wRtB6SB5j4PDddF7u /uM4VbAEJln16OY1l1H+dV7pW9fVQuHZp2hXCGztvOff31jgT0hk7WsEwKuR1an3eo7j 8W3Rv5jwdT3Ps8wlR09ROJ90+vPeMSn2TKHmWebZj7NMMercOP/XpGJQ5dLSt88UuFGX wp9iS0OVvPQziooP2kuZc4A1RMiaLfhkqWh7QYIvldyLRloySbpg5HcwideH9uJIpSwg /slA== X-Gm-Message-State: AOJu0YzpffRLOs70aAu7EvGUZwVB8TevzPK6eC7NTwicE1x6sypAdV66 pq6GVnISSzbdgzSvUgr4z4R6MVJZbYkt/80ud8Sny1dAEYjC7SzDxwRLLLKx X-Google-Smtp-Source: AGHT+IE8VaVyhEsMQPL2ek17p+Ifb9OhURY3vC9mpQ9ft6wpCeNj1L5a6fyl4Ha5dzsArJ4TkxSgcg== X-Received: by 2002:a05:6808:2024:b0:3bd:cacd:332d with SMTP id q36-20020a056808202400b003bdcacd332dmr47266oiw.40.1706814625732; Thu, 01 Feb 2024 11:10:25 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:24 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 5/8] bap: Fix crash when a broadcast strean setup is pending Date: Thu, 1 Feb 2024 14:10:13 -0500 Message-ID: <20240201191016.1122194-5-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This fixes the following crash when a broadcast stream setup is pending and the device is remove: bluetoothd[37]: src/device.c:device_free() 0x89a500 bluetoothd[37]: GLib: Invalid file descriptor. bluetoothd[37]: ++++++++ backtrace ++++++++ bluetoothd[37]: #1 g_logv+0x270 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557e3120] bluetoothd[37]: #2 g_log+0x93 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557e3403] bluetoothd[37]: #3 g_io_channel_error_from_errno+0x4a (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557cd9da] bluetoothd[37]: #4 g_io_unix_close+0x53 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb55839d53] bluetoothd[37]: #5 g_io_channel_shutdown+0x10f (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557cdf7f] bluetoothd[37]: #6 g_io_channel_unref+0x39 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557ce1e9] bluetoothd[37]: #7 g_source_unref_internal+0x24f (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557db79f] bluetoothd[37]: #8 g_main_context_dispatch+0x288 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557dd638] bluetoothd[37]: #9 g_main_context_iterate.isra.0+0x318 (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb5583b6b8] bluetoothd[37]: #10 g_main_loop_run+0x7f (/usr/lib64/libglib-2.0.so.0.7600.6) [0x7feb557dcaff] bluetoothd[37]: #11 mainloop_run+0x15 (src/shared/mainloop-glib.c:68) [0x662e65] bluetoothd[37]: #12 mainloop_run_with_signal+0x128 (src/shared/mainloop-notify.c:190) [0x663368] bluetoothd[37]: #13 main+0x154b (src/main.c:1454) [0x41521b] bluetoothd[37]: #14 __libc_start_call_main+0x7a (/usr/lib64/libc.so.6) [0x7feb54e1fb8a] bluetoothd[37]: #15 __libc_start_main@@GLIBC_2.34+0x8b (/usr/lib64/libc.so.6) [0x7feb54e1fc4b] bluetoothd[37]: #16 _start+0x25 (src/main.c:1197) [0x416305] bluetoothd[37]: +++++++++++++++++++++++++++ --- profiles/audio/bap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 7e87d12d02f1..26fd465bf560 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -974,6 +974,9 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, setup->id = 0; } + if (ep->data->service) + service_set_connecting(ep->data->service); + return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } @@ -2437,6 +2440,11 @@ static int bap_bcast_probe(struct btd_service *service) return -EINVAL; } + if (!bt_bap_attach(data->bap, NULL)) { + error("BAP unable to attach"); + return -EINVAL; + } + bap_data_add(data); data->ready_id = bt_bap_ready_register(data->bap, bap_ready, service, @@ -2644,6 +2652,7 @@ static struct btd_profile bap_bcast_profile = { .remote_uuid = BCAAS_UUID_STR, .device_probe = bap_bcast_probe, .device_remove = bap_bcast_remove, + .disconnect = bap_disconnect, .auto_connect = false, .experimental = true, }; From patchwork Thu Feb 1 19:10:14 2024 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: 768928 Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88F468526A for ; Thu, 1 Feb 2024 19:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814634; cv=none; b=UcOpUvVA3fZKZ/xWSzrWlN59puUscqvaVh5rPsKXdy3A8RtOF6GH1qwoau2yKVDiOMTkzSyqeQ8mhkkimhA+8712jCVfq5BUBblS2mXQ12mEkJVJjkXiw3mMg8+Ul5VJzRW57zDmMKBp3JKFgDPXIsNElMVBW/cnhXPyx3XQwVU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814634; c=relaxed/simple; bh=YtUoUoBrhRocQ2Ss6fStMsNtC+W4fNfPhKPHhIahCEs=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OmW5H2/bj7JyhZ21oW3XNXMdCh7IauydsN/H7t8CA3VU2SFO0ztctsCEnwMCT1DS9pb3DK+y6u3434xr4vNFi5e4nxXT7i2R/iXlfXsOunruWjj3Tc504su2VflVH7Gjj2CNFLHYrcZbExS4geL9sm5xkkV3iCl9OvfL+MpKl54= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QxcmohJT; arc=none smtp.client-ip=209.85.222.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QxcmohJT" Received: by mail-ua1-f51.google.com with SMTP id a1e0cc1a2514c-7d5bbbe5844so652190241.0 for ; Thu, 01 Feb 2024 11:10:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814629; x=1707419429; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=R5hnVXQvWmjukNR4Nfm70AbPyy5IeGX3k1DvjsBuGHc=; b=QxcmohJT+08fdWDqHzlLVHUYoc2c6UzZmWMYgwvdRssh7VOUC2k2BPfvrT7fiaH/XL XrJhbBLKjSkTq54clIH0scCAqeydoUcM6ZK95sjA+mOi9YBozeU+wV7tUPDKKlsOqck+ /6ZMqOQZbmSAkGgv+5AhEA4Y21EddfnjUoEs+9H+9xm/TFLcYzg4x+FSdcnAWhwzkTjm hpoWM2Ajl5hz3eWjVw1fwXpxk2j3Wr6+WxCAQ9bd/WM8F6ukJsG9UxTbdgrdyfYxuV7P fhsRoMokoT9SA9blVqGV6tRlanGUUtAOd5+fhawZmTScxpihk6VN5dOnsSu/4BVnNAA+ SI/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814629; x=1707419429; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R5hnVXQvWmjukNR4Nfm70AbPyy5IeGX3k1DvjsBuGHc=; b=PYU9ICcMpvbmasetm3926tr8LqhdD5mb+GBbIAxtRmsv+4g2U6ybyKWS/rFeVHv3P3 9HBiPj8eSwjhpqj6YG7vDHz0aCpycYbS9R0QtU9e6cWGKVo9iUXxGQq1zAEU2mFkUrZk Uo8b3JuwyH+UL/yGwiJ39+cMbt7AEk+kEYxQEKMbMgKOWa5bGJbxLNOZiG7dF+trG6ia 9mHYCA30bX6b3hPmr+fK4YjDKFHuhPZ+XzZepOtSqORfPCyW087Be+F+oO27/mSvMH9n WlpNikU8Y6AB9lmrvoR3+df8shxQ+b7UBw6YujzSyPGAgC3PUk21pQfkdR6a0K0ZsSVo lxcw== X-Gm-Message-State: AOJu0YxCPFpu30Z8saGtuogZjHR1vKL+/2eHXR7Ce8O9Zzz4JTFVqWiK Gr2QX3gRlEHDXFex6QhtTaD9CyS/IQmf44tmBSqwntfuO6wDyErcEB0hgzkP X-Google-Smtp-Source: AGHT+IGTcflhxIcx9TJgWOc6XV5ik9OyKHls0pVY4J9/7aoaNwGFZAdEIzEHqqH4p1Eb1QNV4d6VXA== X-Received: by 2002:a05:6122:30f:b0:4bd:8029:6700 with SMTP id c15-20020a056122030f00b004bd80296700mr5002231vko.16.1706814628099; Thu, 01 Feb 2024 11:10:28 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:26 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 6/8] shared/bap: Fix not being able to reconfigure Broadcast Source Date: Thu, 1 Feb 2024 14:10:14 -0500 Message-ID: <20240201191016.1122194-6-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This fixes not being able to reconfigure broadcast source due to it being in Releasing: bluetoothd[37]: src/shared/bap.c:stream_set_state_broadcast() stream 0x8919e0 dir 0x00: streaming -> releasing bluetoothd[37]: profiles/audio/bap.c:setup_new() ep 0x8802d0 setup 0x88d3e0 bluetoothd[37]: src/shared/bap.c:bt_bap_stream_new() Unable to find unused ASE --- src/shared/bap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index ce8d35f86af3..f2d2ca09bb24 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1379,6 +1379,7 @@ static void stream_set_state_broadcast(struct bt_bap_stream *stream, break; case BT_ASCS_ASE_STATE_RELEASING: bap_stream_io_detach(stream); + stream_set_state_broadcast(stream, BT_BAP_STREAM_STATE_QOS); break; } From patchwork Thu Feb 1 19:10:15 2024 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: 769597 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 678D38529B for ; Thu, 1 Feb 2024 19:10:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814632; cv=none; b=Dh1omMCxrhd5DB543YRqdQYoaDn5WQf5zvhoO2JKn/CLbBMujNtgalaaiogQI6Cui5IAaOkbh1ncchJ9WkKgD3gQ6BeJVngZU/YQZ+uB7U5iPQkU1fN9+qjyyavtxN91YKNPPxEdGw9HxwVvFJ2DEN1+8npYDnpUA0Y/u0e6+fA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814632; c=relaxed/simple; bh=/52bgWmfzVBdBycWkeYpSqsNuz91qjGOeus3xfaIrU8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=syfMsiO44rFNpkMvV8ydSb1dvutSkzY3zqA/ZUyOD2CNwU6WilyxO/isnFZMan6F4KQ3aMSaf/xqozQeCpYwDLujI8aV8i8ieHodhtyJHZSCs9brNRZFTImMTDI2OkE4B1FvxEHmNh7kwD5Z+j/egtDuyh+IVK7ZoMJMekDxsH4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J/Q/S3u1; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J/Q/S3u1" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3bda4bd14e2so1030289b6e.2 for ; Thu, 01 Feb 2024 11:10:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814629; x=1707419429; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=iqkf6vTxx5YRE7E2hXtKrZibTUoWwFKj03+5JwG7p+o=; b=J/Q/S3u1J1Isv7YqHCScz+Z/SwIMfeBgQtUBo+8+eqC3l8irBlJTy0/p4P4rS+iory QezsLyYSAqgGYCMiUSmT6SJ9HMS+/fZfTnT/ULVDy0ET55iRvLdU4nBB/uoArkdr3+GQ ntS6pp6P+XmvpRUVz2fznw03MUOLsIxGewiYV3SpX7JXLws7LHI+ue9Bzz+7X1mLJaYf FoVs4UC/OQEDz/uY6jnM1OlZz/yHPwYgzx0WWGqZK5MZSno+YXd+8UNnWxxg4Rj+UgtE Q7bYqx6YBiRd96fpb8ZTUV3UcRUykwHxn409dT1KiSqFQF8krM1j9NPWqfqHMhfTIs+6 8euQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814629; x=1707419429; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iqkf6vTxx5YRE7E2hXtKrZibTUoWwFKj03+5JwG7p+o=; b=dA3OBeqdjsH8ZZZ9DbdvgUxFldXacqLEDVRnpMiDiF0rjg4tN40CwyJEiFUnzsaUV9 QlsOxK4QAzkBNUH+WN5FMvNNPTy55TM0yHoH7lQcjPWvrp/CG92OH2k/83hbn7StxA7H OtzLUsZyzKl95ES15gEfKp/JLMlkpVkB43nbs4O9inKLqHdRuXm7aaYWjVIImmJgfkie XG6KLT3+fMctdFo8QPJ/P1z/PRfyXD9uBlr89LFnVM3g26DlvZEzTAIsqlAYGBNkoSfW kCH8/WDi8mePMAcolBTq1H7brrS//ow38XzUHm8w6/LCKtvdNARGhROxowqrpTpahWFP b+iQ== X-Gm-Message-State: AOJu0Yy/10ZIdz8udr3F+KfqiZVjpEUEb9NJC50R1Kk29ZHky5RslbVp p64ZhDaoa9aYgrrqcxThK0n4G94GTIGJldZPKp1deC2T1KyQ267Js3NZG+UB X-Google-Smtp-Source: AGHT+IFWEPoGkVvUO1haqdeT4g9EyHvFlupbuWNOlbZyCExsMH09QB1RPwpMm6vpxRlHpUGEGlrvpQ== X-Received: by 2002:a05:6808:e86:b0:3bd:59da:57ba with SMTP id k6-20020a0568080e8600b003bd59da57bamr6152479oil.59.1706814629225; Thu, 01 Feb 2024 11:10:29 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:28 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 7/8] transport: Fix crash when disable bcast stream Date: Thu, 1 Feb 2024 14:10:15 -0500 Message-ID: <20240201191016.1122194-7-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz bt_bap_stream_disable does cause the stream to go to releasing state removing the owner in the process so calling bap_disable_complete passing the existing owner would likely cause a crash. --- profiles/audio/transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 796017a4c6de..bd8960ef74fd 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -1532,7 +1532,8 @@ static guint transport_bap_suspend(struct media_transport *transport, id = bt_bap_stream_disable(bap->stream, bap->linked, func, owner); if (bt_bap_stream_get_type(bap->stream) == BT_BAP_STREAM_TYPE_BCAST) { - bap_disable_complete(bap->stream, 0x00, 0x00, owner); + if (transport->owner == owner) + bap_disable_complete(bap->stream, 0x00, 0x00, owner); return 0; } From patchwork Thu Feb 1 19:10:16 2024 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: 769596 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DF9C84FD8 for ; Thu, 1 Feb 2024 19:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814635; cv=none; b=HMZiRbTYnTu8moqZN9aW0yUarSw2GWLyylej0x7kJ+hY/nZ466PfQoi+SnbWKu0YLDncSgqYH2nb5I0ZC2M98tQqQSQNNtZr434uhqbyH+51MhToSMoeUB0gkVl7VHr5xVa7mGd3ivZwhWqe8F0G4CvA+WE0aLZUKDQudvE1L3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814635; c=relaxed/simple; bh=uM8Gep3U13CUEwBIglcJfDvyNyo5H9RIH/fAek0o15c=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V7A7rlFrXqyPnRY+A45L/OVo5nLjwthrfjT7Y4qv2nv8MD5Yof+C2KxUNCn3X4BwxQGI2EerGiKu+xT0c1Di3mFKgHd1ZqsXAHQfM0C4v+6BUV67rGwTeIw0YbCA1Abw0H/EyMNGe0mSoLaBi1dF85CRuJT0klxPxnE+/thnuuA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PTAR8xzw; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PTAR8xzw" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6e133d5271cso628550a34.0 for ; Thu, 01 Feb 2024 11:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814632; x=1707419432; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qIl/eGvO+Rr3euE6aD0rfqQ1CAoMMey4PPG/IxwCfDU=; b=PTAR8xzwG91cbyQlSJnv+IaiOCrCkoW9i5wUOgnkiM5fi3rVLHtVTSZk0TmBxafwWa F5gUP3WKFqU9rjlPtTaA6ZamJzew1n2CNPzJZhgJLoFRlA0u8+0Ig11oB0Hpvzva4wUQ n95NgDVgxr/TcwEdIG2Yg0MLV1WQiZBVB8S4Qndxp/XPDQ76iyHlqBjgcyg6CrwSJwFR 1kQVgijfQBBXHmjCvTNjxPpkr6kc0AqNL9mVPkRyOLYWx9KZ00gE7zjPdSi2eI49PByk tQqiLJEisQBDDsxVzhM5Dg98mk3jlAMd992RfZuwhVnrUY7suyFf8KRtzTKg3bVELUDx cTvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814632; x=1707419432; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qIl/eGvO+Rr3euE6aD0rfqQ1CAoMMey4PPG/IxwCfDU=; b=bNa2VxJvJqGZ6faMNXqSmwdI0IU7CQzJuaaAA77PNsYAM9A+29jmg3WN3ac1g5CH2z WBAD0g6wm/Zroageg1Mva1eBp+ZZbLi+FfrubYssp4OiHkkRXv0swzh/mFWaX61wUglE N+JbW4Xs6GOi/yzDx6UQsqtTZ3p1LKgGwWXiSBFCV4gYsOGcPDr8s51FyDXrNJHj5hzE cLeCRGRwL88QdSSHtrv0P8O4H8q4H3/lUusxsIFyYvlt9ecbcEO/c0c1gLp7A0bY7dJ3 uQcStNpD2wO4X595s+47geekI6OC2sgmvfpy0ht7CL1mlj34BeHwOmScfFFiXefeh+AW q14A== X-Gm-Message-State: AOJu0Yz/V5hGP3FyjsfUYn2xo0Udl4NOwz+FqvTxe8HTlsAv0pZsXAfv 0J0VXx3+QUZpczFlVtGMr5gzQ2759rdQ3ev8PV0pp4W+ixFWm2vvY0874x98 X-Google-Smtp-Source: AGHT+IE4L75FrR3FHXaD41QLfnkDVdezCXtHq8Us/L27p12+zg9H1hnxufUkeqLQSzF3aJLAMjQu+Q== X-Received: by 2002:a9d:618e:0:b0:6e1:29f3:6fbd with SMTP id g14-20020a9d618e000000b006e129f36fbdmr5605440otk.22.1706814632091; Thu, 01 Feb 2024 11:10:32 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:29 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 8/8] shared/bap: Make broadcast disable and release more consistent Date: Thu, 1 Feb 2024 14:10:16 -0500 Message-ID: <20240201191016.1122194-8-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Luiz Augusto von Dentz This makes bt_bap_stream_disable and bt_bap_stream_release use disabling and releasing states to be more consistent with their procedures. --- src/shared/bap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index f2d2ca09bb24..ac17eea13556 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1377,10 +1377,14 @@ static void stream_set_state_broadcast(struct bt_bap_stream *stream, case BT_ASCS_ASE_STATE_IDLE: bap_stream_detach(stream); break; - case BT_ASCS_ASE_STATE_RELEASING: + case BT_ASCS_ASE_STATE_DISABLING: bap_stream_io_detach(stream); stream_set_state_broadcast(stream, BT_BAP_STREAM_STATE_QOS); break; + case BT_ASCS_ASE_STATE_RELEASING: + bap_stream_io_detach(stream); + stream_set_state_broadcast(stream, BT_BAP_STREAM_STATE_IDLE); + break; } bt_bap_unref(bap); @@ -5064,7 +5068,7 @@ unsigned int bt_bap_stream_disable(struct bt_bap_stream *stream, case BT_BAP_STREAM_TYPE_BCAST: stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_RELEASING); + BT_BAP_STREAM_STATE_DISABLING); return 1; } @@ -5161,11 +5165,8 @@ unsigned int bt_bap_stream_release(struct bt_bap_stream *stream, /* If stream is broadcast, no BT_ASCS_RELEASE is required */ if (bt_bap_stream_get_type(stream) == BT_BAP_STREAM_TYPE_BCAST) { - if (!bap_stream_valid(stream)) { - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_IDLE); - stream = NULL; - } + stream_set_state_broadcast(stream, + BT_BAP_STREAM_STATE_RELEASING); return 0; }