btdev: Fix not clearing le_pa_sync_handle on reset
Luiz Augusto von Dentz
maintainerPATCH 1/3 btdev: Fix not clearing le_pa_sync_handle on reset
From: Luiz Augusto von Dentz <[email protected]>
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(+)
emulator/btdev.c +1 -0
@@ -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);
Signature · 1 line
2.43.0
Luiz Augusto von Dentz
maintainerPATCH 2/3 device: Add btd_device_set_connectable
From: Luiz Augusto von Dentz <[email protected]>
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(+)
src/device.c +5 -0
@@ -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
src/device.h +1 -0
@@ -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,
Signature · 1 line
2.43.0
Luiz Augusto von Dentz
maintainerPATCH 3/3 bap: Mark device as connectable if a broadcast Endpoint is found
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
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(+)
profiles/audio/bap.c +6 -0
@@ -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)
Signature · 1 line
2.43.0
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
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Hello:
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:
Quoted 7 lines · On Thu, 25 Jan 2024 09:29:34 -0500 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
le_pa_sync_handleneeds 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html