提交 39bc74ca 编写于 作者: A Archie Pusaka 提交者: Marcel Holtmann

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: NArchie Pusaka <apusaka@chromium.org>
Reviewed-by: NMiao-chen Chou <mcchou@chromium.org>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 74be523c
...@@ -122,7 +122,7 @@ struct hci_conn_hash { ...@@ -122,7 +122,7 @@ struct hci_conn_hash {
unsigned int amp_num; unsigned int amp_num;
unsigned int sco_num; unsigned int sco_num;
unsigned int le_num; unsigned int le_num;
unsigned int le_num_slave; unsigned int le_num_peripheral;
}; };
struct bdaddr_list { struct bdaddr_list {
...@@ -894,7 +894,7 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) ...@@ -894,7 +894,7 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
case LE_LINK: case LE_LINK:
h->le_num++; h->le_num++;
if (c->role == HCI_ROLE_SLAVE) if (c->role == HCI_ROLE_SLAVE)
h->le_num_slave++; h->le_num_peripheral++;
break; break;
case SCO_LINK: case SCO_LINK:
case ESCO_LINK: case ESCO_LINK:
...@@ -920,7 +920,7 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) ...@@ -920,7 +920,7 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
case LE_LINK: case LE_LINK:
h->le_num--; h->le_num--;
if (c->role == HCI_ROLE_SLAVE) if (c->role == HCI_ROLE_SLAVE)
h->le_num_slave--; h->le_num_peripheral--;
break; break;
case SCO_LINK: case SCO_LINK:
case ESCO_LINK: case ESCO_LINK:
......
...@@ -5384,9 +5384,9 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev, ...@@ -5384,9 +5384,9 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
return NULL; return NULL;
/* Most controller will fail if we try to create new connections /* Most controller will fail if we try to create new connections
* while we have an existing one in slave role. * while we have an existing one in peripheral role.
*/ */
if (hdev->conn_hash.le_num_slave > 0 && if (hdev->conn_hash.le_num_peripheral > 0 &&
(!test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) || (!test_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks) ||
!(hdev->le_states[3] & 0x10))) !(hdev->le_states[3] & 0x10)))
return NULL; return NULL;
......
...@@ -1519,13 +1519,14 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable) ...@@ -1519,13 +1519,14 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
if (hci_conn_num(hdev, LE_LINK) == 0) if (hci_conn_num(hdev, LE_LINK) == 0)
return true; return true;
/* Check le_states if there is any connection in slave role. */ /* Check le_states if there is any connection in peripheral role. */
if (hdev->conn_hash.le_num_slave > 0) { if (hdev->conn_hash.le_num_peripheral > 0) {
/* Slave connection state and non connectable mode bit 20. */ /* Peripheral connection state and non connectable mode bit 20.
*/
if (!connectable && !(hdev->le_states[2] & 0x10)) if (!connectable && !(hdev->le_states[2] & 0x10))
return false; return false;
/* Slave connection state and connectable mode bit 38 /* Peripheral connection state and connectable mode bit 38
* and scannable bit 21. * and scannable bit 21.
*/ */
if (connectable && (!(hdev->le_states[4] & 0x40) || if (connectable && (!(hdev->le_states[4] & 0x40) ||
...@@ -1533,13 +1534,13 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable) ...@@ -1533,13 +1534,13 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
return false; return false;
} }
/* Check le_states if there is any connection in master role. */ /* Check le_states if there is any connection in central role. */
if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_slave) { if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_peripheral) {
/* Master connection state and non connectable mode bit 18. */ /* Central connection state and non connectable mode bit 18. */
if (!connectable && !(hdev->le_states[2] & 0x02)) if (!connectable && !(hdev->le_states[2] & 0x02))
return false; return false;
/* Master connection state and connectable mode bit 35 and /* Central connection state and connectable mode bit 35 and
* scannable 19. * scannable 19.
*/ */
if (connectable && (!(hdev->le_states[4] & 0x08) || if (connectable && (!(hdev->le_states[4] & 0x08) ||
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册