summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPaul Fagerburg <pfagerburg@google.com>2020-07-27 15:52:15 -0600
committerCommit Bot <commit-bot@chromium.org>2020-07-28 22:59:41 +0000
commit6efabc79d3519baa56ba1c065035a491fc6918ec (patch)
tree9981d7bbdc897ef485226c8f13000c4a2ef83403 /common
parent63498074bd3a77b28d2a96ef43aeceed51aa2bde (diff)
downloadchrome-ec-6efabc79d3519baa56ba1c065035a491fc6918ec.tar.gz
ec: change usage of whitelist/blacklist
Google is working to change its source code to use more inclusive language. To that end, replace the terms "whitelist", "blacklist", and similar with inclusive alternatives. BUG=b:162262297 BRANCH=None TEST=`grep -Eirl "(white|black)[ _\-]*list" .` The only results are in "private/nordic_keyboard/sdk8.0.0" which is not our code. Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Ie5210b98e1096c22d0e9284c101a42820bd3d79d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2321549 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/btle_hci_controller.c40
-rw-r--r--common/btle_ll.c20
-rw-r--r--common/usb_pd_dual_role.c2
-rw-r--r--common/usb_pd_protocol.c8
-rw-r--r--common/usbc/usb_pe_drp_sm.c8
5 files changed, 39 insertions, 39 deletions
diff --git a/common/btle_hci_controller.c b/common/btle_hci_controller.c
index 903e9d5624..cc5b872b19 100644
--- a/common/btle_hci_controller.c
+++ b/common/btle_hci_controller.c
@@ -215,36 +215,36 @@ void hci_cmd(uint8_t *hciCmdbuf)
STATUS = ll_set_scan_params(params);
break;
- /* White List */
+ /* Allow List */
case CMD_MAKE_OPCODE(HCI_OGF_LE,
- HCI_CMD_LE_Clear_White_List):
+ HCI_CMD_LE_Clear_Allow_List):
if (hdr->paramLen != 0)
STATUS = HCI_ERR_Invalid_HCI_Command_Parameters;
else
- STATUS = ll_clear_white_list();
+ STATUS = ll_clear_allow_list();
break;
case CMD_MAKE_OPCODE(HCI_OGF_LE,
- HCI_CMD_LE_Read_White_List_Size):
+ HCI_CMD_LE_Read_Allow_List_Size):
if (hdr->paramLen != 0)
STATUS = HCI_ERR_Invalid_HCI_Command_Parameters;
else
- STATUS = ll_read_white_list_size(RPARAMS);
- rparam_count = sizeof(struct hciCmplLeReadWhiteListSize);
+ STATUS = ll_read_allow_list_size(RPARAMS);
+ rparam_count = sizeof(struct hciCmplLeReadAllowListSize);
break;
case CMD_MAKE_OPCODE(HCI_OGF_LE,
- HCI_CMD_LE_Add_Device_To_White_List):
- if (hdr->paramLen != sizeof(struct hciLeAddDeviceToWhiteList))
+ HCI_CMD_LE_Add_Device_To_Allow_List):
+ if (hdr->paramLen != sizeof(struct hciLeAddDeviceToAllowList))
STATUS = HCI_ERR_Invalid_HCI_Command_Parameters;
else
- STATUS = ll_add_device_to_white_list(params);
+ STATUS = ll_add_device_to_allow_list(params);
break;
case CMD_MAKE_OPCODE(HCI_OGF_LE,
- HCI_CMD_LE_Remove_Device_From_White_List):
+ HCI_CMD_LE_Remove_Device_From_Allow_List):
if (hdr->paramLen !=
- sizeof(struct hciLeRemoveDeviceFromWhiteList))
+ sizeof(struct hciLeRemoveDeviceFromAllowList))
STATUS = HCI_ERR_Invalid_HCI_Command_Parameters;
else
- STATUS = ll_remove_device_from_white_list(params);
+ STATUS = ll_remove_device_from_allow_list(params);
break;
/* RFPHY Testing Support */
@@ -416,31 +416,31 @@ uint8_t *adv_params[] = {adv_param0, adv_param1};
*
*/
-/* White list commands:
+/* Allow list commands:
*
- * Read White list size
+ * Read allow list size
* hcitool cmd 8 F
*
- * Clear white list
+ * Clear allow list
* hcitool cmd 8 10
*
- * Add device to white list (Public C5A4A3A2A1A0)
+ * Add device to allow list (Public C5A4A3A2A1A0)
* hcitool cmd 8 11 0 a0 a1 a2 a3 a4 c5
* hcitool lcmd 0x2011 7 0xA2A1A000 0xC5A4A3
*
- * Add device to white list (Random C5B4B3B2B1B0)
+ * Add device to allow list (Random C5B4B3B2B1B0)
* hcitool cmd 8 11 1 b0 b1 b2 b4 b5 c5
* hcitool lcmd 0x2011 7 0xB2B1B001 0xC5B4B3
*
- * Remove device from white list (Public C5A4A3A2A1A0)
+ * Remove device from allow list (Public C5A4A3A2A1A0)
* hcitool cmd 8 12 0 a0 a1 a2 a3 a4 c5
* hcitool lcmd 0x2012 7 0xA2A1A000 0xC5A4A3
*
- * Remove device from white list (Random C5B4B3B2B1B0)
+ * Remove device from allow list (Random C5B4B3B2B1B0)
* hcitool cmd 8 12 1 b0 b1 b2 b4 b5 c5
* hcitool lcmd 0x2012 7 0xB2B1B001 0xC5B4B3
*
- * Tested by checking dumping the white list and checking its size when:
+ * Tested by checking dumping the allow list and checking its size when:
* - adding devices
* - removing devices
* - removing non-existent devices
diff --git a/common/btle_ll.c b/common/btle_ll.c
index cecbb3058a..b2a15ce36e 100644
--- a/common/btle_ll.c
+++ b/common/btle_ll.c
@@ -152,7 +152,7 @@ uint8_t ll_reset(void)
ll_state = UNINITIALIZED;
radio_disable();
- ble_radio_clear_white_list();
+ ble_radio_clear_allow_list();
return HCI_SUCCESS;
}
@@ -312,35 +312,35 @@ uint8_t initialize_connection(void)
return HCI_SUCCESS;
}
-/* White List */
-uint8_t ll_clear_white_list(void)
+/* Allow List */
+uint8_t ll_clear_allow_list(void)
{
- if (ble_radio_clear_white_list() == EC_SUCCESS)
+ if (ble_radio_clear_allow_list() == EC_SUCCESS)
return HCI_SUCCESS;
else
return HCI_ERR_Hardware_Failure;
}
-uint8_t ll_read_white_list_size(uint8_t *return_params)
+uint8_t ll_read_allow_list_size(uint8_t *return_params)
{
- if (ble_radio_read_white_list_size(return_params) == EC_SUCCESS)
+ if (ble_radio_read_allow_list_size(return_params) == EC_SUCCESS)
return HCI_SUCCESS;
else
return HCI_ERR_Hardware_Failure;
}
-uint8_t ll_add_device_to_white_list(uint8_t *params)
+uint8_t ll_add_device_to_allow_list(uint8_t *params)
{
- if (ble_radio_add_device_to_white_list(&params[1], params[0]) ==
+ if (ble_radio_add_device_to_allow_list(&params[1], params[0]) ==
EC_SUCCESS)
return HCI_SUCCESS;
else
return HCI_ERR_Host_Rejected_Due_To_Limited_Resources;
}
-uint8_t ll_remove_device_from_white_list(uint8_t *params)
+uint8_t ll_remove_device_from_allow_list(uint8_t *params)
{
- if (ble_radio_remove_device_from_white_list(&params[1], params[0]) ==
+ if (ble_radio_remove_device_from_allow_list(&params[1], params[0]) ==
EC_SUCCESS)
return HCI_SUCCESS;
else
diff --git a/common/usb_pd_dual_role.c b/common/usb_pd_dual_role.c
index bf5dfa06d5..daa6f6dc86 100644
--- a/common/usb_pd_dual_role.c
+++ b/common/usb_pd_dual_role.c
@@ -337,7 +337,7 @@ int pd_charge_from_device(uint16_t vid, uint16_t pid)
{
/* TODO: rewrite into table if we get more of these */
/*
- * White-list Apple charge-through accessory since it doesn't set
+ * Allow the Apple charge-through accessory since it doesn't set
* unconstrained bit, but we still need to charge from it when
* we are a sink.
*/
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 1d465385ea..b3be338d64 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -1478,12 +1478,12 @@ static void pd_update_pdo_flags(int port, uint32_t pdo)
{
#ifdef CONFIG_CHARGE_MANAGER
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
- int charge_whitelisted =
+ int charge_allowlisted =
(pd[port].power_role == PD_ROLE_SINK &&
pd_charge_from_device(pd_get_identity_vid(port),
pd_get_identity_pid(port)));
#else
- const int charge_whitelisted = 0;
+ const int charge_allowlisted = 0;
#endif
#endif
@@ -1518,11 +1518,11 @@ static void pd_update_pdo_flags(int port, uint32_t pdo)
* Treat device as a dedicated charger (meaning we should charge
* from it) if it does not support power swap, or has unconstrained
* power, or if we are a sink and the device identity matches a
- * charging white-list.
+ * charging allow-list.
*/
if (!(pd[port].flags & PD_FLAGS_PARTNER_DR_POWER) ||
(pd[port].flags & PD_FLAGS_PARTNER_UNCONSTR) ||
- charge_whitelisted)
+ charge_allowlisted)
charge_manager_update_dualrole(port, CAP_DEDICATED);
else
charge_manager_update_dualrole(port, CAP_DUALROLE);
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 6d39e2ad89..7aac1a58a7 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -1249,12 +1249,12 @@ static void pe_update_pdo_flags(int port, uint32_t pdo)
{
#ifdef CONFIG_CHARGE_MANAGER
#ifdef CONFIG_USB_PD_ALT_MODE_DFP
- int charge_whitelisted =
+ int charge_allowlisted =
(pd_get_power_role(port) == PD_ROLE_SINK &&
pd_charge_from_device(pd_get_identity_vid(port),
pd_get_identity_pid(port)));
#else
- const int charge_whitelisted = 0;
+ const int charge_allowlisted = 0;
#endif
#endif
@@ -1287,10 +1287,10 @@ static void pe_update_pdo_flags(int port, uint32_t pdo)
* Treat device as a dedicated charger (meaning we should charge
* from it) if it does not support power swap, or if it is unconstrained
* power, or if we are a sink and the device identity matches a
- * charging white-list.
+ * charging allow-list.
*/
if (!(pdo & PDO_FIXED_DUAL_ROLE) || (pdo & PDO_FIXED_UNCONSTRAINED) ||
- charge_whitelisted) {
+ charge_allowlisted) {
PE_CLR_FLAG(port, PE_FLAGS_PORT_PARTNER_IS_DUALROLE);
charge_manager_update_dualrole(port, CAP_DEDICATED);
} else {