Skip to content

Commit 3d4f9c0

Browse files
apusakaholtmann
authored andcommitted
Bluetooth: use inclusive language when filtering devices
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: blacklist -> reject list whitelist -> accept list Signed-off-by: Archie Pusaka <[email protected]> Reviewed-by: Miao-chen Chou <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 39bc74c commit 3d4f9c0

File tree

9 files changed

+123
-122
lines changed

9 files changed

+123
-122
lines changed

include/net/bluetooth/hci.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ struct hci_cp_le_set_scan_enable {
15051505
} __packed;
15061506

15071507
#define HCI_LE_USE_PEER_ADDR 0x00
1508-
#define HCI_LE_USE_WHITELIST 0x01
1508+
#define HCI_LE_USE_ACCEPT_LIST 0x01
15091509

15101510
#define HCI_OP_LE_CREATE_CONN 0x200d
15111511
struct hci_cp_le_create_conn {
@@ -1525,22 +1525,22 @@ struct hci_cp_le_create_conn {
15251525

15261526
#define HCI_OP_LE_CREATE_CONN_CANCEL 0x200e
15271527

1528-
#define HCI_OP_LE_READ_WHITE_LIST_SIZE 0x200f
1529-
struct hci_rp_le_read_white_list_size {
1528+
#define HCI_OP_LE_READ_ACCEPT_LIST_SIZE 0x200f
1529+
struct hci_rp_le_read_accept_list_size {
15301530
__u8 status;
15311531
__u8 size;
15321532
} __packed;
15331533

1534-
#define HCI_OP_LE_CLEAR_WHITE_LIST 0x2010
1534+
#define HCI_OP_LE_CLEAR_ACCEPT_LIST 0x2010
15351535

1536-
#define HCI_OP_LE_ADD_TO_WHITE_LIST 0x2011
1537-
struct hci_cp_le_add_to_white_list {
1536+
#define HCI_OP_LE_ADD_TO_ACCEPT_LIST 0x2011
1537+
struct hci_cp_le_add_to_accept_list {
15381538
__u8 bdaddr_type;
15391539
bdaddr_t bdaddr;
15401540
} __packed;
15411541

1542-
#define HCI_OP_LE_DEL_FROM_WHITE_LIST 0x2012
1543-
struct hci_cp_le_del_from_white_list {
1542+
#define HCI_OP_LE_DEL_FROM_ACCEPT_LIST 0x2012
1543+
struct hci_cp_le_del_from_accept_list {
15441544
__u8 bdaddr_type;
15451545
bdaddr_t bdaddr;
15461546
} __packed;

include/net/bluetooth/hci_core.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ struct hci_dev {
327327
__u8 max_page;
328328
__u8 features[HCI_MAX_PAGES][8];
329329
__u8 le_features[8];
330-
__u8 le_white_list_size;
330+
__u8 le_accept_list_size;
331331
__u8 le_resolv_list_size;
332332
__u8 le_num_of_adv_sets;
333333
__u8 le_states[8];
@@ -522,14 +522,14 @@ struct hci_dev {
522522
struct hci_conn_hash conn_hash;
523523

524524
struct list_head mgmt_pending;
525-
struct list_head blacklist;
526-
struct list_head whitelist;
525+
struct list_head reject_list;
526+
struct list_head accept_list;
527527
struct list_head uuids;
528528
struct list_head link_keys;
529529
struct list_head long_term_keys;
530530
struct list_head identity_resolving_keys;
531531
struct list_head remote_oob_data;
532-
struct list_head le_white_list;
532+
struct list_head le_accept_list;
533533
struct list_head le_resolv_list;
534534
struct list_head le_conn_params;
535535
struct list_head pend_le_conns;

net/bluetooth/hci_core.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -749,14 +749,14 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt)
749749
}
750750

751751
if (hdev->commands[26] & 0x40) {
752-
/* Read LE White List Size */
753-
hci_req_add(req, HCI_OP_LE_READ_WHITE_LIST_SIZE,
752+
/* Read LE Accept List Size */
753+
hci_req_add(req, HCI_OP_LE_READ_ACCEPT_LIST_SIZE,
754754
0, NULL);
755755
}
756756

757757
if (hdev->commands[26] & 0x80) {
758-
/* Clear LE White List */
759-
hci_req_add(req, HCI_OP_LE_CLEAR_WHITE_LIST, 0, NULL);
758+
/* Clear LE Accept List */
759+
hci_req_add(req, HCI_OP_LE_CLEAR_ACCEPT_LIST, 0, NULL);
760760
}
761761

762762
if (hdev->commands[34] & 0x40) {
@@ -3713,13 +3713,13 @@ static int hci_suspend_notifier(struct notifier_block *nb, unsigned long action,
37133713
/* Suspend consists of two actions:
37143714
* - First, disconnect everything and make the controller not
37153715
* connectable (disabling scanning)
3716-
* - Second, program event filter/whitelist and enable scan
3716+
* - Second, program event filter/accept list and enable scan
37173717
*/
37183718
ret = hci_change_suspend_state(hdev, BT_SUSPEND_DISCONNECT);
37193719
if (!ret)
37203720
state = BT_SUSPEND_DISCONNECT;
37213721

3722-
/* Only configure whitelist if disconnect succeeded and wake
3722+
/* Only configure accept list if disconnect succeeded and wake
37233723
* isn't being prevented.
37243724
*/
37253725
if (!ret && !(hdev->prevent_wake && hdev->prevent_wake(hdev))) {
@@ -3827,14 +3827,14 @@ struct hci_dev *hci_alloc_dev(void)
38273827
mutex_init(&hdev->req_lock);
38283828

38293829
INIT_LIST_HEAD(&hdev->mgmt_pending);
3830-
INIT_LIST_HEAD(&hdev->blacklist);
3831-
INIT_LIST_HEAD(&hdev->whitelist);
3830+
INIT_LIST_HEAD(&hdev->reject_list);
3831+
INIT_LIST_HEAD(&hdev->accept_list);
38323832
INIT_LIST_HEAD(&hdev->uuids);
38333833
INIT_LIST_HEAD(&hdev->link_keys);
38343834
INIT_LIST_HEAD(&hdev->long_term_keys);
38353835
INIT_LIST_HEAD(&hdev->identity_resolving_keys);
38363836
INIT_LIST_HEAD(&hdev->remote_oob_data);
3837-
INIT_LIST_HEAD(&hdev->le_white_list);
3837+
INIT_LIST_HEAD(&hdev->le_accept_list);
38383838
INIT_LIST_HEAD(&hdev->le_resolv_list);
38393839
INIT_LIST_HEAD(&hdev->le_conn_params);
38403840
INIT_LIST_HEAD(&hdev->pend_le_conns);
@@ -4047,16 +4047,16 @@ void hci_unregister_dev(struct hci_dev *hdev)
40474047
destroy_workqueue(hdev->req_workqueue);
40484048

40494049
hci_dev_lock(hdev);
4050-
hci_bdaddr_list_clear(&hdev->blacklist);
4051-
hci_bdaddr_list_clear(&hdev->whitelist);
4050+
hci_bdaddr_list_clear(&hdev->reject_list);
4051+
hci_bdaddr_list_clear(&hdev->accept_list);
40524052
hci_uuids_clear(hdev);
40534053
hci_link_keys_clear(hdev);
40544054
hci_smp_ltks_clear(hdev);
40554055
hci_smp_irks_clear(hdev);
40564056
hci_remote_oob_data_clear(hdev);
40574057
hci_adv_instances_clear(hdev);
40584058
hci_adv_monitors_clear(hdev);
4059-
hci_bdaddr_list_clear(&hdev->le_white_list);
4059+
hci_bdaddr_list_clear(&hdev->le_accept_list);
40604060
hci_bdaddr_list_clear(&hdev->le_resolv_list);
40614061
hci_conn_params_clear_all(hdev);
40624062
hci_discovery_filter_clear(hdev);

net/bluetooth/hci_debugfs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int device_list_show(struct seq_file *f, void *ptr)
125125
struct bdaddr_list *b;
126126

127127
hci_dev_lock(hdev);
128-
list_for_each_entry(b, &hdev->whitelist, list)
128+
list_for_each_entry(b, &hdev->accept_list, list)
129129
seq_printf(f, "%pMR (type %u)\n", &b->bdaddr, b->bdaddr_type);
130130
list_for_each_entry(p, &hdev->le_conn_params, list) {
131131
seq_printf(f, "%pMR (type %u) %u\n", &p->addr, p->addr_type,
@@ -144,7 +144,7 @@ static int blacklist_show(struct seq_file *f, void *p)
144144
struct bdaddr_list *b;
145145

146146
hci_dev_lock(hdev);
147-
list_for_each_entry(b, &hdev->blacklist, list)
147+
list_for_each_entry(b, &hdev->reject_list, list)
148148
seq_printf(f, "%pMR (type %u)\n", &b->bdaddr, b->bdaddr_type);
149149
hci_dev_unlock(hdev);
150150

@@ -784,7 +784,7 @@ static int white_list_show(struct seq_file *f, void *ptr)
784784
struct bdaddr_list *b;
785785

786786
hci_dev_lock(hdev);
787-
list_for_each_entry(b, &hdev->le_white_list, list)
787+
list_for_each_entry(b, &hdev->le_accept_list, list)
788788
seq_printf(f, "%pMR (type %u)\n", &b->bdaddr, b->bdaddr_type);
789789
hci_dev_unlock(hdev);
790790

@@ -1195,7 +1195,7 @@ void hci_debugfs_create_le(struct hci_dev *hdev)
11951195
&force_static_address_fops);
11961196

11971197
debugfs_create_u8("white_list_size", 0444, hdev->debugfs,
1198-
&hdev->le_white_list_size);
1198+
&hdev->le_accept_list_size);
11991199
debugfs_create_file("white_list", 0444, hdev->debugfs, hdev,
12001200
&white_list_fops);
12011201
debugfs_create_u8("resolv_list_size", 0444, hdev->debugfs,

net/bluetooth/hci_event.c

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static void hci_cc_reset(struct hci_dev *hdev, struct sk_buff *skb)
236236

237237
hdev->ssp_debug_mode = 0;
238238

239-
hci_bdaddr_list_clear(&hdev->le_white_list);
239+
hci_bdaddr_list_clear(&hdev->le_accept_list);
240240
hci_bdaddr_list_clear(&hdev->le_resolv_list);
241241
}
242242

@@ -1492,21 +1492,21 @@ static void hci_cc_le_read_num_adv_sets(struct hci_dev *hdev,
14921492
hdev->le_num_of_adv_sets = rp->num_of_sets;
14931493
}
14941494

1495-
static void hci_cc_le_read_white_list_size(struct hci_dev *hdev,
1496-
struct sk_buff *skb)
1495+
static void hci_cc_le_read_accept_list_size(struct hci_dev *hdev,
1496+
struct sk_buff *skb)
14971497
{
1498-
struct hci_rp_le_read_white_list_size *rp = (void *) skb->data;
1498+
struct hci_rp_le_read_accept_list_size *rp = (void *)skb->data;
14991499

15001500
BT_DBG("%s status 0x%2.2x size %u", hdev->name, rp->status, rp->size);
15011501

15021502
if (rp->status)
15031503
return;
15041504

1505-
hdev->le_white_list_size = rp->size;
1505+
hdev->le_accept_list_size = rp->size;
15061506
}
15071507

1508-
static void hci_cc_le_clear_white_list(struct hci_dev *hdev,
1509-
struct sk_buff *skb)
1508+
static void hci_cc_le_clear_accept_list(struct hci_dev *hdev,
1509+
struct sk_buff *skb)
15101510
{
15111511
__u8 status = *((__u8 *) skb->data);
15121512

@@ -1515,44 +1515,44 @@ static void hci_cc_le_clear_white_list(struct hci_dev *hdev,
15151515
if (status)
15161516
return;
15171517

1518-
hci_bdaddr_list_clear(&hdev->le_white_list);
1518+
hci_bdaddr_list_clear(&hdev->le_accept_list);
15191519
}
15201520

1521-
static void hci_cc_le_add_to_white_list(struct hci_dev *hdev,
1522-
struct sk_buff *skb)
1521+
static void hci_cc_le_add_to_accept_list(struct hci_dev *hdev,
1522+
struct sk_buff *skb)
15231523
{
1524-
struct hci_cp_le_add_to_white_list *sent;
1524+
struct hci_cp_le_add_to_accept_list *sent;
15251525
__u8 status = *((__u8 *) skb->data);
15261526

15271527
BT_DBG("%s status 0x%2.2x", hdev->name, status);
15281528

15291529
if (status)
15301530
return;
15311531

1532-
sent = hci_sent_cmd_data(hdev, HCI_OP_LE_ADD_TO_WHITE_LIST);
1532+
sent = hci_sent_cmd_data(hdev, HCI_OP_LE_ADD_TO_ACCEPT_LIST);
15331533
if (!sent)
15341534
return;
15351535

1536-
hci_bdaddr_list_add(&hdev->le_white_list, &sent->bdaddr,
1537-
sent->bdaddr_type);
1536+
hci_bdaddr_list_add(&hdev->le_accept_list, &sent->bdaddr,
1537+
sent->bdaddr_type);
15381538
}
15391539

1540-
static void hci_cc_le_del_from_white_list(struct hci_dev *hdev,
1541-
struct sk_buff *skb)
1540+
static void hci_cc_le_del_from_accept_list(struct hci_dev *hdev,
1541+
struct sk_buff *skb)
15421542
{
1543-
struct hci_cp_le_del_from_white_list *sent;
1543+
struct hci_cp_le_del_from_accept_list *sent;
15441544
__u8 status = *((__u8 *) skb->data);
15451545

15461546
BT_DBG("%s status 0x%2.2x", hdev->name, status);
15471547

15481548
if (status)
15491549
return;
15501550

1551-
sent = hci_sent_cmd_data(hdev, HCI_OP_LE_DEL_FROM_WHITE_LIST);
1551+
sent = hci_sent_cmd_data(hdev, HCI_OP_LE_DEL_FROM_ACCEPT_LIST);
15521552
if (!sent)
15531553
return;
15541554

1555-
hci_bdaddr_list_del(&hdev->le_white_list, &sent->bdaddr,
1555+
hci_bdaddr_list_del(&hdev->le_accept_list, &sent->bdaddr,
15561556
sent->bdaddr_type);
15571557
}
15581558

@@ -2367,7 +2367,7 @@ static void cs_le_create_conn(struct hci_dev *hdev, bdaddr_t *peer_addr,
23672367
/* We don't want the connection attempt to stick around
23682368
* indefinitely since LE doesn't have a page timeout concept
23692369
* like BR/EDR. Set a timer for any connection that doesn't use
2370-
* the white list for connecting.
2370+
* the accept list for connecting.
23712371
*/
23722372
if (filter_policy == HCI_LE_USE_PEER_ADDR)
23732373
queue_delayed_work(conn->hdev->workqueue,
@@ -2623,7 +2623,7 @@ static void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
26232623
* only used during suspend.
26242624
*/
26252625
if (ev->link_type == ACL_LINK &&
2626-
hci_bdaddr_list_lookup_with_flags(&hdev->whitelist,
2626+
hci_bdaddr_list_lookup_with_flags(&hdev->accept_list,
26272627
&ev->bdaddr,
26282628
BDADDR_BREDR)) {
26292629
conn = hci_conn_add(hdev, ev->link_type, &ev->bdaddr,
@@ -2745,19 +2745,19 @@ static void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
27452745
return;
27462746
}
27472747

2748-
if (hci_bdaddr_list_lookup(&hdev->blacklist, &ev->bdaddr,
2748+
if (hci_bdaddr_list_lookup(&hdev->reject_list, &ev->bdaddr,
27492749
BDADDR_BREDR)) {
27502750
hci_reject_conn(hdev, &ev->bdaddr);
27512751
return;
27522752
}
27532753

2754-
/* Require HCI_CONNECTABLE or a whitelist entry to accept the
2754+
/* Require HCI_CONNECTABLE or an accept list entry to accept the
27552755
* connection. These features are only touched through mgmt so
27562756
* only do the checks if HCI_MGMT is set.
27572757
*/
27582758
if (hci_dev_test_flag(hdev, HCI_MGMT) &&
27592759
!hci_dev_test_flag(hdev, HCI_CONNECTABLE) &&
2760-
!hci_bdaddr_list_lookup_with_flags(&hdev->whitelist, &ev->bdaddr,
2760+
!hci_bdaddr_list_lookup_with_flags(&hdev->accept_list, &ev->bdaddr,
27612761
BDADDR_BREDR)) {
27622762
hci_reject_conn(hdev, &ev->bdaddr);
27632763
return;
@@ -3538,20 +3538,20 @@ static void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *skb,
35383538
hci_cc_le_set_scan_enable(hdev, skb);
35393539
break;
35403540

3541-
case HCI_OP_LE_READ_WHITE_LIST_SIZE:
3542-
hci_cc_le_read_white_list_size(hdev, skb);
3541+
case HCI_OP_LE_READ_ACCEPT_LIST_SIZE:
3542+
hci_cc_le_read_accept_list_size(hdev, skb);
35433543
break;
35443544

3545-
case HCI_OP_LE_CLEAR_WHITE_LIST:
3546-
hci_cc_le_clear_white_list(hdev, skb);
3545+
case HCI_OP_LE_CLEAR_ACCEPT_LIST:
3546+
hci_cc_le_clear_accept_list(hdev, skb);
35473547
break;
35483548

3549-
case HCI_OP_LE_ADD_TO_WHITE_LIST:
3550-
hci_cc_le_add_to_white_list(hdev, skb);
3549+
case HCI_OP_LE_ADD_TO_ACCEPT_LIST:
3550+
hci_cc_le_add_to_accept_list(hdev, skb);
35513551
break;
35523552

3553-
case HCI_OP_LE_DEL_FROM_WHITE_LIST:
3554-
hci_cc_le_del_from_white_list(hdev, skb);
3553+
case HCI_OP_LE_DEL_FROM_ACCEPT_LIST:
3554+
hci_cc_le_del_from_accept_list(hdev, skb);
35553555
break;
35563556

35573557
case HCI_OP_LE_READ_SUPPORTED_STATES:
@@ -5132,7 +5132,7 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
51325132

51335133
/* If we didn't have a hci_conn object previously
51345134
* but we're in central role this must be something
5135-
* initiated using a white list. Since white list based
5135+
* initiated using an accept list. Since accept list based
51365136
* connections are not "first class citizens" we don't
51375137
* have full tracking of them. Therefore, we go ahead
51385138
* with a "best effort" approach of determining the
@@ -5224,7 +5224,7 @@ static void le_conn_complete_evt(struct hci_dev *hdev, u8 status,
52245224
addr_type = BDADDR_LE_RANDOM;
52255225

52265226
/* Drop the connection if the device is blocked */
5227-
if (hci_bdaddr_list_lookup(&hdev->blacklist, &conn->dst, addr_type)) {
5227+
if (hci_bdaddr_list_lookup(&hdev->reject_list, &conn->dst, addr_type)) {
52285228
hci_conn_drop(conn);
52295229
goto unlock;
52305230
}
@@ -5380,7 +5380,7 @@ static struct hci_conn *check_pending_le_conn(struct hci_dev *hdev,
53805380
return NULL;
53815381

53825382
/* Ignore if the device is blocked */
5383-
if (hci_bdaddr_list_lookup(&hdev->blacklist, addr, addr_type))
5383+
if (hci_bdaddr_list_lookup(&hdev->reject_list, addr, addr_type))
53845384
return NULL;
53855385

53865386
/* Most controller will fail if we try to create new connections

0 commit comments

Comments
 (0)