summaryrefslogtreecommitdiff
path: root/emulator/le.c
diff options
context:
space:
mode:
authorArchie Pusaka <apusaka@chromium.org>2021-09-15 16:31:58 +0800
committerMarcel Holtmann <marcel@holtmann.org>2021-09-21 10:51:54 +0200
commit048f2ac0e4fcc19cf9b1f8fc9525a1dec21ab87f (patch)
tree8f326ce2b19c64ded6f6efcf8e67a157fd40bb14 /emulator/le.c
parent7582f36071830764eaebde98d336a6d3620a4bb4 (diff)
downloadbluez-048f2ac0e4fcc19cf9b1f8fc9525a1dec21ab87f.tar.gz
emulator: Inclusive language changes
BT core spec 5.3 promotes the usage of inclusive languages. This CL replaces some terms with the more appropriate counterparts, such as "central", "peripheral", and "accept list". Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'emulator/le.c')
-rw-r--r--emulator/le.c84
1 files changed, 42 insertions, 42 deletions
diff --git a/emulator/le.c b/emulator/le.c
index 23f257942..07a44c5f1 100644
--- a/emulator/le.c
+++ b/emulator/le.c
@@ -34,7 +34,7 @@
#include "phy.h"
#include "le.h"
-#define WHITE_LIST_SIZE 16
+#define ACCEPT_LIST_SIZE 16
#define RESOLV_LIST_SIZE 16
#define SCAN_CACHE_SIZE 64
@@ -102,8 +102,8 @@ struct bt_le {
uint8_t le_conn_own_addr_type;
uint8_t le_conn_enable;
- uint8_t le_white_list_size;
- uint8_t le_white_list[WHITE_LIST_SIZE][7];
+ uint8_t le_accept_list_size;
+ uint8_t le_accept_list[ACCEPT_LIST_SIZE][7];
uint8_t le_states[8];
uint16_t le_default_tx_len;
@@ -122,27 +122,27 @@ struct bt_le {
uint8_t scan_cache_count;
};
-static bool is_in_white_list(struct bt_le *hci, uint8_t addr_type,
+static bool is_in_accept_list(struct bt_le *hci, uint8_t addr_type,
const uint8_t addr[6])
{
int i;
- for (i = 0; i < hci->le_white_list_size; i++) {
- if (hci->le_white_list[i][0] == addr_type &&
- !memcmp(&hci->le_white_list[i][1], addr, 6))
+ for (i = 0; i < hci->le_accept_list_size; i++) {
+ if (hci->le_accept_list[i][0] == addr_type &&
+ !memcmp(&hci->le_accept_list[i][1], addr, 6))
return true;
}
return false;
}
-static void clear_white_list(struct bt_le *hci)
+static void clear_accept_list(struct bt_le *hci)
{
int i;
- for (i = 0; i < hci->le_white_list_size; i++) {
- hci->le_white_list[i][0] = 0xff;
- memset(&hci->le_white_list[i][1], 0, 6);
+ for (i = 0; i < hci->le_accept_list_size; i++) {
+ hci->le_accept_list[i][0] = 0xff;
+ memset(&hci->le_accept_list[i][1], 0, 6);
}
}
@@ -243,10 +243,10 @@ static void reset_defaults(struct bt_le *hci)
hci->commands[26] |= 0x08; /* LE Set Scan Enable */
hci->commands[26] |= 0x10; /* LE Create Connection */
hci->commands[26] |= 0x20; /* LE Create Connection Cancel */
- hci->commands[26] |= 0x40; /* LE Read White List Size */
- hci->commands[26] |= 0x80; /* LE Clear White List */
- hci->commands[27] |= 0x01; /* LE Add Device To White List */
- hci->commands[27] |= 0x02; /* LE Remove Device From White List */
+ hci->commands[26] |= 0x40; /* LE Read Accept List Size */
+ hci->commands[26] |= 0x80; /* LE Clear Accept List */
+ hci->commands[27] |= 0x01; /* LE Add Device To Accept List */
+ hci->commands[27] |= 0x02; /* LE Remove Device From Accept List */
//hci->commands[27] |= 0x04; /* LE Connection Update */
//hci->commands[27] |= 0x08; /* LE Set Host Channel Classification */
//hci->commands[27] |= 0x10; /* LE Read Channel Map */
@@ -343,7 +343,7 @@ static void reset_defaults(struct bt_le *hci)
hci->le_features[0] |= 0x01; /* LE Encryption */
//hci->le_features[0] |= 0x02; /* Connection Parameter Request Procedure */
//hci->le_features[0] |= 0x04; /* Extended Reject Indication */
- //hci->le_features[0] |= 0x08; /* Slave-initiated Features Exchange */
+ //hci->le_features[0] |= 0x08; /* Peripheral-initd Features Exchange */
hci->le_features[0] |= 0x10; /* LE Ping */
hci->le_features[0] |= 0x20; /* LE Data Packet Length Extension */
hci->le_features[0] |= 0x40; /* LL Privacy */
@@ -389,8 +389,8 @@ static void reset_defaults(struct bt_le *hci)
hci->le_conn_enable = 0x00;
- hci->le_white_list_size = WHITE_LIST_SIZE;
- clear_white_list(hci);
+ hci->le_accept_list_size = ACCEPT_LIST_SIZE;
+ clear_accept_list(hci);
memset(hci->le_states, 0, sizeof(hci->le_states));
hci->le_states[0] |= 0x01; /* Non-connectable Advertising */
@@ -399,8 +399,8 @@ static void reset_defaults(struct bt_le *hci)
hci->le_states[0] |= 0x08; /* High Duty Cycle Directed Advertising */
hci->le_states[0] |= 0x10; /* Passive Scanning */
hci->le_states[0] |= 0x20; /* Active Scanning */
- hci->le_states[0] |= 0x40; /* Initiating + Connection (Master Role) */
- hci->le_states[0] |= 0x80; /* Connection (Slave Role) */
+ hci->le_states[0] |= 0x40; /* Initiating + Conn (Central Role) */
+ hci->le_states[0] |= 0x80; /* Connection (Peripheral Role) */
hci->le_states[1] |= 0x01; /* Passive Scanning +
* Non-connectable Advertising */
@@ -1208,31 +1208,31 @@ static void cmd_le_create_conn_cancel(struct bt_le *hci,
&evt, sizeof(evt));
}
-static void cmd_le_read_white_list_size(struct bt_le *hci,
+static void cmd_le_read_accept_list_size(struct bt_le *hci,
const void *data, uint8_t size)
{
struct bt_hci_rsp_le_read_accept_list_size rsp;
rsp.status = BT_HCI_ERR_SUCCESS;
- rsp.size = hci->le_white_list_size;
+ rsp.size = hci->le_accept_list_size;
cmd_complete(hci, BT_HCI_CMD_LE_READ_ACCEPT_LIST_SIZE,
&rsp, sizeof(rsp));
}
-static void cmd_le_clear_white_list(struct bt_le *hci,
+static void cmd_le_clear_accept_list(struct bt_le *hci,
const void *data, uint8_t size)
{
uint8_t status;
- clear_white_list(hci);
+ clear_accept_list(hci);
status = BT_HCI_ERR_SUCCESS;
cmd_complete(hci, BT_HCI_CMD_LE_CLEAR_ACCEPT_LIST,
&status, sizeof(status));
}
-static void cmd_le_add_to_white_list(struct bt_le *hci,
+static void cmd_le_add_to_accept_list(struct bt_le *hci,
const void *data, uint8_t size)
{
const struct bt_hci_cmd_le_add_to_accept_list *cmd = data;
@@ -1247,13 +1247,13 @@ static void cmd_le_add_to_white_list(struct bt_le *hci,
return;
}
- for (i = 0; i < hci->le_white_list_size; i++) {
- if (hci->le_white_list[i][0] == cmd->addr_type &&
- !memcmp(&hci->le_white_list[i][1],
+ for (i = 0; i < hci->le_accept_list_size; i++) {
+ if (hci->le_accept_list[i][0] == cmd->addr_type &&
+ !memcmp(&hci->le_accept_list[i][1],
cmd->addr, 6)) {
exists = true;
break;
- } else if (pos < 0 && hci->le_white_list[i][0] == 0xff)
+ } else if (pos < 0 && hci->le_accept_list[i][0] == 0xff)
pos = i;
}
@@ -1269,15 +1269,15 @@ static void cmd_le_add_to_white_list(struct bt_le *hci,
return;
}
- hci->le_white_list[pos][0] = cmd->addr_type;
- memcpy(&hci->le_white_list[pos][1], cmd->addr, 6);
+ hci->le_accept_list[pos][0] = cmd->addr_type;
+ memcpy(&hci->le_accept_list[pos][1], cmd->addr, 6);
status = BT_HCI_ERR_SUCCESS;
cmd_complete(hci, BT_HCI_CMD_LE_ADD_TO_ACCEPT_LIST,
&status, sizeof(status));
}
-static void cmd_le_remove_from_white_list(struct bt_le *hci,
+static void cmd_le_remove_from_accept_list(struct bt_le *hci,
const void *data, uint8_t size)
{
const struct bt_hci_cmd_le_remove_from_accept_list *cmd = data;
@@ -1291,9 +1291,9 @@ static void cmd_le_remove_from_white_list(struct bt_le *hci,
return;
}
- for (i = 0; i < hci->le_white_list_size; i++) {
- if (hci->le_white_list[i][0] == cmd->addr_type &&
- !memcmp(&hci->le_white_list[i][1],
+ for (i = 0; i < hci->le_accept_list_size; i++) {
+ if (hci->le_accept_list[i][0] == cmd->addr_type &&
+ !memcmp(&hci->le_accept_list[i][1],
cmd->addr, 6)) {
pos = i;
break;
@@ -1306,8 +1306,8 @@ static void cmd_le_remove_from_white_list(struct bt_le *hci,
return;
}
- hci->le_white_list[pos][0] = 0xff;
- memset(&hci->le_white_list[pos][1], 0, 6);
+ hci->le_accept_list[pos][0] = 0xff;
+ memset(&hci->le_accept_list[pos][1], 0, 6);
status = BT_HCI_ERR_SUCCESS;
cmd_complete(hci, BT_HCI_CMD_LE_REMOVE_FROM_ACCEPT_LIST,
@@ -1831,13 +1831,13 @@ static const struct {
{ BT_HCI_CMD_LE_CREATE_CONN_CANCEL,
cmd_le_create_conn_cancel, 0, true },
{ BT_HCI_CMD_LE_READ_ACCEPT_LIST_SIZE,
- cmd_le_read_white_list_size, 0, true },
+ cmd_le_read_accept_list_size, 0, true },
{ BT_HCI_CMD_LE_CLEAR_ACCEPT_LIST,
- cmd_le_clear_white_list, 0, true },
+ cmd_le_clear_accept_list, 0, true },
{ BT_HCI_CMD_LE_ADD_TO_ACCEPT_LIST,
- cmd_le_add_to_white_list, 7, true },
+ cmd_le_add_to_accept_list, 7, true },
{ BT_HCI_CMD_LE_REMOVE_FROM_ACCEPT_LIST,
- cmd_le_remove_from_white_list, 7, true },
+ cmd_le_remove_from_accept_list, 7, true },
{ BT_HCI_CMD_LE_ENCRYPT, cmd_le_encrypt, 32, true },
{ BT_HCI_CMD_LE_RAND, cmd_le_rand, 0, true },
@@ -1963,7 +1963,7 @@ static void phy_recv_callback(uint16_t type, const void *data,
if (hci->le_scan_filter_policy == 0x01 ||
hci->le_scan_filter_policy == 0x03) {
- if (!is_in_white_list(hci, tx_addr_type,
+ if (!is_in_accept_list(hci, tx_addr_type,
tx_addr))
break;
}