Skip to content

Commit b8770ac

Browse files
committed
Bluetooth: host: Align with terms in v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the Bluetooth Host implementation. Signed-off-by: Carles Cufi <[email protected]>
1 parent 1821d34 commit b8770ac

File tree

14 files changed

+91
-88
lines changed

14 files changed

+91
-88
lines changed

doc/releases/release-notes-2.7.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ Modified in this release
7979
* ``m_*`` structure members are now ``c_*``
8080
* ``s_*`` structure members are now ``p_*``
8181

82+
* The ``CONFIG_BT_PERIPHERAL_PREF_SLAVE_LATENCY`` Kconfig option is now
83+
:kconfig:`CONFIG_BT_PERIPHERAL_PREF_LATENCY`
84+
8285
Changes in this release
8386
==========================
8487

subsys/bluetooth/host/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,10 @@ config BT_SMP_USB_HCI_CTLR_WORKAROUND
355355
This option enables support for USB HCI controllers that sometimes
356356
send out-of-order HCI events and ACL Data due to using different USB
357357
endpoints.
358-
Enabling this option will make the master role not require the
358+
Enabling this option will make the central role not require the
359359
encryption-change event to be received before accepting key-distribution
360360
data.
361-
It opens up for a potential vulnerability as the master cannot detect
361+
It opens up for a potential vulnerability as the central cannot detect
362362
if the keys are distributed over an encrypted link.
363363

364364
config BT_FIXED_PASSKEY

subsys/bluetooth/host/Kconfig.gatt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ config BT_PERIPHERAL_PREF_MAX_INT
173173
help
174174
Range 3200 to 65534 is invalid. 65535 represents no specific value.
175175

176-
config BT_PERIPHERAL_PREF_SLAVE_LATENCY
177-
int "Peripheral preferred slave latency in Connection Intervals"
176+
config BT_PERIPHERAL_PREF_LATENCY
177+
int "Peripheral preferred peripheral latency in Connection Intervals"
178178
default 0
179179
range 0 499
180180

subsys/bluetooth/host/conn.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,14 +1328,14 @@ void notify_le_param_updated(struct bt_conn *conn)
13281328
struct bt_conn_cb *cb;
13291329

13301330
/* If new connection parameters meet requirement of pending
1331-
* parameters don't send slave conn param request anymore on timeout
1331+
* parameters don't send peripheral conn param request anymore on timeout
13321332
*/
1333-
if (atomic_test_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET) &&
1333+
if (atomic_test_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET) &&
13341334
conn->le.interval >= conn->le.interval_min &&
13351335
conn->le.interval <= conn->le.interval_max &&
13361336
conn->le.latency == conn->le.pending_latency &&
13371337
conn->le.timeout == conn->le.pending_timeout) {
1338-
atomic_clear_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET);
1338+
atomic_clear_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET);
13391339
}
13401340

