* [PATCH BlueZ v1 1/3] main.conf: Add LE.CentralAddressResolution option
@ 2024-11-25 20:47 Luiz Augusto von Dentz
2024-11-25 20:47 ` [PATCH BlueZ v1 2/3] monitor: Add support for Address Resoluton flag Luiz Augusto von Dentz
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-11-25 20:47 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds CentralAddressResolution option to LE group which controls the
GATT attribute of the same name using the new MGMT Device Flag with the
fallback to LL Privacy experimental UUID.
Fixes: https://github.com/bluez/bluez/issues/1028
---
lib/mgmt.h | 1 +
src/adapter.c | 6 ++++++
src/btd.h | 2 ++
src/device.c | 23 ++++++++++++++++++++++-
src/device.h | 2 ++
src/gatt-database.c | 12 +++++++++++-
src/main.c | 23 +++++++++++++++++++++--
src/main.conf | 6 ++++++
8 files changed, 71 insertions(+), 4 deletions(-)
diff --git a/lib/mgmt.h b/lib/mgmt.h
index f784dcada191..6a397645bcf2 100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -678,6 +678,7 @@ struct mgmt_rp_get_device_flags {
#define DEVICE_FLAG_REMOTE_WAKEUP BIT(0)
#define DEVICE_FLAG_DEVICE_PRIVACY BIT(1)
+#define DEVICE_FLAG_ADDRESS_RESOLUTION BIT(2)
#define MGMT_OP_SET_DEVICE_FLAGS 0x0050
#define MGMT_SET_DEVICE_FLAGS_SIZE 11
diff --git a/src/adapter.c b/src/adapter.c
index f422bbaae155..5d4117a49cfd 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -5701,6 +5701,12 @@ void adapter_set_device_flags(struct btd_adapter *adapter,
if (btd_opts.device_privacy && !(flags & DEVICE_FLAG_DEVICE_PRIVACY))
flags |= DEVICE_FLAG_DEVICE_PRIVACY & supported & ~pending;
+ /* Set Address Resolution if it has not been set the flag yet. */
+ if (btd_opts.defaults.le.addr_resolution &&
+ device_address_is_private(device) &&
+ !(flags & DEVICE_FLAG_ADDRESS_RESOLUTION))
+ flags |= DEVICE_FLAG_ADDRESS_RESOLUTION & supported & ~pending;
+
bdaddr = device_get_address(device);
bdaddr_type = btd_device_get_bdaddr_type(device);
diff --git a/src/btd.h b/src/btd.h
index 07205aa69486..6af44e3e4857 100644
--- a/src/btd.h
+++ b/src/btd.h
@@ -59,6 +59,8 @@ struct btd_br_defaults {
};
struct btd_le_defaults {
+ uint8_t addr_resolution;
+
uint16_t min_adv_interval;
uint16_t max_adv_interval;
uint16_t adv_rotation_interval;
diff --git a/src/device.c b/src/device.c
index 2b3d19f552fa..2d3ac71f6878 100644
--- a/src/device.c
+++ b/src/device.c
@@ -548,7 +548,7 @@ static gboolean store_device_info_cb(gpointer user_data)
return FALSE;
}
-static bool device_address_is_private(struct btd_device *dev)
+bool device_address_is_private(struct btd_device *dev)
{
if (dev->bdaddr_type != BDADDR_LE_RANDOM)
return false;
@@ -7338,6 +7338,27 @@ void btd_device_set_pnpid(struct btd_device *device, uint16_t source,
store_device_info(device);
}
+bool btd_device_flags_enabled(struct btd_device *dev, uint32_t flags)
+{
+ const char *ll_privacy = "15c0a148-c273-11ea-b3de-0242ac130004";
+
+ if (!dev)
+ return false;
+
+ if (dev->current_flags & flags)
+ return true;
+
+ /* For backward compatibility check for LL Privacy experimental UUID
+ * since that shall be equivalent to DEVICE_FLAG_ADDRESS_RESOLUTION on
+ * older kernels.
+ */
+ if ((flags & DEVICE_FLAG_ADDRESS_RESOLUTION) &&
+ btd_kernel_experimental_enabled(ll_privacy))
+ return true;
+
+ return false;
+}
+
uint32_t btd_device_get_current_flags(struct btd_device *dev)
{
return dev->current_flags;
diff --git a/src/device.h b/src/device.h
index 97536774ed5f..2e4a9771d585 100644
--- a/src/device.h
+++ b/src/device.h
@@ -28,6 +28,7 @@ bool device_name_known(struct btd_device *device);
bool device_is_name_resolve_allowed(struct btd_device *device);
void device_name_resolve_fail(struct btd_device *device);
void device_set_class(struct btd_device *device, uint32_t class);
+bool device_address_is_private(struct btd_device *dev);
void device_set_rpa(struct btd_device *device, bool value);
void device_update_addr(struct btd_device *device, const bdaddr_t *bdaddr,
uint8_t bdaddr_type);
@@ -189,6 +190,7 @@ struct btd_service *btd_device_get_service(struct btd_device *dev,
int device_discover_services(struct btd_device *device);
int btd_device_connect_services(struct btd_device *dev, GSList *services);
+bool btd_device_flags_enabled(struct btd_device *dev, uint32_t flags);
uint32_t btd_device_get_current_flags(struct btd_device *dev);
uint32_t btd_device_get_supported_flags(struct btd_device *dev);
uint32_t btd_device_get_pending_flags(struct btd_device *dev);
diff --git a/src/gatt-database.c b/src/gatt-database.c
index a86e528fd0e2..a5a01add40f7 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -22,6 +22,7 @@
#include "lib/sdp.h"
#include "lib/sdp_lib.h"
#include "lib/uuid.h"
+#include "lib/mgmt.h"
#include "btio/btio.h"
#include "gdbus/gdbus.h"
#include "src/shared/util.h"
@@ -738,10 +739,19 @@ static void gap_car_read_cb(struct gatt_db_attribute *attrib,
uint8_t opcode, struct bt_att *att,
void *user_data)
{
- uint8_t value = 0x01;
+ uint8_t value = 0x00;
DBG("GAP Central Address Resolution read request\n");
+ if (btd_opts.defaults.le.addr_resolution) {
+ struct btd_device *device;
+
+ device = btd_adapter_find_device_by_fd(bt_att_get_fd(att));
+ if (device)
+ value = btd_device_flags_enabled(device,
+ DEVICE_FLAG_ADDRESS_RESOLUTION);
+ }
+
gatt_db_attribute_read_result(attrib, id, 0, &value, sizeof(value));
}
diff --git a/src/main.c b/src/main.c
index 41c3271a7457..794a51dbf586 100644
--- a/src/main.c
+++ b/src/main.c
@@ -109,6 +109,7 @@ static const char *br_options[] = {
};
static const char *le_options[] = {
+ "CentralAddressResolution",
"MinAdvertisementInterval",
"MaxAdvertisementInterval",
"MultiAdvertisementRotationInterval",
@@ -581,6 +582,11 @@ static void parse_br_config(GKeyFile *config)
static void parse_le_config(GKeyFile *config)
{
static const struct config_param params[] = {
+ { "CentralAddressResolution",
+ &btd_opts.defaults.le.addr_resolution,
+ sizeof(btd_opts.defaults.le.addr_resolution),
+ 0,
+ 1},
{ "MinAdvertisementInterval",
&btd_opts.defaults.le.min_adv_interval,
sizeof(btd_opts.defaults.le.min_adv_interval),
@@ -708,9 +714,21 @@ static bool match_experimental(const void *data, const void *match_data)
bool btd_kernel_experimental_enabled(const char *uuid)
{
if (!btd_opts.kernel)
- false;
+ goto done;
- return queue_find(btd_opts.kernel, match_experimental, uuid);
+ if (queue_find(btd_opts.kernel, match_experimental, uuid))
+ return true;
+
+done:
+ /* For backward compatibility set LL Privacy as enabled if
+ * CentralAddressResolution has been set so old kernel LL Privacy is
+ * enabled.
+ */
+ if (!strcmp(uuid, "15c0a148-c273-11ea-b3de-0242ac130004") &&
+ btd_opts.defaults.le.addr_resolution)
+ return true;
+
+ return false;
}
static const char *valid_uuids[] = {
@@ -1205,6 +1223,7 @@ static void init_defaults(void)
btd_opts.defaults.num_entries = 0;
btd_opts.defaults.br.page_scan_type = 0xFFFF;
btd_opts.defaults.br.scan_type = 0xFFFF;
+ btd_opts.defaults.le.addr_resolution = 0x01;
btd_opts.defaults.le.enable_advmon_interleave_scan = 0xFF;
if (sscanf(VERSION, "%hhu.%hhu", &major, &minor) != 2)
diff --git a/src/main.conf b/src/main.conf
index fff13ed2ff31..ca45c6ed0e25 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -178,6 +178,12 @@
#MaxSniffInterval=
[LE]
+# Enable/Disable Central Address Resolution.
+# 0: disable
+# 1: enable
+# Defaults to 1
+#CentralAddressResolution = 1
+
# The following values are used to load default adapter parameters for LE.
# BlueZ loads the values into the kernel before the adapter is powered if the
# kernel supports the MGMT_LOAD_DEFAULT_PARAMETERS command. If a value isn't
--
2.47.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH BlueZ v1 2/3] monitor: Add support for Address Resoluton flag
2024-11-25 20:47 [PATCH BlueZ v1 1/3] main.conf: Add LE.CentralAddressResolution option Luiz Augusto von Dentz
@ 2024-11-25 20:47 ` Luiz Augusto von Dentz
2024-11-25 20:47 ` [PATCH BlueZ v1 3/3] mgmt-tester: Fix LL Privacy tests Luiz Augusto von Dentz
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-11-25 20:47 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds proper decoding for Address Resolution flag.
---
monitor/packet.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/monitor/packet.c b/monitor/packet.c
index f1a42925a8fc..06eff64dcd84 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -14418,6 +14418,7 @@ static void mgmt_set_exp_feature_rsp(const void *data, uint16_t size)
static const struct bitfield_data mgmt_added_device_flags_table[] = {
{ 0, "Remote Wakeup" },
{ 1, "Device Privacy Mode" },
+ { 2, "Address Resolution" },
{ }
};
--
2.47.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH BlueZ v1 3/3] mgmt-tester: Fix LL Privacy tests
2024-11-25 20:47 [PATCH BlueZ v1 1/3] main.conf: Add LE.CentralAddressResolution option Luiz Augusto von Dentz
2024-11-25 20:47 ` [PATCH BlueZ v1 2/3] monitor: Add support for Address Resoluton flag Luiz Augusto von Dentz
@ 2024-11-25 20:47 ` Luiz Augusto von Dentz
2024-11-25 22:10 ` [BlueZ,v1,1/3] main.conf: Add LE.CentralAddressResolution option bluez.test.bot
2024-12-12 21:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: Luiz Augusto von Dentz @ 2024-11-25 20:47 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Now that LL Privacy is triggered via Set Device Flags tests that used
the Set Experimental features needs to be fixed so they work as
intended.
---
tools/mgmt-tester.c | 655 +++++++++++++++++++++++++++-----------------
1 file changed, 406 insertions(+), 249 deletions(-)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 1d5c82ae0745..ebb158d1f15a 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -9826,8 +9826,8 @@ static const uint8_t get_dev_flags_param[] = {
static const uint8_t get_dev_flags_rsp_param[] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* Address */
0x00, /* Type */
- 0x01, 0x00, 0x00, 0x00, /* Supported Flages */
- 0x00, 0x00, 0x00, 0x00, /* Current Flages */
+ 0x07, 0x00, 0x00, 0x00, /* Supported Flags */
+ 0x00, 0x00, 0x00, 0x00, /* Current Flags */
};
static const struct generic_data get_dev_flags_success = {
@@ -9878,7 +9878,7 @@ static void setup_get_dev_flags(const void *test_data)
static const uint8_t set_dev_flags_param[] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* Address */
0x00, /* Type */
- 0x01, 0x00, 0x00, 0x00, /* Current Flages */
+ 0x01, 0x00, 0x00, 0x00, /* Current Flags */
};
static const uint8_t set_dev_flags_rsp_param[] = {
@@ -9889,8 +9889,8 @@ static const uint8_t set_dev_flags_rsp_param[] = {
static const uint8_t dev_flags_changed_param[] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* Address */
0x00, /* Type */
- 0x01, 0x00, 0x00, 0x00, /* Supported Flages */
- 0x01, 0x00, 0x00, 0x00, /* Current Flages */
+ 0x07, 0x00, 0x00, 0x00, /* Supported Flags */
+ 0x01, 0x00, 0x00, 0x00, /* Current Flags */
};
static const struct generic_data set_dev_flags_success = {
@@ -9920,7 +9920,7 @@ static const struct generic_data set_dev_flags_fail_1 = {
static const uint8_t set_dev_flags_param_fail_2[] = {
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* Address */
0x00, /* Type */
- 0x03, 0x00, 0x00, 0x00, /* Current Flages */
+ 0xff, 0x00, 0x00, 0x00, /* Current Flags */
};
static const struct generic_data set_dev_flags_fail_2 = {
@@ -9935,7 +9935,7 @@ static const struct generic_data set_dev_flags_fail_2 = {
static const uint8_t set_dev_flags_param_fail_3[] = {
0x11, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* Address */
0x00, /* Type */
- 0x01, 0x00, 0x00, 0x00, /* Current Flages */
+ 0x01, 0x00, 0x00, 0x00, /* Current Flags */
};
static const uint8_t set_dev_flags_rsp_param_fail_3[] = {
@@ -9953,15 +9953,11 @@ static const struct generic_data set_dev_flags_fail_3 = {
};
static const uint8_t read_exp_feat_param_success[] = {
- 0x05, 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,
0x00, 0x00, 0x00, 0x00, /* Flags */
- 0x04, 0x00, 0x13, 0xac, 0x42, 0x02, /* UUID - LL Privacy */
- 0xde, 0xb3, 0xea, 0x11, 0x73, 0xc2,
- 0x48, 0xa1, 0xc0, 0x15,
- 0x02, 0x00, 0x00, 0x00, /* Flags */
0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */
0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee,
0xce, 0x5a, 0x69, 0xa6,
@@ -10004,24 +10000,6 @@ static const struct generic_data read_exp_feat_success_index_none = {
.expect_len = sizeof(read_exp_feat_param_success_index_none),
};
-static uint16_t settings_powered_le_privacy[] = { MGMT_OP_SET_LE,
- MGMT_OP_SET_PRIVACY,
- MGMT_OP_SET_POWERED, 0 };
-
-static const uint8_t set_exp_feat_param_ll_privacy[] = {
- 0x04, 0x00, 0x13, 0xac, 0x42, 0x02, /* UUID - LL Privacy */
- 0xde, 0xb3, 0xea, 0x11, 0x73, 0xc2,
- 0x48, 0xa1, 0xc0, 0x15,
- 0x01, /* Action - enable */
-};
-
-static const uint8_t set_exp_feat_rsp_param_ll_privacy[] = {
- 0x04, 0x00, 0x13, 0xac, 0x42, 0x02, /* UUID - LL Privacy */
- 0xde, 0xb3, 0xea, 0x11, 0x73, 0xc2,
- 0x48, 0xa1, 0xc0, 0x15,
- 0x03, 0x00, 0x00, 0x00, /* Action - enable */
-};
-
static const uint8_t set_exp_feat_param_offload_codec[] = {
0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */
0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee,
@@ -10036,17 +10014,6 @@ static const uint8_t set_exp_feat_rsp_param_offload_codec[] = {
0x01, 0x00, 0x00, 0x00, /* Action - enable */
};
-static const struct generic_data set_exp_feat_enable_ll_privacy = {
- .send_opcode = MGMT_OP_SET_EXP_FEATURE,
- .send_param = set_exp_feat_param_ll_privacy,
- .send_len = sizeof(set_exp_feat_param_ll_privacy),
- .expect_status = MGMT_STATUS_SUCCESS,
- .expect_param = set_exp_feat_rsp_param_ll_privacy,
- .expect_len = sizeof(set_exp_feat_rsp_param_ll_privacy),
- .expect_alt_ev = MGMT_EV_EXP_FEATURE_CHANGE,
- .expect_alt_ev_len = sizeof(struct mgmt_ev_exp_feature_changed),
-};
-
static void read_exp_feature_callback(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
@@ -10095,18 +10062,10 @@ static const struct generic_data set_exp_feat_disable = {
.expect_len = sizeof(set_exp_feat_rsp_param_disable),
};
-static const struct generic_data set_exp_feat_rejected = {
- .setup_settings = settings_powered_le_privacy,
- .send_opcode = MGMT_OP_SET_EXP_FEATURE,
- .send_param = set_exp_feat_param_ll_privacy,
- .send_len = sizeof(set_exp_feat_param_ll_privacy),
- .expect_status = MGMT_STATUS_REJECTED,
-};
-
static const uint8_t set_exp_feat_param_invalid[] = {
- 0x04, 0x00, 0x13, 0xac, 0x42, 0x02, /* UUID - LL Privacy */
- 0xde, 0xb3, 0xea, 0x11, 0x73, 0xc2,
- 0x48, 0xa1, 0xc0, 0x15,
+ 0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */
+ 0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee,
+ 0xce, 0x5a, 0x69, 0xa6,
0xff, /* Action - invalid */
};
@@ -10177,11 +10136,6 @@ static const uint8_t add_device_le_public_param_4[] = {
0x00, /* Action - Background scan */
};
-static const uint8_t add_device_rsp_le_public_4[] = {
- 0x44, 0x44, 0x44, 0x44, 0x55, 0x66, /* BDADDR */
- 0x01, /* Type - LE Public */
-};
-
static const char load_irks_2_devices_param[] = {
0x02, 0x00, /* Key Count */
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* Key 1 - BDADDR */
@@ -10292,21 +10246,40 @@ static const struct generic_data ll_privacy_add_device_1 = {
};
static uint16_t settings_le_privacy_ll_privacy[] = { MGMT_OP_SET_LE,
- MGMT_OP_SET_PRIVACY,
- MGMT_OP_SET_EXP_FEATURE, 0 };
+ MGMT_OP_SET_PRIVACY, 0 };
-static const struct generic_data ll_privacy_add_device_2 = {
+static const uint8_t set_device_flags_param_1[] = {
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* BDADDR */
+ 0x01, /* Type - LE Public */
+ 0x06, 0x00, 0x00, 0x00 /* Flags -
+ * Device Privacy
+ * Address Resolution
+ */
+};
+
+static const uint8_t set_device_flags_rsp[] = {
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* BDADDR */
+ 0x01 /* Type - LE Public */
+};
+
+static const uint8_t device_flags_changed_params_1[] = {
+ 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* BDADDR */
+ 0x01, /* Type - LE Public */
+ 0x07, 0x00, 0x00, 0x00, /* Supported Flags */
+ 0x06, 0x00, 0x00, 0x00 /* Current Flags */
+};
+
+static const struct generic_data ll_privacy_set_flags_1 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
- .send_opcode = MGMT_OP_ADD_DEVICE,
- .send_param = add_device_le_public_param_1,
- .send_len = sizeof(add_device_le_public_param_1),
- .expect_param = add_device_rsp_le_public,
- .expect_len = sizeof(add_device_rsp_le_public),
+ .send_opcode = MGMT_OP_SET_DEVICE_FLAGS,
+ .send_param = set_device_flags_param_1,
+ .send_len = sizeof(set_device_flags_param_1),
+ .expect_param = set_device_flags_rsp,
+ .expect_len = sizeof(set_device_flags_rsp),
.expect_status = MGMT_STATUS_SUCCESS,
- .expect_alt_ev = MGMT_EV_DEVICE_ADDED,
- .expect_alt_ev_param = add_device_le_public_param_1,
- .expect_alt_ev_len = sizeof(add_device_le_public_param_1),
+ .expect_alt_ev = MGMT_EV_DEVICE_FLAGS_CHANGED,
+ .expect_alt_ev_param = device_flags_changed_params_1,
+ .expect_alt_ev_len = sizeof(device_flags_changed_params_1),
.expect_hci_command = BT_HCI_CMD_LE_ADD_TO_RESOLV_LIST,
.expect_hci_param = le_add_to_resolv_list_param,
.expect_hci_len = sizeof(le_add_to_resolv_list_param),
@@ -10323,11 +10296,6 @@ static const struct hci_cmd_data ll_privacy_add_device_3_hci_list[] = {
.param = le_add_to_resolv_list_param,
.len = sizeof(le_add_to_resolv_list_param),
},
- {
- .opcode = BT_HCI_CMD_LE_ADD_TO_ACCEPT_LIST,
- .param = le_add_to_accept_list_param,
- .len = sizeof(le_add_to_accept_list_param),
- },
{
.opcode = BT_HCI_CMD_LE_SET_RESOLV_ENABLE,
.param = set_resolv_on_param,
@@ -10336,24 +10304,22 @@ static const struct hci_cmd_data ll_privacy_add_device_3_hci_list[] = {
{},
};
-static const struct generic_data ll_privacy_add_device_3 = {
+static const struct generic_data ll_privacy_set_flags_2 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
- .send_opcode = MGMT_OP_ADD_DEVICE,
- .send_param = add_device_le_public_param_1,
- .send_len = sizeof(add_device_le_public_param_1),
- .expect_param = add_device_rsp_le,
- .expect_len = sizeof(add_device_rsp_le),
+ .send_opcode = MGMT_OP_SET_DEVICE_FLAGS,
+ .send_param = set_device_flags_param_1,
+ .send_len = sizeof(set_device_flags_param_1),
+ .expect_param = set_device_flags_rsp,
+ .expect_len = sizeof(set_device_flags_rsp),
.expect_status = MGMT_STATUS_SUCCESS,
- .expect_alt_ev = MGMT_EV_DEVICE_ADDED,
- .expect_alt_ev_param = add_device_le_public_param_1,
- .expect_alt_ev_len = sizeof(add_device_le_public_param_1),
+ .expect_alt_ev = MGMT_EV_DEVICE_FLAGS_CHANGED,
+ .expect_alt_ev_param = device_flags_changed_params_1,
+ .expect_alt_ev_len = sizeof(device_flags_changed_params_1),
.expect_hci_list = ll_privacy_add_device_3_hci_list,
};
-static const struct generic_data ll_privacy_add_device_4 = {
+static const struct generic_data ll_privacy_add_device_2 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_ADD_DEVICE,
.send_param = add_device_le_public_param_2,
.send_len = sizeof(add_device_le_public_param_2),
@@ -10368,43 +10334,82 @@ static const struct generic_data ll_privacy_add_device_4 = {
.expect_hci_len = sizeof(le_add_to_white_list_param_2),
};
-static const struct generic_data ll_privacy_add_device_5 = {
+static const uint8_t set_device_flags_param_2[] = {
+ 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, /* BDADDR */
+ 0x01, /* Type - LE Public */
+ 0x06, 0x00, 0x00, 0x00 /* Flags -
+ * Device Privacy
+ * Address Resolution
+ */
+};
+
+static const uint8_t device_flags_changed_params_2[] = {
+ 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, /* BDADDR */
+ 0x01, /* Type - LE Public */
+ 0x07, 0x00, 0x00, 0x00, /* Supported Flags */
+ 0x06, 0x00, 0x00, 0x00 /* Current Flags */
+};
+
+static const uint8_t set_device_flags_rsp_2[] = {
+ 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, /* BDADDR */
+ 0x01 /* Type - LE Public */
+};
+
+static const struct generic_data ll_privacy_set_flags_3 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
- .send_opcode = MGMT_OP_ADD_DEVICE,
- .send_param = add_device_le_public_param_2,
- .send_len = sizeof(add_device_le_public_param_2),
- .expect_param = add_device_rsp_le_public_2,
- .expect_len = sizeof(add_device_rsp_le_public_2),
+ .send_opcode = MGMT_OP_SET_DEVICE_FLAGS,
+ .send_param = set_device_flags_param_2,
+ .send_len = sizeof(set_device_flags_param_2),
+ .expect_param = set_device_flags_rsp_2,
+ .expect_len = sizeof(set_device_flags_rsp_2),
.expect_status = MGMT_STATUS_SUCCESS,
- .expect_alt_ev = MGMT_EV_DEVICE_ADDED,
- .expect_alt_ev_param = add_device_le_public_param_2,
- .expect_alt_ev_len = sizeof(add_device_le_public_param_2),
+ .expect_alt_ev = MGMT_EV_DEVICE_FLAGS_CHANGED,
+ .expect_alt_ev_param = device_flags_changed_params_2,
+ .expect_alt_ev_len = sizeof(device_flags_changed_params_2),
.expect_hci_command = BT_HCI_CMD_LE_ADD_TO_RESOLV_LIST,
.expect_hci_param = le_add_to_resolv_list_param_2,
.expect_hci_len = sizeof(le_add_to_resolv_list_param_2),
};
-static const struct generic_data ll_privacy_add_device_6 = {
+static const uint8_t set_device_flags_param_4[] = {
+ 0x44, 0x44, 0x44, 0x44, 0x55, 0x66, /* BDADDR */
+ 0x01, /* Type - LE Public */
+ 0x06, 0x00, 0x00, 0x00 /* Flags -
+ * Device Privacy
+ * Address Resolution
+ */
+};
+
+static const uint8_t device_flags_changed_params_4[] = {
+ 0x44, 0x44, 0x44, 0x44, 0x55, 0x66, /* BDADDR */
+ 0x01, /* Type - LE Public */
+ 0x07, 0x00, 0x00, 0x00, /* Supported Flags */
+ 0x06, 0x00, 0x00, 0x00 /* Current Flags */
+};
+
+static const uint8_t set_device_flags_rsp_4[] = {
+ 0x44, 0x44, 0x44, 0x44, 0x55, 0x66, /* BDADDR */
+ 0x01 /* Type - LE Public */
+};
+
+static const struct generic_data ll_privacy_set_flags_4 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
- .send_opcode = MGMT_OP_ADD_DEVICE,
- .send_param = add_device_le_public_param_4,
- .send_len = sizeof(add_device_le_public_param_4),
- .expect_param = add_device_rsp_le_public_4,
- .expect_len = sizeof(add_device_rsp_le_public_4),
+ .send_opcode = MGMT_OP_SET_DEVICE_FLAGS,
+ .send_param = set_device_flags_param_4,
+ .send_len = sizeof(set_device_flags_param_4),
+ .expect_param = set_device_flags_rsp_4,
+ .expect_len = sizeof(set_device_flags_rsp_4),
.expect_status = MGMT_STATUS_SUCCESS,
- .expect_alt_ev = MGMT_EV_DEVICE_ADDED,
- .expect_alt_ev_param = add_device_le_public_param_4,
- .expect_alt_ev_len = sizeof(add_device_le_public_param_4),
+ .expect_alt_ev = MGMT_EV_DEVICE_FLAGS_CHANGED,
+ .expect_alt_ev_param = device_flags_changed_params_4,
+ .expect_alt_ev_len = sizeof(device_flags_changed_params_4),
.expect_hci_command = BT_HCI_CMD_LE_ADD_TO_RESOLV_LIST,
.expect_hci_param = le_add_to_resolv_list_param_4,
.expect_hci_len = sizeof(le_add_to_resolv_list_param_4),
};
-static const struct generic_data ll_privacy_add_device_7 = {
+static const struct generic_data ll_privacy_add_device_3 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_ADD_DEVICE,
.send_param = add_device_le_public_param_3,
.send_len = sizeof(add_device_le_public_param_3),
@@ -10423,9 +10428,8 @@ static const char set_ext_adv_disable[] = {
0x00, 0x00,
};
-static const struct generic_data ll_privacy_add_device_8 = {
+static const struct generic_data ll_privacy_add_4 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_ADD_DEVICE,
.send_param = add_device_le_public_param_3,
.send_len = sizeof(add_device_le_public_param_3),
@@ -10440,7 +10444,7 @@ static const struct generic_data ll_privacy_add_device_8 = {
.expect_hci_len = sizeof(set_ext_adv_disable),
};
-static const struct hci_cmd_data ll_privacy_add_device_9_hci_list[] = {
+static const struct hci_cmd_data ll_privacy_set_flags_5_hci_list[] = {
{
.opcode = BT_HCI_CMD_LE_SET_EXT_ADV_ENABLE,
.len = sizeof(set_ext_adv_disable),
@@ -10454,24 +10458,22 @@ static const struct hci_cmd_data ll_privacy_add_device_9_hci_list[] = {
{},
};
-static const struct generic_data ll_privacy_add_device_9 = {
+static const struct generic_data ll_privacy_set_flags_5 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
- .send_opcode = MGMT_OP_ADD_DEVICE,
- .send_param = add_device_le_public_param_1,
- .send_len = sizeof(add_device_le_public_param_1),
- .expect_param = add_device_rsp_le_public,
- .expect_len = sizeof(add_device_rsp_le_public),
+ .send_opcode = MGMT_OP_SET_DEVICE_FLAGS,
+ .send_param = set_device_flags_param_1,
+ .send_len = sizeof(set_device_flags_param_1),
+ .expect_param = set_device_flags_rsp,
+ .expect_len = sizeof(set_device_flags_rsp),
.expect_status = MGMT_STATUS_SUCCESS,
- .expect_alt_ev = MGMT_EV_DEVICE_ADDED,
- .expect_alt_ev_param = add_device_le_public_param_1,
- .expect_alt_ev_len = sizeof(add_device_le_public_param_1),
- .expect_hci_list = ll_privacy_add_device_9_hci_list,
+ .expect_alt_ev = MGMT_EV_DEVICE_FLAGS_CHANGED,
+ .expect_alt_ev_param = device_flags_changed_params_1,
+ .expect_alt_ev_len = sizeof(device_flags_changed_params_1),
+ .expect_hci_list = ll_privacy_set_flags_5_hci_list,
};
static const struct generic_data ll_privacy_remove_device_1 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_REMOVE_DEVICE,
.send_param = remove_device_param_2,
.send_len = sizeof(remove_device_param_2),
@@ -10488,7 +10490,6 @@ static const struct generic_data ll_privacy_remove_device_1 = {
static const struct generic_data ll_privacy_remove_device_2 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_REMOVE_DEVICE,
.send_param = remove_device_param_2,
.send_len = sizeof(remove_device_param_2),
@@ -10505,7 +10506,6 @@ static const struct generic_data ll_privacy_remove_device_2 = {
static const struct generic_data ll_privacy_remove_device_3 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_REMOVE_DEVICE,
.send_param = remove_device_param_2,
.send_len = sizeof(remove_device_param_2),
@@ -10522,7 +10522,6 @@ static const struct generic_data ll_privacy_remove_device_3 = {
static const struct generic_data ll_privacy_remove_device_4 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_REMOVE_DEVICE,
.send_param = remove_device_param_2,
.send_len = sizeof(remove_device_param_2),
@@ -10539,7 +10538,6 @@ static const struct generic_data ll_privacy_remove_device_4 = {
static const struct generic_data ll_privacy_remove_device_5 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_REMOVE_DEVICE,
.send_param = remove_device_param_2,
.send_len = sizeof(remove_device_param_2),
@@ -10556,7 +10554,6 @@ static const struct generic_data ll_privacy_remove_device_5 = {
static const struct generic_data ll_privacy_start_discovery_ll_privacy_1 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.setup_expect_hci_command = BT_HCI_CMD_LE_SET_RESOLV_ENABLE,
.setup_expect_hci_param = set_resolv_on_param,
.setup_expect_hci_len = sizeof(set_resolv_on_param),
@@ -10573,7 +10570,6 @@ static const struct generic_data ll_privacy_start_discovery_ll_privacy_1 = {
static const struct generic_data ll_privacy_start_discovery_ll_privacy_2 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.setup_expect_hci_command = BT_HCI_CMD_LE_REMOVE_FROM_RESOLV_LIST,
.setup_expect_hci_param = le_add_to_accept_list_param,
.setup_expect_hci_len = sizeof(le_add_to_accept_list_param),
@@ -10593,7 +10589,6 @@ static const struct generic_data ll_privacy_start_discovery_ll_privacy_2 = {
static const struct generic_data ll_privacy_advertising_1 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_SET_ADVERTISING,
.send_param = set_adv_on_param2,
.send_len = sizeof(set_adv_on_param2),
@@ -10603,7 +10598,6 @@ static const struct generic_data ll_privacy_advertising_1 = {
static const struct generic_data ll_privacy_acceptor_1 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.io_cap = 0x04, /* KeyboardDisplay */
.client_io_cap = 0x04, /* KeyboardDisplay */
.client_auth_req = 0x05, /* Bonding - MITM */
@@ -10614,7 +10608,6 @@ static const struct generic_data ll_privacy_acceptor_1 = {
static const struct generic_data ll_privacy_acceptor_2 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.io_cap = 0x04, /* KeyboardDisplay */
.client_io_cap = 0x04, /* KeyboardDisplay */
.just_works = true,
@@ -10661,7 +10654,6 @@ static uint16_t settings_powered_le_sc_bondable_privacy_ll_privacy[] = {
static const struct generic_data ll_privacy_pair_1 = {
.setup_settings = settings_powered_le_sc_bondable_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_PAIR_DEVICE,
.send_func = pair_device_send_param_func,
.addr_type_avail = true,
@@ -10682,7 +10674,6 @@ static const struct generic_data ll_privacy_pair_1 = {
static const struct generic_data ll_privacy_pair_2 = {
.setup_settings = settings_powered_le_sc_bondable_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_PAIR_DEVICE,
.send_func = pair_device_send_param_func,
.addr_type_avail = true,
@@ -10706,7 +10697,6 @@ static const struct generic_data ll_privacy_pair_2 = {
static const struct generic_data ll_privacy_unpair_1 = {
.setup_settings = settings_powered_le_sc_bondable_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_PAIR_DEVICE,
.send_func = pair_device_send_param_func,
.addr_type_avail = true,
@@ -10726,7 +10716,6 @@ static const struct generic_data ll_privacy_unpair_1 = {
static const struct generic_data ll_privacy_unpair_2 = {
.setup_settings = settings_powered_le_sc_bondable_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_PAIR_DEVICE,
.send_func = pair_device_send_param_func,
.addr_type_avail = true,
@@ -10747,17 +10736,6 @@ static const struct generic_data ll_privacy_unpair_2 = {
.expect_hci_len = sizeof(add_to_al_client),
};
-static const uint8_t set_device_flags_param_1[] = {
- 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* BDADDR */
- 0x01, /* Type - LE Public */
- 0x02, 0x00, 0x00, 0x00 /* Flags - Device Privacy */
-};
-
-static const uint8_t set_device_flags_rsp[] = {
- 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* BDADDR */
- 0x01 /* Type - LE Public */
-};
-
static const uint8_t le_set_priv_mode_param[] = {
0x00, /* Type */
0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* BDADDR */
@@ -10783,16 +10761,8 @@ static const struct hci_cmd_data ll_privacy_set_device_flags_1_hci_list[] = {
{},
};
-static const uint8_t device_flags_changed_params_1[] = {
- 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, /* BDADDR */
- 0x01, /* Type - LE Public */
- 0x03, 0x00, 0x00, 0x00, /* Supported Flags */
- 0x02, 0x00, 0x00, 0x00 /* Current Flags */
-};
-
static const struct generic_data ll_privacy_set_device_flag_1 = {
.setup_settings = settings_le_privacy_ll_privacy,
- .setup_exp_feat_param = set_exp_feat_param_ll_privacy,
.send_opcode = MGMT_OP_SET_DEVICE_FLAGS,
.send_param = set_device_flags_param_1,
.send_len = sizeof(set_device_flags_param_1),
@@ -10885,7 +10855,7 @@ static void setup_add_adv_callback_adv(uint8_t status, uint16_t length,
NULL, NULL);
}
-static void setup_ll_privacy_with_irk1(const void *test_data)
+static void setup_ll_privacy_set_flags_1(const void *test_data)
{
struct test_data *data = tester_get_data();
unsigned char param[] = { 0x01 };
@@ -10895,13 +10865,30 @@ static void setup_ll_privacy_with_irk1(const void *test_data)
load_irks_le_public_param_1,
setup_load_irks_callback, NULL, NULL);
+ /* Set Powered On */
mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
sizeof(param), param,
setup_powered_callback, NULL, NULL);
+ /* Add Device 1 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
+ sizeof(add_device_le_public_param_1),
+ add_device_le_public_param_1,
+ setup_add_device_callback, NULL, NULL);
}
-static void setup_ll_privacy_dev1_and_irk2(const void *test_data)
+static void setup_set_device_flags_callback(uint8_t status, uint16_t length,
+ const void *param, void *user_data)
+{
+ if (status != MGMT_STATUS_SUCCESS) {
+ tester_setup_failed();
+ return;
+ }
+
+ tester_print("Device Flags are set");
+}
+
+static void setup_ll_privacy_add_2(const void *test_data)
{
struct test_data *data = tester_get_data();
unsigned char param[] = { 0x01 };
@@ -10912,17 +10899,69 @@ static void setup_ll_privacy_dev1_and_irk2(const void *test_data)
load_irks_2_devices_param,
setup_load_irks_callback, NULL, NULL);
+ /* Set Powered On */
+ mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
+ sizeof(param), param,
+ setup_powered_callback, NULL, NULL);
+
+ /* Add Device 1 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
+ sizeof(add_device_le_public_param_1),
+ add_device_le_public_param_1,
+ setup_add_device_callback, NULL, NULL);
+ /* Device 1 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_1),
+ set_device_flags_param_1,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+}
+
+static void setup_ll_privacy_set_flags_3(const void *test_data)
+{
+ struct test_data *data = tester_get_data();
+ unsigned char param[] = { 0x01 };
+
+ /* Add IRKs of Device1 and Device2 */
+ mgmt_send(data->mgmt, MGMT_OP_LOAD_IRKS, data->mgmt_index,
+ sizeof(load_irks_2_devices_param),
+ load_irks_2_devices_param,
+ setup_load_irks_callback, NULL, NULL);
+
+ /* Set Powered On */
+ mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
+ sizeof(param), param,
+ setup_powered_callback, NULL, NULL);
+
/* Add Device 1 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_1),
add_device_le_public_param_1,
setup_add_device_callback, NULL, NULL);
- mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
- sizeof(param), param,
- setup_powered_callback, NULL, NULL);
+ /* Device 1 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_1),
+ set_device_flags_param_1,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
+ /* Add Device 2 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
+ sizeof(add_device_le_public_param_2),
+ add_device_le_public_param_2,
+ setup_add_device_callback, NULL, NULL);
}
+static const uint8_t set_device_flags_param_3[] = {
+ 0x33, 0x33, 0x33, 0x44, 0x55, 0x66, /* BDADDR */
+ 0x01, /* Type - LE Public */
+ 0x06, 0x00, 0x00, 0x00 /* Flags -
+ * Device Privacy
+ * Address Resolution
+ */
+};
+
static void setup_ll_privacy_3_devices(const void *test_data)
{
struct test_data *data = tester_get_data();
@@ -10940,29 +10979,50 @@ static void setup_ll_privacy_3_devices(const void *test_data)
add_device_le_public_param_1,
setup_add_device_callback, NULL, NULL);
+ /* Device 1 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_1),
+ set_device_flags_param_1,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
/* Add Device 2 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_2),
add_device_le_public_param_2,
setup_add_device_callback, NULL, NULL);
+ /* Device 2 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_2),
+ set_device_flags_param_2,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
/* Add Device 3 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_3),
add_device_le_public_param_3,
setup_add_device_callback, NULL, NULL);
+ /* Device 3 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_3),
+ set_device_flags_param_3,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
sizeof(param), param,
setup_powered_callback, NULL, NULL);
}
-static void setup_ll_privacy_2_devices_extra_rl(const void *test_data)
+static void setup_ll_privacy_set_flags_4(const void *test_data)
{
struct test_data *data = tester_get_data();
unsigned char param[] = { 0x01 };
- hciemu_set_central_le_rl_len(data->hciemu, 2);
+ hciemu_set_central_le_rl_len(data->hciemu, 4);
/* Add IRKs of 4 Devices */
mgmt_send(data->mgmt, MGMT_OP_LOAD_IRKS, data->mgmt_index,
@@ -10976,18 +11036,51 @@ static void setup_ll_privacy_2_devices_extra_rl(const void *test_data)
add_device_le_public_param_1,
setup_add_device_callback, NULL, NULL);
+ /* Device 1 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_1),
+ set_device_flags_param_1,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
/* Add Device 2 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_2),
add_device_le_public_param_2,
setup_add_device_callback, NULL, NULL);
+ /* Device 2 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_2),
+ set_device_flags_param_2,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
+ /* Add Device 3 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
+ sizeof(add_device_le_public_param_3),
+ add_device_le_public_param_3,
+ setup_add_device_callback, NULL, NULL);
+
+ /* Device 3 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_3),
+ set_device_flags_param_3,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
+ /* Add Device 4 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
+ sizeof(add_device_le_public_param_4),
+ add_device_le_public_param_4,
+ setup_add_device_callback, NULL, NULL);
+
mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
sizeof(param), param,
setup_powered_callback, NULL, NULL);
}
-static void setup_ll_privacy_2_devices_extra_al(const void *test_data)
+static void setup_ll_privacy_add_3(const void *test_data)
{
struct test_data *data = tester_get_data();
unsigned char param[] = { 0x01 };
@@ -11000,21 +11093,36 @@ static void setup_ll_privacy_2_devices_extra_al(const void *test_data)
load_irks_3_devices_param,
setup_load_irks_callback, NULL, NULL);
+ /* Set Powered On */
+ mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
+ sizeof(param), param,
+ setup_powered_callback, NULL, NULL);
+
/* Add Device 1 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_1),
add_device_le_public_param_1,
setup_add_device_callback, NULL, NULL);
+ /* Device 1 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_1),
+ set_device_flags_param_1,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
/* Add Device 2 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_2),
add_device_le_public_param_2,
setup_add_device_callback, NULL, NULL);
- mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
- sizeof(param), param,
- setup_powered_callback, NULL, NULL);
+ /* Device 2 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_2),
+ set_device_flags_param_2,
+ setup_set_device_flags_callback, NULL,
+ NULL);
}
/* Enable LL Privacy and Add 2 devices */
@@ -11060,7 +11168,7 @@ static void setup_ll_privacy_device2_discovry(const void *test_data)
}
/* Enable LL Privacy and Add Advertising */
-static void setup_ll_privacy_adv(const void *test_data)
+static void setup_ll_privacy_add_4(const void *test_data)
{
struct test_data *data = tester_get_data();
struct mgmt_cp_add_advertising *cp;
@@ -11080,7 +11188,7 @@ static void setup_ll_privacy_adv(const void *test_data)
}
/* Enable LL Privacy and Add Advertising */
-static void setup_ll_privacy_2_advs(const void *test_data)
+static void setup_ll_privacy_set_flags_5(const void *test_data)
{
struct test_data *data = tester_get_data();
struct mgmt_cp_add_advertising *cp;
@@ -11090,21 +11198,30 @@ static void setup_ll_privacy_2_advs(const void *test_data)
cp = (struct mgmt_cp_add_advertising *) adv_param;
setup_add_adv_param(cp, 1);
+ /* Add IRKs of Device1 */
mgmt_send(data->mgmt, MGMT_OP_LOAD_IRKS, data->mgmt_index,
sizeof(load_irks_le_public_param_1),
load_irks_le_public_param_1,
setup_load_irks_callback, NULL, NULL);
+ /* Set Powered On */
mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
sizeof(param), param,
NULL, NULL, NULL);
+ /* Add Advertising Instance */
mgmt_send(data->mgmt, MGMT_OP_ADD_ADVERTISING, data->mgmt_index,
sizeof(adv_param), adv_param,
setup_add_adv_callback_adv, NULL, NULL);
+
+ /* Add Device 1 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
+ sizeof(add_device_le_public_param_1),
+ add_device_le_public_param_1,
+ setup_add_device_callback, NULL, NULL);
}
-static void setup_ll_privacy_dev_2_advs(const void *test_data)
+static void setup_ll_privacy_set_flags_6(const void *test_data)
{
struct test_data *data = tester_get_data();
struct mgmt_cp_add_advertising *cp;
@@ -11114,24 +11231,40 @@ static void setup_ll_privacy_dev_2_advs(const void *test_data)
cp = (struct mgmt_cp_add_advertising *) adv_param;
setup_add_adv_param(cp, 1);
+ /* Add IRKs of Device1 and Device2 */
mgmt_send(data->mgmt, MGMT_OP_LOAD_IRKS, data->mgmt_index,
- sizeof(load_irks_le_public_param_1),
- load_irks_le_public_param_1,
+ sizeof(load_irks_2_devices_param),
+ load_irks_2_devices_param,
setup_load_irks_callback, NULL, NULL);
+ /* Set Powered On */
mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
sizeof(param), param,
NULL, NULL, NULL);
+ /* Add Advertising Instance 1 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_ADVERTISING, data->mgmt_index,
+ sizeof(adv_param), adv_param,
+ setup_add_adv_callback_adv, NULL, NULL);
+
/* Add Device 2 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_2),
add_device_le_public_param_2,
setup_add_device_callback, NULL, NULL);
- mgmt_send(data->mgmt, MGMT_OP_ADD_ADVERTISING, data->mgmt_index,
- sizeof(adv_param), adv_param,
- setup_add_adv_callback_adv, NULL, NULL);
+ /* Device 2 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_2),
+ set_device_flags_param_2,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
+ /* Add Device 1 */
+ mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
+ sizeof(add_device_le_public_param_1),
+ add_device_le_public_param_1,
+ setup_add_device_callback, NULL, NULL);
}
static void setup_ll_privacy_adv_3_devices(const void *test_data)
@@ -11160,18 +11293,39 @@ static void setup_ll_privacy_adv_3_devices(const void *test_data)
add_device_le_public_param_1,
setup_add_device_callback, NULL, NULL);
+ /* Device 1 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_1),
+ set_device_flags_param_1,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
/* Add Device 2 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_2),
add_device_le_public_param_2,
setup_add_device_callback, NULL, NULL);
+ /* Device 2 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_2),
+ set_device_flags_param_2,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
/* Add Device 3 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_3),
add_device_le_public_param_3,
setup_add_device_callback, NULL, NULL);
+ /* Device 3 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_3),
+ set_device_flags_param_3,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
mgmt_send(data->mgmt, MGMT_OP_SET_POWERED, data->mgmt_index,
sizeof(param), param,
setup_powered_callback, NULL, NULL);
@@ -11203,12 +11357,26 @@ static void setup_ll_privacy_adv_1_device_2_advs(const void *test_data)
add_device_le_public_param_1,
setup_add_device_callback, NULL, NULL);
+ /* Device 1 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_1),
+ set_device_flags_param_1,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
/* Add Device 2 */
mgmt_send(data->mgmt, MGMT_OP_ADD_DEVICE, data->mgmt_index,
sizeof(add_device_le_public_param_2),
add_device_le_public_param_2,
setup_add_device_callback, NULL, NULL);
+ /* Device 2 Flags */
+ mgmt_send(data->mgmt, MGMT_OP_SET_DEVICE_FLAGS, data->mgmt_index,
+ sizeof(set_device_flags_param_2),
+ set_device_flags_param_2,
+ setup_set_device_flags_callback, NULL,
+ NULL);
+
mgmt_send(data->mgmt, MGMT_OP_ADD_ADVERTISING, data->mgmt_index,
sizeof(adv_param), adv_param,
setup_add_adv_callback_adv, NULL, NULL);
@@ -14542,14 +14710,6 @@ int main(int argc, char *argv[])
&read_exp_feat_success_index_none,
NULL, test_command_generic);
- /* MGMT_OP_SET_EXP_FEATURE
- * Enable LL Privacy
- */
- test_bredrle50("Set Exp Feature - Enable LL Privacy",
- &set_exp_feat_enable_ll_privacy,
- setup_set_exp_feature_alt,
- test_command_generic);
-
/* MGMT_OP_SET_EXP_FEATURE
* Offload Codec
*/
@@ -14565,12 +14725,6 @@ int main(int argc, char *argv[])
&set_exp_feat_disable,
NULL, test_command_generic);
- /* MGMT_OP_SET_EXP_FEATURE
- * Rejected - If the power is on, the command should be rejected
- */
- test_bredrle50("Set Exp Feature - Rejected",
- &set_exp_feat_rejected,
- NULL, test_command_generic);
/* MGMT_OP_SET_EXP_FEATURE
* Invalid parameter
@@ -14596,58 +14750,15 @@ int main(int argc, char *argv[])
&ll_privacy_add_device_1,
NULL, test_command_generic);
- /* LL Privacy
- * Setup: Enable LL Privacy and add IRK of new device
- * Run: Add new device
- * Expect: Device is added to the resolving list
- */
- test_bredrle50("LL Privacy - Add Device 2 (Add to RL)",
- &ll_privacy_add_device_2,
- setup_ll_privacy_with_irk1,
- test_command_generic);
- /* LL Privacy
- * Setup: Enable LL Privacy and add IRK of new device
- * Run: Add new device
- * Expect: Device is added to the resolving list and resolving list
- * is enabled
- */
- test_bredrle50("LL Privacy - Add Device 3 (Enable RL)",
- &ll_privacy_add_device_3,
- setup_ll_privacy_with_irk1,
- test_command_generic);
-
/* LL Privacy
* Setup: Enable LL Privacy, add device1 with IRK, and add IRK of
* device2
* Run: Add new device2
* Expect: Device2 is added to the accept list
*/
- test_bredrle50("LL Privacy - Add Device 4 (2 Devices to AL)",
- &ll_privacy_add_device_4,
- setup_ll_privacy_dev1_and_irk2,
- test_command_generic);
-
- /* LL Privacy
- * Setup: Enable LL Privacy, add device1 with IRK, and add IRK of
- * device2
- * Run: Add new device2
- * Expect: Device2 is added to the resolv list
- */
- test_bredrle50("LL Privacy - Add Device 5 (2 Devices to RL)",
- &ll_privacy_add_device_5,
- setup_ll_privacy_dev1_and_irk2,
- test_command_generic);
-
- /* LL Privacy
- * Setup: Enable LL Privacy, add 3 devices with IRKs, and add IRK of
- * device4
- * Run: Add new device4
- * Expect: Device4 is added but failed to add to resolv list because
- * btdev resolv list is full.
- */
- test_bredrle50("LL Privacy - Add Device 6 (RL is full)",
- &ll_privacy_add_device_6,
- setup_ll_privacy_2_devices_extra_rl,
+ test_bredrle50("LL Privacy - Add Device 2 (2 Devices to AL)",
+ &ll_privacy_add_device_2,
+ setup_ll_privacy_add_2,
test_command_generic);
/* LL Privacy
@@ -14657,9 +14768,9 @@ int main(int argc, char *argv[])
* Expect: Device4 is added but failed to add to accept list, and it
* is removed from the resolv list.
*/
- test_bredrle50("LL Privacy - Add Device 7 (AL is full)",
- &ll_privacy_add_device_7,
- setup_ll_privacy_2_devices_extra_al,
+ test_bredrle50("LL Privacy - Add Device 3 (AL is full)",
+ &ll_privacy_add_device_3,
+ setup_ll_privacy_add_3,
test_command_generic);
/* LL Privacy
@@ -14668,31 +14779,77 @@ int main(int argc, char *argv[])
* Expect: Disable the advertising before adding new device to the
* accept list and resolving list
*/
- test_bredrle50("LL Privacy - Add Device 8 (Disable Adv)",
- &ll_privacy_add_device_8,
- setup_ll_privacy_adv, test_command_generic);
+ test_bredrle50("LL Privacy - Add Device 4 (Disable Adv)",
+ &ll_privacy_add_4,
+ setup_ll_privacy_add_4,
+ test_command_generic);
+
+ /* LL Privacy
+ * Setup: Enable LL Privacy and add IRK of new device
+ * Run: Set Device Flags: DEVICE_FLAG_ADDRESS_RESOLUTION
+ * Expect: Device is added to the resolving list
+ */
+ test_bredrle50("LL Privacy - Set Flags 1 (Add to RL)",
+ &ll_privacy_set_flags_1,
+ setup_ll_privacy_set_flags_1,
+ test_command_generic);
+ /* LL Privacy
+ * Setup: Enable LL Privacy and add IRK of new device
+ * Run: Set Device Flags: DEVICE_FLAG_ADDRESS_RESOLUTION
+ * Expect: Device is added to the resolving list and resolving list
+ * is enabled
+ */
+ test_bredrle50("LL Privacy - Set Flags 2 (Enable RL)",
+ &ll_privacy_set_flags_2,
+ setup_ll_privacy_set_flags_1,
+ test_command_generic);
+
+ /* LL Privacy
+ * Setup: Enable LL Privacy, add device1 with IRK, and add IRK of
+ * device2
+ * Run: Set Device Flags: DEVICE_FLAG_ADDRESS_RESOLUTION
+ * Expect: Device2 is added to the resolv list
+ */
+ test_bredrle50("LL Privacy - Set Flags 3 (2 Devices to RL)",
+ &ll_privacy_set_flags_3,
+ setup_ll_privacy_set_flags_3,
+ test_command_generic);
+
+ /* LL Privacy
+ * Setup: Enable LL Privacy, add 3 devices with IRKs, and add IRK of
+ * device4
+ * Run: Set Device Flags: DEVICE_FLAG_ADDRESS_RESOLUTION
+ * Expect: Device4 is added but failed to add to resolv list because
+ * btdev resolv list is full.
+ */
+ test_bredrle50("LL Privacy - Set Flags 4 (RL is full)",
+ &ll_privacy_set_flags_4,
+ setup_ll_privacy_set_flags_4,
+ test_command_generic);
/* LL Privacy
* Setup: Enable LL Privacy, and add 2 advertisings
- * Run: Add new device
+ * Run: Set Device Flags: DEVICE_FLAG_ADDRESS_RESOLUTION
* Expect: Disable the advertising before adding new device to the
* accept list and resolving list
*/
- test_bredrle50("LL Privacy - Add Device 9 (Multi Adv)",
- &ll_privacy_add_device_9,
- setup_ll_privacy_2_advs, test_command_generic);
+ test_bredrle50("LL Privacy - Set Flags 5 (Multi Adv)",
+ &ll_privacy_set_flags_5,
+ setup_ll_privacy_set_flags_5,
+ test_command_generic);
/* LL Privacy
* Setup: Enable LL Privacy, and add 1 device and add 2 advertisings
- * Run: Add new device
+ * Run: Set Device Flags: DEVICE_FLAG_ADDRESS_RESOLUTION
* Expect: Disable the advertising before adding new device to the
* accept list and resolving list
*/
- test_bredrle50("LL Privacy - Add Device 10 (Multi Dev and Multi Adv)",
- &ll_privacy_add_device_9,
- setup_ll_privacy_dev_2_advs,
+ test_bredrle50("LL Privacy - Set Flags 6 (Multi Dev and Multi Adv)",
+ &ll_privacy_set_flags_5,
+ setup_ll_privacy_set_flags_6,
test_command_generic);
+
/* LL Privacy
* Setup: Enable LL Privacy and add 2 devices and its IRK
* Run: Remove one of devices
@@ -14752,7 +14909,7 @@ int main(int argc, char *argv[])
*/
test_bredrle50("LL Privacy - Start Discovery 1 (Disable RL)",
&ll_privacy_start_discovery_ll_privacy_1,
- setup_ll_privacy_dev1_and_irk2,
+ setup_ll_privacy_set_flags_3,
test_command_generic);
/* LL Privacy
--
2.47.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [BlueZ,v1,1/3] main.conf: Add LE.CentralAddressResolution option
2024-11-25 20:47 [PATCH BlueZ v1 1/3] main.conf: Add LE.CentralAddressResolution option Luiz Augusto von Dentz
2024-11-25 20:47 ` [PATCH BlueZ v1 2/3] monitor: Add support for Address Resoluton flag Luiz Augusto von Dentz
2024-11-25 20:47 ` [PATCH BlueZ v1 3/3] mgmt-tester: Fix LL Privacy tests Luiz Augusto von Dentz
@ 2024-11-25 22:10 ` bluez.test.bot
2024-12-12 21:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2024-11-25 22:10 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1692 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=912341
---Test result---
Test Summary:
CheckPatch PENDING 0.26 seconds
GitLint PENDING 0.29 seconds
BuildEll PASS 20.68 seconds
BluezMake PASS 1584.43 seconds
MakeCheck PASS 13.15 seconds
MakeDistcheck PASS 162.16 seconds
CheckValgrind PASS 217.24 seconds
CheckSmatch WARNING 275.69 seconds
bluezmakeextell PASS 100.06 seconds
IncrementalBuild PENDING 0.32 seconds
ScanBuild PASS 868.90 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:1868:26: warning: Variable length array is used.monitor/packet.c: note: in included file:monitor/bt.h:3606:52: warning: array of flexible structuresmonitor/bt.h:3594:40: warning: array of flexible structures
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH BlueZ v1 1/3] main.conf: Add LE.CentralAddressResolution option
2024-11-25 20:47 [PATCH BlueZ v1 1/3] main.conf: Add LE.CentralAddressResolution option Luiz Augusto von Dentz
` (2 preceding siblings ...)
2024-11-25 22:10 ` [BlueZ,v1,1/3] main.conf: Add LE.CentralAddressResolution option bluez.test.bot
@ 2024-12-12 21:10 ` patchwork-bot+bluetooth
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2024-12-12 21: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 Mon, 25 Nov 2024 15:47:08 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This adds CentralAddressResolution option to LE group which controls the
> GATT attribute of the same name using the new MGMT Device Flag with the
> fallback to LL Privacy experimental UUID.
>
> Fixes: https://github.com/bluez/bluez/issues/1028
>
> [...]
Here is the summary with links:
- [BlueZ,v1,1/3] main.conf: Add LE.CentralAddressResolution option
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=c9d70ca65f9a
- [BlueZ,v1,2/3] monitor: Add support for Address Resoluton flag
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=7e0fe7d5c143
- [BlueZ,v1,3/3] mgmt-tester: Fix LL Privacy tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=92f3a3b108c2
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-12-12 21:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-25 20:47 [PATCH BlueZ v1 1/3] main.conf: Add LE.CentralAddressResolution option Luiz Augusto von Dentz
2024-11-25 20:47 ` [PATCH BlueZ v1 2/3] monitor: Add support for Address Resoluton flag Luiz Augusto von Dentz
2024-11-25 20:47 ` [PATCH BlueZ v1 3/3] mgmt-tester: Fix LL Privacy tests Luiz Augusto von Dentz
2024-11-25 22:10 ` [BlueZ,v1,1/3] main.conf: Add LE.CentralAddressResolution option bluez.test.bot
2024-12-12 21:10 ` [PATCH BlueZ v1 1/3] " patchwork-bot+bluetooth
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.