diff options
author | Paul Fagerburg <pfagerburg@google.com> | 2020-07-27 15:52:15 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-28 22:59:41 +0000 |
commit | 6efabc79d3519baa56ba1c065035a491fc6918ec (patch) | |
tree | 9981d7bbdc897ef485226c8f13000c4a2ef83403 | |
parent | 63498074bd3a77b28d2a96ef43aeceed51aa2bde (diff) | |
download | chrome-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>
-rw-r--r-- | chip/nrf51/bluetooth_le.c | 10 | ||||
-rw-r--r-- | chip/nrf51/bluetooth_le.h | 14 | ||||
-rw-r--r-- | common/btle_hci_controller.c | 40 | ||||
-rw-r--r-- | common/btle_ll.c | 20 | ||||
-rw-r--r-- | common/usb_pd_dual_role.c | 2 | ||||
-rw-r--r-- | common/usb_pd_protocol.c | 8 | ||||
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 8 | ||||
-rwxr-xr-x | extra/cr50_rma_open/cr50_rma_open.py | 2 | ||||
-rw-r--r-- | include/bluetooth_le.h | 10 | ||||
-rw-r--r-- | include/bluetooth_le_ll.h | 10 | ||||
-rw-r--r-- | include/btle_hci_int.h | 26 | ||||
-rw-r--r-- | include/usb_pd.h | 2 | ||||
-rwxr-xr-x | util/config_option_check.py | 6 |
13 files changed, 79 insertions, 79 deletions
diff --git a/chip/nrf51/bluetooth_le.c b/chip/nrf51/bluetooth_le.c index 6fe123ac4e..89eb117efd 100644 --- a/chip/nrf51/bluetooth_le.c +++ b/chip/nrf51/bluetooth_le.c @@ -213,14 +213,14 @@ int ble_rx(struct ble_pdu *pdu, int timeout, int adv) return EC_SUCCESS; } -/* White list handling */ -int ble_radio_clear_white_list(void) +/* Allow list handling */ +int ble_radio_clear_allow_list(void) { NRF51_RADIO_DACNF = 0; return EC_SUCCESS; } -int ble_radio_read_white_list_size(uint8_t *ret_size) +int ble_radio_read_allow_list_size(uint8_t *ret_size) { int i, size = 0; uint32_t dacnf = NRF51_RADIO_DACNF; @@ -235,7 +235,7 @@ int ble_radio_read_white_list_size(uint8_t *ret_size) return EC_SUCCESS; } -int ble_radio_add_device_to_white_list(const uint8_t *addr_ptr, uint8_t rand) +int ble_radio_add_device_to_allow_list(const uint8_t *addr_ptr, uint8_t rand) { uint32_t dacnf = NRF51_RADIO_DACNF; int i; @@ -262,7 +262,7 @@ int ble_radio_add_device_to_white_list(const uint8_t *addr_ptr, uint8_t rand) return EC_SUCCESS; } -int ble_radio_remove_device_from_white_list(const uint8_t *addr_ptr, +int ble_radio_remove_device_from_allow_list(const uint8_t *addr_ptr, uint8_t rand) { int i, dacnf = NRF51_RADIO_DACNF; diff --git a/chip/nrf51/bluetooth_le.h b/chip/nrf51/bluetooth_le.h index a2b3807a7e..dbb3bccd6e 100644 --- a/chip/nrf51/bluetooth_le.h +++ b/chip/nrf51/bluetooth_le.h @@ -52,19 +52,19 @@ void ble_tx(struct ble_pdu *pdu); /* Receive a packet into pdu if one comes before the timeout */ int ble_rx(struct ble_pdu *pdu, int timeout, int adv); -/* White list handling */ +/* Allow list handling */ -/* Clear the white list */ -int ble_radio_clear_white_list(void); +/* Clear the allow list */ +int ble_radio_clear_allow_list(void); -/* Read the size of the white list and assign it to ret_size */ -int ble_radio_read_white_list_size(uint8_t *ret_size); +/* Read the size of the allow list and assign it to ret_size */ +int ble_radio_read_allow_list_size(uint8_t *ret_size); /* Add the device with the address specified by addr_ptr and type */ -int ble_radio_add_device_to_white_list(const uint8_t *addr_ptr, uint8_t type); +int ble_radio_add_device_to_allow_list(const uint8_t *addr_ptr, uint8_t type); /* Remove the device with the address specified by addr_ptr and type */ -int ble_radio_remove_device_from_white_list(const uint8_t *addr_ptr, +int ble_radio_remove_device_from_allow_list(const uint8_t *addr_ptr, uint8_t type); #endif /* __NRF51_BLUETOOTH_LE_H */ 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(¶ms[1], params[0]) == + if (ble_radio_add_device_to_allow_list(¶ms[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(¶ms[1], params[0]) == + if (ble_radio_remove_device_from_allow_list(¶ms[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 { diff --git a/extra/cr50_rma_open/cr50_rma_open.py b/extra/cr50_rma_open/cr50_rma_open.py index 08e838c7c9..42ddbbac2d 100755 --- a/extra/cr50_rma_open/cr50_rma_open.py +++ b/extra/cr50_rma_open/cr50_rma_open.py @@ -262,7 +262,7 @@ class RMAOpen(object): url = URL % (challenge, hwid) logging.info('GOTO:\n %s', url) logging.info('If the server fails to debug the challenge make sure the ' - 'RLZ is whitelisted') + 'RLZ is allowlisted') def try_authcode(self, authcode): """Try opening cr50 with the authcode diff --git a/include/bluetooth_le.h b/include/bluetooth_le.h index 1842b57adc..286653dda6 100644 --- a/include/bluetooth_le.h +++ b/include/bluetooth_le.h @@ -382,11 +382,11 @@ void dump_ble_addr(uint8_t *mem, char *name); void dump_ble_packet(struct ble_pdu *ble_p); -/* Radio-specific white list handling */ -int ble_radio_clear_white_list(void); -int ble_radio_read_white_list_size(uint8_t *ret_size); -int ble_radio_add_device_to_white_list(const uint8_t *addr_ptr, uint8_t rand); -int ble_radio_remove_device_from_white_list(const uint8_t *addr_ptr, +/* Radio-specific allow list handling */ +int ble_radio_clear_allow_list(void); +int ble_radio_read_allow_list_size(uint8_t *ret_size); +int ble_radio_add_device_to_allow_list(const uint8_t *addr_ptr, uint8_t rand); +int ble_radio_remove_device_from_allow_list(const uint8_t *addr_ptr, uint8_t rand); #endif /* __CROS_EC_BLE_H */ diff --git a/include/bluetooth_le_ll.h b/include/bluetooth_le_ll.h index dd1f9155fd..8e46f1dc22 100644 --- a/include/bluetooth_le_ll.h +++ b/include/bluetooth_le_ll.h @@ -137,11 +137,11 @@ uint8_t ll_set_random_address(uint8_t *params); uint8_t ll_set_scan_enable(uint8_t *params); uint8_t ll_set_scan_params(uint8_t *params); -/* White List */ -uint8_t ll_clear_white_list(void); -uint8_t ll_read_white_list_size(uint8_t *return_params); -uint8_t ll_add_device_to_white_list(uint8_t *params); -uint8_t ll_remove_device_from_white_list(uint8_t *params); +/* Allow List */ +uint8_t ll_clear_allow_list(void); +uint8_t ll_read_allow_list_size(uint8_t *return_params); +uint8_t ll_add_device_to_allow_list(uint8_t *params); +uint8_t ll_remove_device_from_allow_list(uint8_t *params); /* Connections */ uint8_t ll_read_remote_used_features(uint8_t *params); diff --git a/include/btle_hci_int.h b/include/btle_hci_int.h index 32349eff61..ba0b3e6041 100644 --- a/include/btle_hci_int.h +++ b/include/btle_hci_int.h @@ -2236,7 +2236,7 @@ struct hciLeSetScanParams { uint16_t scanInterval; /* in units of 0.625ms, 4..0x4000 */ uint16_t scanWindow; /* in units of 0.625ms, 4..0x4000 */ uint8_t useOwnRandomAddr; - uint8_t onlyWhitelist; + uint8_t onlyAllowlist; } __packed; struct hciCmplLeSetScanParams { uint8_t status; @@ -2255,7 +2255,7 @@ struct hciCmplLeSetScanEnable { struct hciLeCreateConnection { uint16_t scanInterval; /* in units of 0.625ms, 4..0x4000 */ uint16_t scanWindow; /* in units of 0.625ms, 4..0x4000 */ - uint8_t connectToAnyWhitelistedDevice; /* if so, ignore next 2 params */ + uint8_t connectToAnyAllowlistedDevice; /* if so, ignore next 2 params */ uint8_t peerRandomAddr; uint8_t peerMac[6]; uint8_t useOwnRandomAddr; @@ -2272,32 +2272,32 @@ struct hciCmplLeCreateConnectionCancel { uint8_t status; } __packed; -#define HCI_CMD_LE_Read_White_List_Size 0x000F /* complete */ -struct hciCmplLeReadWhiteListSize { +#define HCI_CMD_LE_Read_Allow_List_Size 0x000F /* complete */ +struct hciCmplLeReadAllowListSize { uint8_t status; - uint8_t whitelistSize; + uint8_t allowlistSize; } __packed; -#define HCI_CMD_LE_Clear_White_List 0x0010 /* complete */ -struct hciCmplLeClearWhiteList { +#define HCI_CMD_LE_Clear_Allow_List 0x0010 /* complete */ +struct hciCmplLeClearAllowList { uint8_t status; } __packed; -#define HCI_CMD_LE_Add_Device_To_White_List 0x0011 /* complete */ -struct hciLeAddDeviceToWhiteList { +#define HCI_CMD_LE_Add_Device_To_Allow_List 0x0011 /* complete */ +struct hciLeAddDeviceToAllowList { uint8_t randomAddr; uint8_t mac[6]; } __packed; -struct hciCmplLeAddDeviceToWhiteList { +struct hciCmplLeAddDeviceToAllowList { uint8_t status; } __packed; -#define HCI_CMD_LE_Remove_Device_From_White_List 0x0012 /* complete */ -struct hciLeRemoveDeviceFromWhiteList { +#define HCI_CMD_LE_Remove_Device_From_Allow_List 0x0012 /* complete */ +struct hciLeRemoveDeviceFromAllowList { uint8_t randomAddr; uint8_t mac[6]; } __packed; -struct hciCmplLeRemoveDeviceFromWhiteList { +struct hciCmplLeRemoveDeviceFromAllowList { uint8_t status; } __packed; diff --git a/include/usb_pd.h b/include/usb_pd.h index b37c557140..5d09b7ab6c 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1540,7 +1540,7 @@ __override_proto void pd_try_execute_vconn_swap(int port, int flags); /** * Check if we should charge from this device. This is - * basically a white-list for chargers that are dual-role, + * basically a allow-list for chargers that are dual-role, * don't set the unconstrained bit, but we should charge * from by default. * diff --git a/util/config_option_check.py b/util/config_option_check.py index bf5ac315c1..f4262430aa 100755 --- a/util/config_option_check.py +++ b/util/config_option_check.py @@ -50,7 +50,7 @@ class Hunk(object): CONFIG_FILE = 'include/config.h' # Specific files which the checker should ignore. -WHITELIST = [CONFIG_FILE, 'util/config_option_check.py'] +ALLOWLIST = [CONFIG_FILE, 'util/config_option_check.py'] def obtain_current_config_options(): """Obtains current config options from include/config.h. @@ -304,8 +304,8 @@ def get_hunks(): match = filename_re.search(line) if match: filename = match.groups(1)[0] - if filename in WHITELIST: - # Skip the file if it's whitelisted. + if filename in ALLOWLIST: + # Skip the file if it's allowlisted. current_state = state.NEW_FILE else: current_state = state.HUNK |