linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/3] btdev: Fix not clearing le_pa_sync_handle on reset
@ 2024-01-25 14:29 Luiz Augusto von Dentz
  2024-01-25 14:29 ` [PATCH BlueZ v1 2/3] device: Add btd_device_set_connectable Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-01-25 14:29 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

le_pa_sync_handle needs to be clear on reset otherwise the coce won't
be able to handle Create PA Sync commands.
---
 emulator/btdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 65ad0a40cb43..da94f29d12aa 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -562,6 +562,7 @@ static void btdev_reset(struct btdev *btdev)
 	btdev->le_scan_enable		= 0x00;
 	btdev->le_adv_enable		= 0x00;
 	btdev->le_pa_enable		= 0x00;
+	btdev->le_pa_sync_handle	= 0x0000;
 
 	al_clear(btdev);
 	rl_clear(btdev);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH BlueZ v1 2/3] device: Add btd_device_set_connectable
  2024-01-25 14:29 [PATCH BlueZ v1 1/3] btdev: Fix not clearing le_pa_sync_handle on reset Luiz Augusto von Dentz
@ 2024-01-25 14:29 ` Luiz Augusto von Dentz
  2024-01-25 14:29 ` [PATCH BlueZ v1 3/3] bap: Mark device as connectable if a broadcast Endpoint is found Luiz Augusto von Dentz
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-01-25 14:29 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

In case of devices advertising BCAA, aka. Broadcast Source, it shall be
possible to connect to them using something LE Audio Broadcast
procedures so this introduces btd_device_set_connectable so driver can
inform the core when the device is connectable even when it is
advertising using GAP broadcaster role for example.
---
 src/device.c | 5 +++++
 src/device.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/src/device.c b/src/device.c
index 17bcfbc499aa..afd073c6c2a5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4495,6 +4495,11 @@ void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type,
 	set_temporary_timer(device, btd_opts.tmpto);
 }
 
+void btd_device_set_connectable(struct btd_device *device, bool connectable)
+{
+	device_update_last_seen(device, device->bdaddr_type, connectable);
+}
+
 /* It is possible that we have two device objects for the same device in
  * case it has first been discovered over BR/EDR and has a private
  * address when discovered over LE for the first time. In such a case we
diff --git a/src/device.h b/src/device.h
index 8bb38669d457..96f41d47971d 100644
--- a/src/device.h
+++ b/src/device.h
@@ -95,6 +95,7 @@ void device_set_paired(struct btd_device *dev, uint8_t bdaddr_type);
 void device_set_unpaired(struct btd_device *dev, uint8_t bdaddr_type);
 void btd_device_set_temporary(struct btd_device *device, bool temporary);
 void btd_device_set_trusted(struct btd_device *device, gboolean trusted);
+void btd_device_set_connectable(struct btd_device *device, bool connectable);
 void device_set_bonded(struct btd_device *device, uint8_t bdaddr_type);
 void device_set_legacy(struct btd_device *device, bool legacy);
 void device_set_rssi_with_delta(struct btd_device *device, int8_t rssi,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH BlueZ v1 3/3] bap: Mark device as connectable if a broadcast Endpoint is found
  2024-01-25 14:29 [PATCH BlueZ v1 1/3] btdev: Fix not clearing le_pa_sync_handle on reset Luiz Augusto von Dentz
  2024-01-25 14:29 ` [PATCH BlueZ v1 2/3] device: Add btd_device_set_connectable Luiz Augusto von Dentz
@ 2024-01-25 14:29 ` Luiz Augusto von Dentz
  2024-01-25 15:55 ` [BlueZ,v1,1/3] btdev: Fix not clearing le_pa_sync_handle on reset bluez.test.bot
  2024-01-25 19:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-01-25 14:29 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If a broadcast Endpoint is found this uses btd_device_set_connectable to
make it as connectable since the Endpoint can be used to setup a
broadcast stream which requires the device object.
---
 profiles/audio/bap.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index a4036bbbdfa8..864761dfd919 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1378,6 +1378,7 @@ static bool pac_select(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 							void *user_data)
 {
+	struct bap_data *data = user_data;
 	struct bap_ep *ep;
 
 	DBG("lpac %p rpac %p", lpac, rpac);
@@ -1388,6 +1389,9 @@ static bool pac_found_bcast(struct bt_bap_pac *lpac, struct bt_bap_pac *rpac,
 		return true;
 	}
 
+	/* Mark the device as connetable if an Endpoint is registered */
+	btd_device_set_connectable(data->device, true);
+
 	return true;
 }
 