13411341
for (cb = callback_list; cb; cb = cb->_next) {
@@ -1452,11 +1452,11 @@ static int send_conn_le_param_update(struct bt_conn *conn,
14521452
}
14531453

14541454
/* Use LE connection parameter request if both local and remote support
1455-
* it; or if local role is master then use LE connection update.
1455+
* it; or if local role is central then use LE connection update.
14561456
*/
14571457
if ((BT_FEAT_LE_CONN_PARAM_REQ_PROC(bt_dev.le.features) &&
14581458
BT_FEAT_LE_CONN_PARAM_REQ_PROC(conn->le.features) &&
1459-
!atomic_test_bit(conn->flags, BT_CONN_SLAVE_PARAM_L2CAP)) ||
1459+
!atomic_test_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_L2CAP)) ||
14601460
(conn->role == BT_HCI_ROLE_CENTRAL)) {
14611461
int rc;
14621462

@@ -1471,7 +1471,7 @@ static int send_conn_le_param_update(struct bt_conn *conn,
14711471
return rc;
14721472
}
14731473

1474-
/* If remote master does not support LL Connection Parameters Request
1474+
/* If remote central does not support LL Connection Parameters Request
14751475
* Procedure
14761476
*/
14771477
return bt_l2cap_update_conn_param(conn, param);
@@ -1572,7 +1572,7 @@ static void deferred_work(struct k_work *work)
15721572

15731573
/* if application set own params use those, otherwise use defaults. */
15741574
if (atomic_test_and_clear_bit(conn->flags,
1575-
BT_CONN_SLAVE_PARAM_SET)) {
1575+
BT_CONN_PERIPHERAL_PARAM_SET)) {
15761576
param = BT_LE_CONN_PARAM(conn->le.interval_min,
15771577
conn->le.interval_max,
15781578
conn->le.pending_latency,
@@ -1583,13 +1583,13 @@ static void deferred_work(struct k_work *work)
15831583
param = BT_LE_CONN_PARAM(
15841584
CONFIG_BT_PERIPHERAL_PREF_MIN_INT,
15851585
CONFIG_BT_PERIPHERAL_PREF_MAX_INT,
1586-
CONFIG_BT_PERIPHERAL_PREF_SLAVE_LATENCY,
1586+
CONFIG_BT_PERIPHERAL_PREF_LATENCY,
15871587
CONFIG_BT_PERIPHERAL_PREF_TIMEOUT);
15881588
send_conn_le_param_update(conn, param);
15891589
#endif
15901590
}
15911591

1592-
atomic_set_bit(conn->flags, BT_CONN_SLAVE_PARAM_UPDATE);
1592+
atomic_set_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_UPDATE);
15931593
}
15941594

15951595
static struct bt_conn *acl_conn_new(void)
@@ -2335,7 +2335,7 @@ int bt_conn_le_param_update(struct bt_conn *conn,
23352335
conn->le.interval <= param->interval_max &&
23362336
conn->le.latency == param->latency &&
23372337
conn->le.timeout == param->timeout) {
2338-
atomic_clear_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET);
2338+
atomic_clear_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET);
23392339
return -EALREADY;
23402340
}
23412341

@@ -2345,8 +2345,8 @@ int bt_conn_le_param_update(struct bt_conn *conn,
23452345
}
23462346

