mgmt-api: Add missing Device Flag
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH v3 1/5 mgmt-api: Add missing Device Flag
From: Luiz Augusto von Dentz <[email protected]>
This adds the missing Device Flag - Address Resolution = bit(2)
--- doc/mgmt-api.txt | 1 + 1 file changed, 1 insertion(+)
doc/mgmt-api.txt +1 -0
@@ -3429,6 +3429,7 @@ Get Device Flags Command 0 Remote Wakeup enabled 1 Device Privacy Mode enabled + 2 Address Resolution enabled This command generates a Command Complete event on success or a Command Status event on failure.
Signature · 1 line
2.48.1
Luiz Augusto von Dentz
maintainerPATCH v3 2/5 mgmt-api: Add LL Privacy setting
From: Luiz Augusto von Dentz <[email protected]>
This adds LL Privacy (bit 22) to Read Controller Information so it can be propagated to the likes of bluetoothd.
--- doc/mgmt-api.txt | 1 + 1 file changed, 1 insertion(+)
doc/mgmt-api.txt +1 -0
@@ -336,6 +336,7 @@ Read Controller Information Command 19 Connected Isochronous Stream - Peripheral 20 Isochronous Broadcaster 21 Synchronized Receiver + 22 LL Privacy This command generates a Command Complete event on success or a Command Status event on failure.
Signature · 1 line
2.48.1
Luiz Augusto von Dentz
maintainerPATCH v3 3/5 gatt-database: Fix always registering CentralAddressResolution
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
CentralAddressResolution shall be conditional to LL Privacy to avoid peripherals assuming Directed Advertising can be used which may lead to issues like:
--- lib/mgmt.h | 1 + src/gatt-database.c | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-)
lib/mgmt.h +1 -0
@@ -104,6 +104,7 @@ struct mgmt_rp_read_index_list {#define MGMT_SETTING_CIS_PERIPHERAL BIT(19)#define MGMT_SETTING_ISO_BROADCASTER BIT(20)#define MGMT_SETTING_ISO_SYNC_RECEIVER BIT(21) +#define MGMT_SETTING_LL_PRIVACY BIT(22)#define MGMT_OP_READ_INFO 0x0004struct mgmt_rp_read_info {
src/gatt-database.c +14 -7
@@ -749,7 +749,7 @@ static void gap_car_read_cb(struct gatt_db_attribute *attrib, device =btd_adapter_find_device_by_fd (bt_att_get_fd (att));if (device) value =btd_device_flags_enabled (device, -DEVICE_FLAG_ADDRESS_RESOLUTION ); +DEVICE_FLAG_ADDRESS_RESOLUTION ); }gatt_db_attribute_read_result (attrib, id,0 , &value,sizeof (value));
@@ -873,10 +873,13 @@ static void populate_gap_service(struct btd_gatt_database *database) {bt_uuid_t uuid;struct gatt_db_attribute *service, *attrib; +bool ll_privacy =btd_adapter_has_settings (database->adapter, +MGMT_SETTING_LL_PRIVACY );/* Add the GAP service */ bt_uuid16_create (&uuid,UUID_GAP ); - service =gatt_db_add_service (database->db, &uuid, true,7 ); + service =gatt_db_add_service (database->db, &uuid, true, + ll_privacy ?7 :5 );/* * Device Name characteristic.
@@ -898,15 +901,19 @@ static void populate_gap_service(struct btd_gatt_database *database) NULL, database);gatt_db_attribute_set_fixed_length (attrib,2 ); -/* -* Central Address Resolution characteristic. -*/ -bt_uuid16_create (&uuid,GATT_CHARAC_CAR ); - attrib =gatt_db_service_add_characteristic (service, &uuid, +/* Only enable Central Address Resolution if LL Privacy is supported */ +if (ll_privacy) { +/* +* Central Address Resolution characteristic. +*/ +bt_uuid16_create (&uuid,GATT_CHARAC_CAR ); + attrib =gatt_db_service_add_characteristic (service, &uuid,BT_ATT_PERM_READ ,BT_GATT_CHRC_PROP_READ , gap_car_read_cb,NULL , database); + } +gatt_db_attribute_set_fixed_length (attrib,1 );gatt_db_service_set_active (service, true);
Signature · 1 line
2.48.1
Luiz Augusto von Dentz
maintainerPATCH v3 4/5 mgmt-tester: Fix missing MGMT_SETTING_LL_PRIVACY
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This fixes the tests which now requires MGMT_SETTING_LL_PRIVACY (bit 22).
--- tools/mgmt-tester.c | 60 ++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 23 deletions(-)
tools/mgmt-tester.c +37 -23
@@ -1509,6 +1509,7 @@ static const char set_ssp_invalid_param[] = { 0x02 };static const char set_ssp_garbage_param[] = {0x01 ,0x00 };static const char set_ssp_settings_param_1[] = {0xc0 ,0x00 ,0x00 ,0x00 };static const char set_ssp_settings_param_2[] = {0xc1 ,0x00 ,0x00 ,0x00 }; +static const char set_ssp_settings_param_3[] = {0xc1 ,0x00 ,0x40 ,0x00 };static const char set_ssp_on_write_ssp_mode_param[] = {0x01 };static const struct generic_data set_ssp_on_success_test_1 = {
@@ -6077,8 +6078,8 @@ static const struct generic_data set_dev_id_power_off_on = { .send_param = set_powered_on_param, .send_len = sizeof(set_powered_on_param), .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_ssp_settings_param_2, - .expect_len = sizeof(set_ssp_settings_param_2), + .expect_param = set_ssp_settings_param_3, + .expect_len = sizeof(set_ssp_settings_param_3), .expect_settings_set = MGMT_SETTING_POWERED, .expect_hci_command = BT_HCI_CMD_WRITE_EXT_INQUIRY_RESPONSE, .expect_hci_param = write_eir_set_dev_id_success_1,
@@ -6094,8 +6095,8 @@ static const struct generic_data set_dev_id_ssp_off_on = { .send_param = set_ssp_on_param, .send_len = sizeof(set_ssp_on_param), .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_ssp_settings_param_2, - .expect_len = sizeof(set_ssp_settings_param_2), + .expect_param = set_ssp_settings_param_3, + .expect_len = sizeof(set_ssp_settings_param_3), .expect_hci_command = BT_HCI_CMD_WRITE_EXT_INQUIRY_RESPONSE, .expect_hci_param = write_eir_set_dev_id_success_1, .expect_hci_len = sizeof(write_eir_set_dev_id_success_1),
@@ -8214,13 +8215,17 @@ static const uint8_t set_ext_adv_data_test1[] = { 0x74, 0x65, 0x73, 0x74, 0x31, /* "test1" */ }; +static const char set_powered_ext_adv_instance_settings_param[] = { +0x81 ,0x02 ,0x40 ,0x00 , +}; +static const struct generic_data add_ext_advertising_success_pwron_data = { .send_opcode =MGMT_OP_SET_POWERED , .send_param = set_powered_on_param, .send_len =sizeof (set_powered_on_param), .expect_status =MGMT_STATUS_SUCCESS , - .expect_param = set_powered_adv_instance_settings_param, - .expect_len =sizeof (set_powered_adv_instance_settings_param), + .expect_param = set_powered_ext_adv_instance_settings_param, + .expect_len =sizeof (set_powered_ext_adv_instance_settings_param), .expect_hci_command =BT_HCI_CMD_LE_SET_EXT_ADV_DATA , .expect_hci_param = set_ext_adv_data_test1, .expect_hci_len =sizeof (set_ext_adv_data_test1),
@@ -8239,7 +8244,7 @@ static const struct generic_data add_ext_advertising_success_pwron_enabled = { .send_param = set_powered_on_param, .send_len = sizeof(set_powered_on_param), .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_powered_adv_instance_settings_param, + .expect_param = set_powered_ext_adv_instance_settings_param, .expect_len = sizeof(set_powered_adv_instance_settings_param), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE, .expect_hci_param = set_ext_adv_on_set_adv_enable_param,
@@ -8256,13 +8261,15 @@ static const uint8_t set_ext_adv_data_txpwr[] = { 0x00, /* tx power */ }; +static const char set_ext_adv_settings_param[] = {0x81 ,0x06 ,0x40 ,0x00 }; +static const struct generic_data add_ext_advertising_success_4 = { .send_opcode =MGMT_OP_SET_ADVERTISING , .send_param = set_adv_on_param, .send_len =sizeof (set_adv_on_param), .expect_status =MGMT_STATUS_SUCCESS , - .expect_param = set_adv_settings_param_2, - .expect_len =sizeof (set_adv_settings_param_2), + .expect_param = set_ext_adv_settings_param, + .expect_len =sizeof (set_ext_adv_settings_param), .expect_hci_command =BT_HCI_CMD_LE_SET_EXT_ADV_DATA , .expect_hci_param = set_ext_adv_data_txpwr, .expect_hci_len =sizeof (set_ext_adv_data_txpwr),
@@ -8273,8 +8280,8 @@ static const struct generic_data add_ext_advertising_success_5 = { .send_param = set_adv_off_param, .send_len = sizeof(set_adv_off_param), .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_powered_adv_instance_settings_param, - .expect_len = sizeof(set_powered_adv_instance_settings_param), + .expect_param = set_powered_ext_adv_instance_settings_param, + .expect_len = sizeof(set_powered_ext_adv_instance_settings_param), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_DATA, .expect_hci_param = set_ext_adv_data_test1, .expect_hci_len = sizeof(set_ext_adv_data_test1),
@@ -8545,13 +8552,16 @@ static uint8_t preset_connectable_on_ext_adv_param[] = { 0x00, /* Scan req notification */ }; +static const char set_connectable_settings_param_4[] = { +0x83 ,0x02 ,0x40 ,0x00 }; +static const struct generic_data add_ext_advertising_success_16 = { .send_opcode =MGMT_OP_SET_CONNECTABLE , .send_param = set_connectable_on_param, .send_len =sizeof (set_connectable_on_param), .expect_status =MGMT_STATUS_SUCCESS , - .expect_param = set_connectable_settings_param_3, - .expect_len =sizeof (set_connectable_settings_param_3), + .expect_param = set_connectable_settings_param_4, + .expect_len =sizeof (set_connectable_settings_param_4), .expect_hci_command =BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS , .expect_hci_param = preset_connectable_on_ext_adv_param, .expect_hci_len =sizeof (preset_connectable_on_ext_adv_param),
@@ -8575,25 +8585,29 @@ static uint8_t preset_connectable_off_ext_adv_param[] = { 0x00, /* Scan req notification */ }; +static const char set_le_settings_param_3[] = {0x81 ,0x02 ,0x40 ,0x00 }; +static const struct generic_data add_ext_advertising_success_17 = { .send_opcode =MGMT_OP_SET_CONNECTABLE , .send_param = set_connectable_off_param, .send_len =sizeof (set_connectable_off_param), .expect_status =MGMT_STATUS_SUCCESS , - .expect_param = set_le_settings_param_2, - .expect_len =sizeof (set_le_settings_param_2), + .expect_param = set_le_settings_param_3, + .expect_len =sizeof (set_le_settings_param_3), .expect_hci_command =BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS , .expect_hci_param = preset_connectable_off_ext_adv_param, .expect_hci_len =sizeof (preset_connectable_off_ext_adv_param), }; +static const char set_le_settings_param_off_1[] = {0x81 ,0x00 ,0x40 ,0x00 }; +static const struct generic_data add_ext_advertising_le_off = { .send_opcode =MGMT_OP_SET_LE , .send_param = set_le_off_param, .send_len =sizeof (set_le_off_param), .expect_status =MGMT_STATUS_SUCCESS , - .expect_param = set_le_settings_param_off, - .expect_len =sizeof (set_le_settings_param_off), + .expect_param = set_le_settings_param_off_1, + .expect_len =sizeof (set_le_settings_param_off_1), .expect_alt_ev =MGMT_EV_ADVERTISING_REMOVED , .expect_alt_ev_param = advertising_instance1_param, .expect_alt_ev_len =sizeof (advertising_instance1_param),
@@ -8875,8 +8889,8 @@ static const struct generic_data multi_ext_advertising_add_no_power = { .send_param = set_powered_on_param, .send_len = sizeof(set_powered_on_param), .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_powered_adv_instance_settings_param, - .expect_len = sizeof(set_powered_adv_instance_settings_param), + .expect_param = set_powered_ext_adv_instance_settings_param, + .expect_len = sizeof(set_powered_ext_adv_instance_settings_param), .expect_hci_list = multi_ext_adv_add_2_advs_hci_cmds, };
@@ -9403,8 +9417,8 @@ static const struct generic_data add_ext_advertising_conn_on_1m = { .send_param = set_connectable_on_param, .send_len = sizeof(set_connectable_on_param), .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_connectable_settings_param_3, - .expect_len = sizeof(set_connectable_settings_param_3), + .expect_param = set_connectable_settings_param_4, + .expect_len = sizeof(set_connectable_settings_param_4), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS, .expect_hci_param = preset_connectable_on_ext_pdu_adv_param, .expect_hci_len = sizeof(preset_connectable_on_ext_pdu_adv_param),
@@ -9463,8 +9477,8 @@ static const struct generic_data add_ext_advertising_conn_off_1m = { .send_param = set_connectable_off_param, .send_len = sizeof(set_connectable_off_param), .expect_status = MGMT_STATUS_SUCCESS, - .expect_param = set_le_settings_param_2, - .expect_len = sizeof(set_le_settings_param_2), + .expect_param = set_le_settings_param_3, + .expect_len = sizeof(set_le_settings_param_3), .expect_hci_command = BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS, .expect_hci_param = preset_connectable_off_ext_1m_adv_param, .expect_hci_len = sizeof(preset_connectable_off_ext_1m_adv_param),
Signature · 1 line
2.48.1
Luiz Augusto von Dentz
maintainerPATCH v3 5/5 monitor: Add decoding of MGMT LL Privacy setting
In reply to Luiz Augusto von DentzFrom: Luiz Augusto von Dentz <[email protected]>
This adds decoding support of MGM LL Privacy setting (bit 22).
--- monitor/packet.c | 1 + 1 file changed, 1 insertion(+)
monitor/packet.c +1 -0
@@ -12999,6 +12999,7 @@ static const struct bitfield_data mgmt_settings_table[] = { { 19, "CIS Peripheral" }, { 20, "ISO Broadcaster" }, { 21, "Sync Receiver" }, + { 22, "LL Privacy" }, {} };
Signature · 1 line
2.48.1
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=946846
---Test result---
Test Summary:
CheckPatch PENDING 0.29 seconds GitLint PENDING 0.24 seconds BuildEll PASS 20.49 seconds BluezMake PASS 1452.10 seconds MakeCheck PASS 12.82 seconds MakeDistcheck PASS 158.05 seconds CheckValgrind PASS 216.19 seconds CheckSmatch WARNING 287.51 seconds bluezmakeextell PASS 98.28 seconds IncrementalBuild PENDING 0.31 seconds ScanBuild PASS 867.26 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:monitor/packet.c: note: in included file:monitor/display.h:82:26: warning: Variable length array is used.monitor/packet.c:1876:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3607:52: warning: array of flexible structuresmonitor/bt.h:3595:40: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
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 6 lines · On Mon, 24 Mar 2025 09:49:16 -0400 you wrote:
From: Luiz Augusto von Dentz <[email protected]>
This adds the missing Device Flag - Address Resolution = bit(2)
--- doc/mgmt-api.txt | 1 + 1 file changed, 1 insertion(+)
Here is the summary with links:
- [BlueZ,v3,1/5] mgmt-api: Add missing Device Flag
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=e45343a37bf8 - [BlueZ,v3,2/5] mgmt-api: Add LL Privacy setting https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=cf8b2f308e31 - [BlueZ,v3,3/5] gatt-database: Fix always registering CentralAddressResolution (no matching commit) - [BlueZ,v3,4/5] mgmt-tester: Fix missing MGMT_SETTING_LL_PRIVACY https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=122c9fcacfa9 - [BlueZ,v3,5/5] monitor: Add decoding of MGMT LL Privacy setting https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=912e2f54fd57
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html