@@ -2456,6 +2460,8 @@ static void bap_bcast_remove(struct btd_service *service)
 		error("BAP service not handled by profile");
 		return;
 	}
+
+	bap_data_remove(data);
 }
 
 static int bap_probe(struct btd_service *service)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [BlueZ,v1,1/3] btdev: Fix not clearing le_pa_sync_handle on reset
  2024-01-25 14:29 [PATCH BlueZ v1 1/3] btdev: Fix not clearing le_pa_sync_handle on reset Luiz Augusto von Dentz
  2024-01-25 14:29 ` [PATCH BlueZ v1 2/3] device: Add btd_device_set_connectable Luiz Augusto von Dentz
  2024-01-25 14:29 ` [PATCH BlueZ v1 3/3] bap: Mark device as connectable if a broadcast Endpoint is found Luiz Augusto von Dentz
@ 2024-01-25 15:55 ` bluez.test.bot
  2024-01-25 19:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2024-01-25 15:55 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1956 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=819897

---Test result---

Test Summary:
CheckPatch                    PASS      0.93 seconds
GitLint                       PASS      0.67 seconds
BuildEll                      PASS      24.08 seconds
BluezMake                     PASS      724.48 seconds
MakeCheck                     PASS      11.50 seconds
MakeDistcheck                 PASS      160.61 seconds
CheckValgrind                 PASS      226.22 seconds
CheckSmatch                   WARNING   334.66 seconds
bluezmakeextell               PASS      112.05 seconds
IncrementalBuild              PASS      2072.65 seconds
ScanBuild                     WARNING   943.15 seconds

Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/btdev.c:420:29: warning: Variable length array is used.
##############################
Test: ScanBuild - WARNING
Desc: Run Scan Build
Output:
emulator/btdev.c:1084:10: warning: Although the value stored to 'conn' is used in the enclosing expression, the value is never actually read from 'conn'
        while ((conn = queue_find(dev->conns, match_handle,
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
emulator/btdev.c:1335:24: warning: Access to field 'link' results in a dereference of a null pointer (loaded from variable 'conn')
        pending_conn_del(dev, conn->link->dev);
                              ^~~~~~~~~~
emulator/btdev.c:1457:13: warning: Access to field 'dev' results in a dereference of a null pointer (loaded from variable 'conn')
        send_event(conn->dev, BT_HCI_EVT_AUTH_COMPLETE, &ev, sizeof(ev));
                   ^~~~~~~~~
3 warnings generated.



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH BlueZ v1 1/3] btdev: Fix not clearing le_pa_sync_handle on reset
  2024-01-25 14:29 [PATCH BlueZ v1 1/3] btdev: Fix not clearing le_pa_sync_handle on reset Luiz Augusto von Dentz
                   ` (2 preceding siblings ...)
  2024-01-25 15:55 ` [BlueZ,v1,1/3] btdev: Fix not clearing le_pa_sync_handle on reset bluez.test.bot
@ 2024-01-25 19:10 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2024-01-25 19:10 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Thu, 25 Jan 2024 09:29:34 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> le_pa_sync_handle needs to be clear on reset otherwise the coce won't
> be able to handle Create PA Sync commands.
> ---
>  emulator/btdev.c | 1 +
>  1 file changed, 1 insertion(+)

Here is the summary with links:
  - [BlueZ,v1,1/3] btdev: Fix not clearing le_pa_sync_handle on reset
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=460dd92431ea
  - [BlueZ,v1,2/3] device: Add btd_device_set_connectable
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7a1c6f31ed4f
  - [BlueZ,v1,3/3] bap: Mark device as connectable if a broadcast Endpoint is found
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=35858e173aad

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-25 19:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-25 14:29 [PATCH BlueZ v1 1/3] btdev: Fix not clearing le_pa_sync_handle on reset Luiz Augusto von Dentz
2024-01-25 14:29 ` [PATCH BlueZ v1 2/3] device: Add btd_device_set_connectable Luiz Augusto von Dentz
2024-01-25 14:29 ` [PATCH BlueZ v1 3/3] bap: Mark device as connectable if a broadcast Endpoint is found Luiz Augusto von Dentz
2024-01-25 15:55 ` [BlueZ,v1,1/3] btdev: Fix not clearing le_pa_sync_handle on reset bluez.test.bot
2024-01-25 19:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).