From b7d6a7d25628e9b521a29a5c133fcadcedeb2102 Mon Sep 17 00:00:00 2001 From: Archie Pusaka Date: Wed, 15 Sep 2021 16:31:55 +0800 Subject: lib: 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 --- lib/hci.c | 32 ++++++++++++++++++++------------ lib/mgmt.h | 2 +- 2 files changed, 21 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/hci.c b/lib/hci.c index 53af0a114..5141f20ac 100644 --- a/lib/hci.c +++ b/lib/hci.c @@ -288,7 +288,7 @@ int hci_strtolp(char *str, unsigned int *val) static hci_map link_mode_map[] = { { "NONE", 0 }, { "ACCEPT", HCI_LM_ACCEPT }, - { "MASTER", HCI_LM_MASTER }, + { "CENTRAL", HCI_LM_MASTER }, { "AUTH", HCI_LM_AUTH }, { "ENCRYPT", HCI_LM_ENCRYPT }, { "TRUSTED", HCI_LM_TRUSTED }, @@ -305,7 +305,7 @@ char *hci_lmtostr(unsigned int lm) *str = 0; if (!(lm & HCI_LM_MASTER)) - strcpy(str, "SLAVE "); + strcpy(str, "PERIPHERAL "); s = hci_bit2str(link_mode_map, lm); if (!s) { @@ -320,7 +320,15 @@ char *hci_lmtostr(unsigned int lm) int hci_strtolm(char *str, unsigned int *val) { - return hci_str2bit(link_mode_map, str, val); + int ret = hci_str2bit(link_mode_map, str, val); + + /* Deprecated name. Kept for compatibility. */ + if (strcasestr(str, "MASTER")) { + ret = 1; + *val |= HCI_LM_MASTER; + } + + return ret; } /* Command mapping */ @@ -345,7 +353,7 @@ static hci_map commands_map[] = { { "Set Connection Encryption", 16 }, { "Change Connection Link Key", 17 }, - { "Master Link Key", 18 }, + { "Temporary Link Key", 18 }, { "Remote Name Request", 19 }, { "Cancel Remote Name Request", 20 }, { "Read Remote Supported Features", 21 }, @@ -565,11 +573,11 @@ static hci_map commands_map[] = { { "LE Set Scan Enable", 211 }, { "LE Create Connection", 212 }, { "LE Create Connection Cancel", 213 }, - { "LE Read White List Size", 214 }, - { "LE Clear White List", 215 }, + { "LE Read Accept List Size", 214 }, + { "LE Clear Accept List", 215 }, - { "LE Add Device To White List", 216 }, - { "LE Remove Device From White List", 217 }, + { "LE Add Device To Accept List", 216 }, + { "LE Remove Device From Accept List", 217 }, { "LE Connection Update", 218 }, { "LE Set Host Channel Classification", 219 }, { "LE Read Channel Map", 220 }, @@ -735,8 +743,8 @@ static hci_map lmp_features_map[8][9] = { { "", LMP_EV4 }, /* Bit 0 */ { "", LMP_EV5 }, /* Bit 1 */ { "", 0x04 }, /* Bit 2 */ - { "", LMP_AFH_CAP_SLV }, /* Bit 3 */ - { "", LMP_AFH_CLS_SLV }, /* Bit 4 */ + { "", LMP_AFH_CAP_SLV }, /* Bit 3 */ + { "", LMP_AFH_CLS_SLV }, /* Bit 4 */ { "
", LMP_NO_BREDR }, /* Bit 5 */ { "", LMP_LE }, /* Bit 6 */ { "<3-slot EDR ACL>", LMP_EDR_3SLOT }, /* Bit 7 */ @@ -746,8 +754,8 @@ static hci_map lmp_features_map[8][9] = { { "<5-slot EDR ACL>", LMP_EDR_5SLOT }, /* Bit 0 */ { "", LMP_SNIFF_SUBR }, /* Bit 1 */ { "", LMP_PAUSE_ENC }, /* Bit 2 */ - { "", LMP_AFH_CAP_MST }, /* Bit 3 */ - { "",LMP_AFH_CLS_MST }, /* Bit 4 */ + { "", LMP_AFH_CAP_MST }, /* Bit 3 */ + { "", LMP_AFH_CLS_MST }, /* Bit 4 */ { "", LMP_EDR_ESCO_2M }, /* Bit 5 */ { "", LMP_EDR_ESCO_3M }, /* Bit 6 */ { "<3-slot EDR eSCO>", LMP_EDR_3S_ESCO }, /* Bit 7 */ diff --git a/lib/mgmt.h b/lib/mgmt.h index 0a6349321..0d1678f01 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -179,7 +179,7 @@ struct mgmt_cp_load_link_keys { struct mgmt_ltk_info { struct mgmt_addr_info addr; uint8_t type; - uint8_t master; + uint8_t central; uint8_t enc_size; uint16_t ediv; uint64_t rand; -- cgit v1.2.1