From: Archie Pusaka <[email protected]>
Hi linux-bluetooth maintainers,
This series contains inclusive language patches, to promote usage of
central, peripheral, reject list, and accept list. I tried to divide
the change to several smaller patches to ease downstreamers to make
gradual change.
There are still three occurences in debugfs (patch 09/12) in which the
original less inclusive terms is still left as-is since it is a
file name, and I afraid replacing them will cause instability to
other systems depending on that file name.
Archie Pusaka (12):
Bluetooth: use inclusive language in HCI role
Bluetooth: use inclusive language in hci_core.h
Bluetooth: use inclusive language to describe CPB
Bluetooth: use inclusive language in HCI LE features
Bluetooth: use inclusive language in L2CAP
Bluetooth: use inclusive language in RFCOMM
Bluetooth: use inclusive language when tracking connections
Bluetooth: use inclusive language in SMP
Bluetooth: use inclusive language in debugfs
Bluetooth: use inclusive language when filtering devices out
Bluetooth: use inclusive language when filtering devices in
Bluetooth: use inclusive language in comments
include/net/bluetooth/hci.h | 98 +++++++++++++-------------
include/net/bluetooth/hci_core.h | 22 +++---
include/net/bluetooth/l2cap.h | 2 +-
include/net/bluetooth/mgmt.h | 2 +-
include/net/bluetooth/rfcomm.h | 2 +-
net/bluetooth/amp.c | 2 +-
net/bluetooth/hci_conn.c | 32 ++++-----
net/bluetooth/hci_core.c | 46 ++++++-------
net/bluetooth/hci_debugfs.c | 20 +++---
net/bluetooth/hci_event.c | 114 +++++++++++++++----------------
net/bluetooth/hci_request.c | 106 ++++++++++++++--------------
net/bluetooth/hci_sock.c | 12 ++--
net/bluetooth/hidp/core.c | 2 +-
net/bluetooth/l2cap_core.c | 16 ++---
net/bluetooth/l2cap_sock.c | 4 +-
net/bluetooth/mgmt.c | 36 +++++-----
net/bluetooth/rfcomm/sock.c | 4 +-
net/bluetooth/smp.c | 86 +++++++++++------------
net/bluetooth/smp.h | 6 +-
19 files changed, 309 insertions(+), 303 deletions(-)
--
2.31.1.818.g46aad6cb9e-goog
From: Archie Pusaka <[email protected]>
Use "central" and "peripheral".
Signed-off-by: Archie Pusaka <[email protected]>
Reviewed-by: Miao-chen Chou <[email protected]>
---
include/net/bluetooth/hci_core.h | 6 +++---
net/bluetooth/hci_event.c | 4 ++--
net/bluetooth/hci_request.c | 17 +++++++++--------
3 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 929768f6ed93..cfe2ada49ca2 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -122,7 +122,7 @@ struct hci_conn_hash {
unsigned int amp_num;
unsigned int sco_num;
unsigned int le_num;
- unsigned int le_num_slave;
+ unsigned int le_num_peripheral;
};
struct bdaddr_list {
@@ -894,7 +894,7 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
case LE_LINK:
h->le_num++;
if (c->role == HCI_ROLE_PERIPHERAL)
- h->le_num_slave++;
+ h->le_num_peripheral++;
break;
case SCO_LINK:
case ESCO_LINK:
@@ -920,7 +920,7 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
case LE_LINK:
h->le_num--;
if (c->role == HCI_ROLE_PERIPHERAL)
- h->le_num_slave--;
+ h->le_num_peripheral--;
break;
case SCO_LINK:
case ESCO_LINK:
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a809e90326d7..c5871c2a16ba 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5384,9 +5384,9 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
return NULL;
/* 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) ||
!(hdev->le_states[3] & 0x10)))
return NULL;
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index fa9125b782f8..28a477a7d320 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -1502,13 +1502,14 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
if (hci_conn_num(hdev, LE_LINK) == 0)
return true;
- /* Check le_states if there is any connection in slave role. */
- if (hdev->conn_hash.le_num_slave > 0) {
- /* Slave connection state and non connectable mode bit 20. */
+ /* Check le_states if there is any connection in peripheral role. */
+ if (hdev->conn_hash.le_num_peripheral > 0) {
+ /* Peripheral connection state and non connectable mode bit 20.
+ */
if (!connectable && !(hdev->le_states[2] & 0x10))
return false;
- /* Slave connection state and connectable mode bit 38
+ /* Peripheral connection state and connectable mode bit 38
* and scannable bit 21.
*/
if (connectable && (!(hdev->le_states[4] & 0x40) ||
@@ -1516,13 +1517,13 @@ static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
return false;
}
- /* Check le_states if there is any connection in master role. */
- if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_slave) {
- /* Master connection state and non connectable mode bit 18. */
+ /* Check le_states if there is any connection in central role. */
+ if (hci_conn_num(hdev, LE_LINK) != hdev->conn_hash.le_num_peripheral) {
+ /* Central connection state and non connectable mode bit 18. */
if (!connectable && !(hdev->le_states[2] & 0x02))
return false;
- /* Master connection state and connectable mode bit 35 and
+ /* Central connection state and connectable mode bit 35 and
* scannable 19.
*/
if (connectable && (!(hdev->le_states[4] & 0x08) ||
--
2.31.1.818.g46aad6cb9e-goog
Hi Archie,
Den tis 25 maj 2021 kl 12:46 skrev Archie Pusaka <[email protected]>:
>
> From: Archie Pusaka <[email protected]>
>
> Hi linux-bluetooth maintainers,
>
> This series contains inclusive language patches, to promote usage of
> central, peripheral, reject list, and accept list. I tried to divide
> the change to several smaller patches to ease downstreamers to make
> gradual change.
>
> There are still three occurences in debugfs (patch 09/12) in which the
> original less inclusive terms is still left as-is since it is a
> file name, and I afraid replacing them will cause instability to
> other systems depending on that file name.
>
>
> Archie Pusaka (12):
> Bluetooth: use inclusive language in HCI role
> Bluetooth: use inclusive language in hci_core.h
> Bluetooth: use inclusive language to describe CPB
> Bluetooth: use inclusive language in HCI LE features
> Bluetooth: use inclusive language in L2CAP
> Bluetooth: use inclusive language in RFCOMM
> Bluetooth: use inclusive language when tracking connections
> Bluetooth: use inclusive language in SMP
> Bluetooth: use inclusive language in debugfs
> Bluetooth: use inclusive language when filtering devices out
> Bluetooth: use inclusive language when filtering devices in
> Bluetooth: use inclusive language in comments
>
> include/net/bluetooth/hci.h | 98 +++++++++++++-------------
> include/net/bluetooth/hci_core.h | 22 +++---
> include/net/bluetooth/l2cap.h | 2 +-
> include/net/bluetooth/mgmt.h | 2 +-
> include/net/bluetooth/rfcomm.h | 2 +-
> net/bluetooth/amp.c | 2 +-
> net/bluetooth/hci_conn.c | 32 ++++-----
> net/bluetooth/hci_core.c | 46 ++++++-------
> net/bluetooth/hci_debugfs.c | 20 +++---
> net/bluetooth/hci_event.c | 114 +++++++++++++++----------------
> net/bluetooth/hci_request.c | 106 ++++++++++++++--------------
> net/bluetooth/hci_sock.c | 12 ++--
> net/bluetooth/hidp/core.c | 2 +-
> net/bluetooth/l2cap_core.c | 16 ++---
> net/bluetooth/l2cap_sock.c | 4 +-
> net/bluetooth/mgmt.c | 36 +++++-----
> net/bluetooth/rfcomm/sock.c | 4 +-
> net/bluetooth/smp.c | 86 +++++++++++------------
> net/bluetooth/smp.h | 6 +-
> 19 files changed, 309 insertions(+), 303 deletions(-)
>
> --
> 2.31.1.818.g46aad6cb9e-goog
>
Interesting move and good initiative!
In my opinion however, shouldn't we wait until Bluetooth SIG changes
the naming in the specification itself first (or rather push them to
make the changes in the first place)? If they are about to change
names, it would be good to make sure we end up with the same word
choices so that we don't call one thing "le peripheral initiated
feature exchange" while the standard calls it "le follower initiated
feature exchange" or similar. Using different terminology than what's
specified by the standard could easily end up in confusion I guess,
and even more if different stacks invented their own alternative
terminology.
In any case, I'm for example not sure if central/peripheral are the
best words to use, since those are tied to a specific higher level
profile (Generic Access Profile) and those words are not mentioned at
all in the spec outside that context. The SMP chapter for example uses
the terminology "initiator" and "responder", so maybe those are better
word choices, at least in SMP.
/Emil
From: Archie Pusaka <[email protected]>
Use "central" and "peripheral".
These attributes are not used elsewhere in the code.
Signed-off-by: Archie Pusaka <[email protected]>
Reviewed-by: Miao-chen Chou <[email protected]>
---
include/net/bluetooth/hci.h | 44 ++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 18742f4471ff..c3efef266d6d 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1839,23 +1839,23 @@ struct hci_rp_le_read_iso_tx_sync {
#define HCI_OP_LE_SET_CIG_PARAMS 0x2062
struct hci_cis_params {
__u8 cis_id;
- __le16 m_sdu;
- __le16 s_sdu;
- __u8 m_phy;
- __u8 s_phy;
- __u8 m_rtn;
- __u8 s_rtn;
+ __le16 c_sdu;
+ __le16 p_pdu;
+ __u8 c_phy;
+ __u8 p_phy;
+ __u8 c_rtn;
+ __u8 p_rtn;
} __packed;
struct hci_cp_le_set_cig_params {
__u8 cig_id;
- __u8 m_interval[3];
- __u8 s_interval[3];
- __u8 sca;
+ __u8 c_interval[3];
+ __u8 p_interval[3];
+ __u8 wc_sca;
__u8 packing;
__u8 framing;
- __le16 m_latency;
- __le16 s_latency;
+ __le16 c_latency;
+ __le16 p_latency;
__u8 num_cis;
struct hci_cis_params cis[];
} __packed;
@@ -2260,7 +2260,7 @@ struct hci_ev_sync_train_complete {
__u8 status;
} __packed;
-#define HCI_EV_SLAVE_PAGE_RESP_TIMEOUT 0x54
+#define HCI_EV_PERIPHERAL_PAGE_RESP_TIMEOUT 0x54
#define HCI_EV_LE_CONN_COMPLETE 0x01
struct hci_ev_le_conn_complete {
@@ -2418,17 +2418,17 @@ struct hci_evt_le_cis_established {
__le16 handle;
__u8 cig_sync_delay[3];
__u8 cis_sync_delay[3];
- __u8 m_latency[3];
- __u8 s_latency[3];
- __u8 m_phy;
- __u8 s_phy;
+ __u8 c_latency[3];
+ __u8 p_latency[3];
+ __u8 c_phy;
+ __u8 p_phy;
__u8 nse;
- __u8 m_bn;
- __u8 s_bn;
- __u8 m_ft;
- __u8 s_ft;
- __le16 m_mtu;
- __le16 s_mtu;
+ __u8 c_bn;
+ __u8 p_bn;
+ __u8 c_ft;
+ __u8 p_ft;
+ __le16 c_mtu;
+ __le16 p_mtu;
__le16 interval;
} __packed;
--
2.31.1.818.g46aad6cb9e-goog
From: Archie Pusaka <[email protected]>
Use "peripheral" and "blocked".
Signed-off-by: Archie Pusaka <[email protected]>
Reviewed-by: Miao-chen Chou <[email protected]>
---
net/bluetooth/hci_event.c | 6 +++---
net/bluetooth/hidp/core.c | 2 +-
net/bluetooth/mgmt.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 760e8e14e0f2..df5e17019e00 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -5404,7 +5404,7 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
case HCI_AUTO_CONN_DIRECT:
/* Only devices advertising with ADV_DIRECT_IND are
* triggering a connection attempt. This is allowing
- * incoming connections from slave devices.
+ * incoming connections from peripheral devices.
*/
if (adv_type != LE_ADV_DIRECT_IND)
return NULL;
@@ -5412,8 +5412,8 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
case HCI_AUTO_CONN_ALWAYS:
/* Devices advertising with ADV_IND or ADV_DIRECT_IND
* are triggering a connection attempt. This means
- * that incoming connections from slave device are
- * accepted and also outgoing connections to slave
+ * that incoming connections from peripheral device are
+ * accepted and also outgoing connections to peripheral
* devices are established when found.
*/
break;
diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 0db48c812662..96fedef14723 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -794,7 +794,7 @@ static int hidp_setup_hid(struct hidp_session *session,
hid->dev.parent = &session->conn->hcon->dev;
hid->ll_driver = &hidp_hid_driver;
- /* True if device is blacklisted in drivers/hid/hid-quirks.c */
+ /* True if device is blocked in drivers/hid/hid-quirks.c */
if (hid_ignore(hid)) {
hid_destroy_device(session->hid);
session->hid = NULL;
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index b6fa0333ca8c..9d316518bbe2 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2959,7 +2959,7 @@ static int pair_device(struct sock *sk, struct hci_dev *hdev, void *data,
/* When pairing a new device, it is expected to remember
* this device for future connections. Adding the connection
* parameter information ahead of time allows tracking
- * of the slave preferred values and will speed up any
+ * of the peripheral preferred values and will speed up any
* further connection establishment.
*
* If connection parameters already exist, then they
--
2.31.1.818.g46aad6cb9e-goog