23472347
if (IS_ENABLED(CONFIG_BT_PERIPHERAL)) {
2348-
/* if slave conn param update timer expired just send request */
2349-
if (atomic_test_bit(conn->flags, BT_CONN_SLAVE_PARAM_UPDATE)) {
2348+
/* if peripheral conn param update timer expired just send request */
2349+
if (atomic_test_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_UPDATE)) {
23502350
return send_conn_le_param_update(conn, param);
23512351
}
23522352

@@ -2355,7 +2355,7 @@ int bt_conn_le_param_update(struct bt_conn *conn,
23552355
conn->le.interval_max = param->interval_max;
23562356
conn->le.pending_latency = param->latency;
23572357
conn->le.pending_timeout = param->timeout;
2358-
atomic_set_bit(conn->flags, BT_CONN_SLAVE_PARAM_SET);
2358+
atomic_set_bit(conn->flags, BT_CONN_PERIPHERAL_PARAM_SET);
23592359
}
23602360

23612361
return 0;
@@ -2509,7 +2509,7 @@ int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param,
25092509

25102510
err = bt_le_create_conn(conn);
25112511
if (err) {
2512-
BT_ERR("Failed to start whitelist scan");
2512+
BT_ERR("Failed to start filtered scan");
25132513
conn->err = 0;
25142514
bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
25152515
bt_conn_unref(conn);

subsys/bluetooth/host/conn_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ enum {
2929
BT_CONN_BR_PAIRING_INITIATOR, /* local host starts authentication */
3030
BT_CONN_CLEANUP, /* Disconnected, pending cleanup */
3131
BT_CONN_AUTO_PHY_UPDATE, /* Auto-update PHY */
32-
BT_CONN_SLAVE_PARAM_UPDATE, /* If slave param update timer fired */
33-
BT_CONN_SLAVE_PARAM_SET, /* If slave param were set from app */
34-
BT_CONN_SLAVE_PARAM_L2CAP, /* If should force L2CAP for CPUP */
32+
BT_CONN_PERIPHERAL_PARAM_UPDATE,/* If periph param update timer fired */
33+
BT_CONN_PERIPHERAL_PARAM_SET, /* If periph param were set from app */
34+
BT_CONN_PERIPHERAL_PARAM_L2CAP, /* If should force L2CAP for CPUP */
3535
BT_CONN_FORCE_PAIR, /* Pairing even with existing keys. */
3636

3737
BT_CONN_AUTO_PHY_COMPLETE, /* Auto-initiated PHY procedure done */

subsys/bluetooth/host/gatt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static ssize_t read_ppcp(struct bt_conn *conn, const struct bt_gatt_attr *attr,
150150

151151
ppcp.min_int = sys_cpu_to_le16(CONFIG_BT_PERIPHERAL_PREF_MIN_INT);
152152
ppcp.max_int = sys_cpu_to_le16(CONFIG_BT_PERIPHERAL_PREF_MAX_INT);
153-
ppcp.latency = sys_cpu_to_le16(CONFIG_BT_PERIPHERAL_PREF_SLAVE_LATENCY);
153+
ppcp.latency = sys_cpu_to_le16(CONFIG_BT_PERIPHERAL_PREF_LATENCY);
154154
ppcp.timeout = sys_cpu_to_le16(CONFIG_BT_PERIPHERAL_PREF_TIMEOUT);
155155

156156
return bt_gatt_attr_read(conn, attr, buf, len, offset, &ppcp,

subsys/bluetooth/host/hci_core.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -995,11 +995,11 @@ static void le_conn_complete_cancel(void)
995995
/* Handle create connection cancel.
996996
*
997997
* There is no need to check ID address as only one
998-
* connection in master role can be in pending state.
998+
* connection in central role can be in pending state.
999999
*/
10001000
conn = find_pending_connect(BT_HCI_ROLE_CENTRAL, NULL);
10011001
if (!conn) {
1002-
BT_ERR("No pending master connection");
1002+
BT_ERR("No pending central connection");
10031003
return;
10041004
}
10051005

@@ -1019,7 +1019,7 @@ static void le_conn_complete_cancel(void)
10191019
}
10201020
} else {
10211021
if (atomic_test_bit(conn->flags, BT_CONN_AUTO_CONNECT)) {
1022-
/* Restart whitelist initiator after RPA timeout. */
1022+
/* Restart FAL initiator after RPA timeout. */
10231023
bt_le_create_conn(conn);
10241024
} else {
10251025
/* Create connection canceled by timeout */
@@ -1052,11 +1052,11 @@ static void le_conn_complete_adv_timeout(void)
10521052
}
10531053

10541054
/* There is no need to check ID address as only one
1055-
* connection in slave role can be in pending state.
1055+
* connection in peripheral role can be in pending state.
10561056
*/
10571057
conn = find_pending_connect(BT_HCI_ROLE_PERIPHERAL, NULL);
10581058
if (!conn) {
1059-
BT_ERR("No pending slave connection");
1059+
BT_ERR("No pending peripheral connection");
10601060
return;
10611061
}
10621062

@@ -1200,7 +1200,7 @@ void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt)
12001200
#endif
12011201
/*
12021202
* Use connection address (instead of identity address) as initiator
1203-
* or responder address. Only slave needs to be updated. For master all
1203+
* or responder address. Only peripheral needs to be updated. For central all
12041204
* was set during outgoing connection creation.
12051205
*/
12061206
if (IS_ENABLED(CONFIG_BT_PERIPHERAL) &&
@@ -1234,9 +1234,9 @@ void bt_hci_le_enh_conn_complete(struct bt_hci_evt_le_enh_conn_complete *evt)
12341234
}
12351235

12361236
/* if the controller supports, lets advertise for another
1237-
* slave connection.
1237+
* peripheral connection.
12381238
* check for connectable advertising state is sufficient as
1239-
* this is how this le connection complete for slave occurred.
1239+
* this is how this le connection complete for peripheral occurred.
12401240
*/
12411241
if (BT_LE_STATES_PER_CONN_ADV(bt_dev.le.states)) {
12421242
bt_le_adv_resume();
@@ -1568,7 +1568,7 @@ static void le_conn_update_complete(struct net_buf *buf)
15681568
} else if (evt->status == BT_HCI_ERR_UNSUPP_REMOTE_FEATURE &&
15691569
conn->role == BT_HCI_ROLE_PERIPHERAL &&
15701570
!atomic_test_and_set_bit(conn->flags,
1571-
BT_CONN_SLAVE_PARAM_L2CAP)) {
1571+
BT_CONN_PERIPHERAL_PARAM_L2CAP)) {
15721572
/* CPR not supported, let's try L2CAP CPUP instead */
15731573
struct bt_le_conn_param param;
15741574

@@ -1787,7 +1787,7 @@ static void hci_encrypt_change(struct net_buf *buf)
17871787
if (IS_ENABLED(CONFIG_BT_SMP)) {
17881788
/*
17891789
* Start SMP over BR/EDR if we are pairing and are
1790-
* master on the link
1790+
* central on the link
17911791
*/
17921792
if (atomic_test_bit(conn->flags, BT_CONN_BR_PAIRING) &&
17931793
conn->role == BT_CONN_ROLE_CENTRAL) {
@@ -3688,7 +3688,7 @@ int bt_le_filter_accept_list_add(const bt_addr_le_t *addr)
36883688

36893689
err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_ADD_DEV_TO_FAL, buf, NULL);
36903690
if (err) {
3691-
BT_ERR("Failed to add device to whitelist");
3691+
BT_ERR("Failed to add device to filter accept list");
36923692

36933693
return err;
36943694
}
@@ -3716,7 +3716,7 @@ int bt_le_filter_accept_list_remove(const bt_addr_le_t *addr)
37163716

37173717
err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_REM_DEV_FROM_FAL, buf, NULL);
37183718
if (err) {
3719-
BT_ERR("Failed to remove device from whitelist");
3719+
BT_ERR("Failed to remove device from filter accept list");
37203720
return err;
37213721
}
37223722

@@ -3733,7 +3733,7 @@ int bt_le_filter_accept_list_clear(void)
37333733

37343734
err = bt_hci_cmd_send_sync(BT_HCI_OP_LE_CLEAR_FAL, NULL, NULL);
37353735
if (err) {
3736-
BT_ERR("Failed to clear whitelist");
3736+
BT_ERR("Failed to clear filter accept list");
37373737
return err;
37383738
}
37393739

subsys/bluetooth/host/hci_core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ enum {
3838
BT_DEV_EXPLICIT_SCAN,
3939
BT_DEV_ACTIVE_SCAN,
4040
BT_DEV_SCAN_FILTER_DUP,
41-
BT_DEV_SCAN_WL,
41+
BT_DEV_SCAN_FILTERED,
4242
BT_DEV_SCAN_LIMITED,
4343
BT_DEV_INITIATING,
4444

subsys/bluetooth/host/iso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static void bt_iso_chan_disconnected(struct bt_iso_chan *chan, uint8_t reason)
412412
chan->iso = NULL;
413413
} else {
414414
/* ISO data paths are automatically removed when the
415-
* peripheral/slave disconnects, so we only need to
415+
* peripheral disconnects, so we only need to
416416
* move it for the central
417417
*/
418418
bt_iso_remove_data_path(chan->iso);

subsys/bluetooth/host/keys.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ void bt_keys_show_sniffer_info(struct bt_keys *keys, void *data)
490490
BT_INFO("SC LTK: 0x%s", bt_hex(ltk, keys->enc_size));
491491
}
492492

493-
if (keys->keys & BT_KEYS_SLAVE_LTK) {
494-
sys_memcpy_swap(ltk, keys->slave_ltk.val, keys->enc_size);
493+
if (keys->keys & BT_KEYS_PERIPH_LTK) {
494+
sys_memcpy_swap(ltk, keys->periph_ltk.val, keys->enc_size);
495495
BT_INFO("Legacy LTK: 0x%s (peripheral)",
496496
bt_hex(ltk, keys->enc_size));
497497
}

0 commit comments

Comments
 (0)