Skip to content

Commit 39bc74c

Browse files
apusakaholtmann
authored andcommitted
Bluetooth: use inclusive language when tracking connections
This patch replaces some non-inclusive terms based on the appropriate language mapping table compiled by the Bluetooth SIG: https://specificationrefs.bluetooth.com/language-mapping/Appropriate_Language_Mapping_Table.pdf Specifically, these terms are replaced: master -> central slave -> peripheral Signed-off-by: Archie Pusaka <[email protected]> Reviewed-by: Miao-chen Chou <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 74be523 commit 39bc74c

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

include/net/bluetooth/hci_core.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ struct hci_conn_hash {
122122
unsigned int amp_num;
123123
unsigned int sco_num;
124124
unsigned int le_num;
125-
unsigned int le_num_slave;
125+
unsigned int le_num_peripheral;
126126
};
127127

128128
struct bdaddr_list {
@@ -894,7 +894,7 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
894894
case LE_LINK:
895895
h->le_num++;
896896
if (c->role == HCI_ROLE_SLAVE)
897-
h->le_num_slave++;
897+
h->le_num_peripheral++;
898898
break;
899899
case SCO_LINK:
900900
case ESCO_LINK:
@@ -920,7 +920,7 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
920920
case LE_LINK:
921921
h->le_num--;
922922
if (c->role == HCI_ROLE_SLAVE)
923-
h->le_num_slave--;
923+
h->le_num_peripheral--;
924924
break;
925925
case SCO_LINK:
926926
case ESCO_LINK:

net/bluetooth/hci_event.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5384,9 +5384,9 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
53845384
return NULL;
53855385

53865386
/* Most controller will fail if we try to create new connections
5387-
* while we have an existing one in slave role.
5387+
* while we have an existing one in peripheral role.
53885388
*/
5389-
if (hdev->conn_hash.le_num_slave > 0 &&
5389+
if (hdev->conn_hash.le_num_peripheral > 0 &&
53905390
(!test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) ||
53915391
!(hdev->le_states[3] & 0x10)))
53925392
return NULL;

net/bluetooth/hci_request.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,27 +1519,28 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
15191519
if (hci_conn_num(hdev, LE_LINK) == 0)
15201520
return true;
15211521

1522-
/* Check le_states if there is any connection in slave role. */
1523-
if (hdev->conn_hash.le_num_slave > 0) {
1524-
/* Slave connection state and non connectable mode bit 20. */
1522+
/* Check le_states if there is any connection in peripheral role. */
1523+
if (hdev->conn_hash.le_num_peripheral > 0) {
1524+
/* Peripheral connection state and non connectable mode bit 20.
1525+
*/
15251526
if (!connectable && !(hdev->le_states[2] & 0x10))
15261527
return false;
15271528

1528-
/* Slave connection state and connectable mode bit 38
1529+
/* Peripheral connection state and connectable mode bit 38
15291530
* and scannable bit 21.
15301531
*/
15311532
if (connectable && (!(hdev->le_states[4] & 0x40) ||
15321533
!(hdev->le_states[2] & 0x20)))
15331534
return false;
15341535
}
15351536

1536-
/* Check le_states if there is any connection in master role. */
1537-
if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_slave) {
1538-
/* Master connection state and non connectable mode bit 18. */
1537+
/* Check le_states if there is any connection in central role. */
1538+
if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_peripheral) {
1539+
/* Central connection state and non connectable mode bit 18. */
15391540
if (!connectable && !(hdev->le_states[2] & 0x02))
15401541
return false;
15411542

1542-
/* Master connection state and connectable mode bit 35 and
1543+
/* Central connection state and connectable mode bit 35 and
15431544
* scannable 19.
15441545
*/
15451546
if (connectable && (!(hdev->le_states[4] & 0x08) ||

0 commit comments

Comments
 (0)