diff options
author | Dossym Nurmukhanov <dossym@google.com> | 2020-12-11 11:17:39 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-12 12:55:43 +0000 |
commit | 61022575d3c8b75d07e4f3be3f1616e45767f673 (patch) | |
tree | 236ac65b862e8bf1c825c5862e788a3ae783ee24 /common | |
parent | a86aecb2de50437622e91ee451079175cdef5e1d (diff) | |
download | chrome-ec-61022575d3c8b75d07e4f3be3f1616e45767f673.tar.gz |
COIL: Use inclusive language for EC-EC communication code
Replace with server/client nomenclature
BUG=none
TEST=build and run on volteer
BRANCH=none
Signed-off-by: dossym@chromium.org
Change-Id: I23fe7de9228a9611b49eef1362bf15159b25aab7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2586038
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/charge_state_v2.c | 10 | ||||
-rw-r--r-- | common/ec_ec_comm_client.c | 20 | ||||
-rw-r--r-- | common/ec_ec_comm_server.c | 38 |
3 files changed, 34 insertions, 34 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 6734b15569..4bb6eb947a 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -306,11 +306,11 @@ static void update_base_battery_info(void) int flags_changed; int old_full_capacity = bd->full_capacity; - ec_ec_master_base_get_dynamic_info(); + ec_ec_client_base_get_dynamic_info(); flags_changed = (old_flags != bd->flags); /* Fetch static information when flags change. */ if (flags_changed) - ec_ec_master_base_get_static_info(); + ec_ec_client_base_get_static_info(); battery_memmap_refresh(BATT_IDX_BASE); @@ -350,7 +350,7 @@ static int set_base_current(int current_base, int allow_charge_base) const int otg_voltage = db_policy.otg_voltage; int ret; - ret = ec_ec_master_base_charge_control(current_base, + ret = ec_ec_client_base_charge_control(current_base, otg_voltage, allow_charge_base); if (ret) { /* Ignore errors until the base is responsive. */ @@ -560,7 +560,7 @@ static void charge_allocate_input_current_limit(void) if (base_responsive) { /* Base still responsive, put it to sleep. */ CPRINTF("Hibernating base\n"); - ec_ec_master_hibernate(); + ec_ec_client_hibernate(); base_responsive = 0; board_enable_base_power(0); } @@ -2088,7 +2088,7 @@ wait_for_it: #endif #ifdef CONFIG_EC_EC_COMM_BATTERY_SLAVE /* - * On EC-EC slave, do not charge if curr.ac is 0: there + * On EC-EC server, do not charge if curr.ac is 0: there * might still be some external power available but we * do not want to use it for charging. */ diff --git a/common/ec_ec_comm_client.c b/common/ec_ec_comm_client.c index d2602470bc..c92433af8c 100644 --- a/common/ec_ec_comm_client.c +++ b/common/ec_ec_comm_client.c @@ -2,7 +2,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * - * EC-EC communication, functions and definitions for master. + * EC-EC communication, functions and definitions for client. */ #include "battery.h" @@ -22,11 +22,11 @@ * TODO(b:65697962): The packed structures below do not play well if we force EC * host commands structures to be aligned on 32-bit boundary. There are ways to * fix that, possibly requiring copying data around, or modifying - * uart_alt_pad_write_read API to write the actual slave response to a separate + * uart_alt_pad_write_read API to write the actual server response to a separate * buffer. */ #ifdef CONFIG_HOSTCMD_ALIGNED -#error "Cannot define CONFIG_HOSTCMD_ALIGNED with EC-EC communication master." +#error "Cannot define CONFIG_HOSTCMD_ALIGNED with EC-EC communication client." #endif #define EC_EC_HOSTCMD_VERSION 4 @@ -78,7 +78,7 @@ struct { * crc8 are verified by this function). * * This format is required as the EC-EC UART is half-duplex, and all the - * transmitted data is received back, i.e. the master writes req, then reads + * transmitted data is received back, i.e. the client writes req, then reads * req, followed by resp. * * When a command does not take parameters, param/crc8 must be omitted in @@ -113,12 +113,12 @@ static int write_command(uint16_t command, struct ec_host_response4 *response_header = (void *)&data[tx_length]; - /* RX length is TX length + response from slave. */ + /* RX length is TX length + response from server. */ int rx_length = tx_length + sizeof(*request_header) + ((resp_len > 0) ? (resp_len + 1) : 0); /* - * Make sure there is a gap between each command, so that the slave + * Make sure there is a gap between each command, so that the server * can recover its state machine after each command. * * TODO(b:65697962): We can be much smarter than this, and record the @@ -241,7 +241,7 @@ static int handle_error(const char *func, int ret, int request_result) } #ifdef CONFIG_EC_EC_COMM_BATTERY -int ec_ec_master_base_get_dynamic_info(void) +int ec_ec_client_base_get_dynamic_info(void) { int ret; struct { @@ -281,7 +281,7 @@ int ec_ec_master_base_get_dynamic_info(void) return EC_RES_SUCCESS; } -int ec_ec_master_base_get_static_info(void) +int ec_ec_client_base_get_static_info(void) { int ret; struct { @@ -321,7 +321,7 @@ int ec_ec_master_base_get_static_info(void) return EC_RES_SUCCESS; } -int ec_ec_master_base_charge_control(int max_current, +int ec_ec_client_base_charge_control(int max_current, int otg_voltage, int allow_charging) { @@ -347,7 +347,7 @@ int ec_ec_master_base_charge_control(int max_current, return handle_error(__func__, ret, data.resp.head.result); } -int ec_ec_master_hibernate(void) +int ec_ec_client_hibernate(void) { int ret; struct { diff --git a/common/ec_ec_comm_server.c b/common/ec_ec_comm_server.c index af00f45248..23b5fee139 100644 --- a/common/ec_ec_comm_server.c +++ b/common/ec_ec_comm_server.c @@ -2,7 +2,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * - * EC-EC communication, task and functions for slave. + * EC-EC communication, task and functions for server. */ #include "common.h" @@ -27,7 +27,7 @@ /* Print extra debugging information */ #undef EXTRA_DEBUG -/* Set if the master allows the slave to charge the battery. */ +/* Set if the client allows the server to charge the battery. */ static int charging_allowed; /* @@ -52,7 +52,7 @@ BUILD_ASSERT(LARGEST_PARAMS_SIZE >= #define COMMAND_TIMEOUT_US (5 * MSEC) -void ec_ec_comm_slave_written(struct consumer const *consumer, size_t count) +void ec_ec_comm_server_written(struct consumer const *consumer, size_t count) { task_wake(TASK_ID_ECCOMM); } @@ -66,13 +66,13 @@ void ec_ec_comm_slave_written(struct consumer const *consumer, size_t count) static void discard_queue(void) { do { - queue_advance_head(&ec_ec_comm_slave_input, - queue_count(&ec_ec_comm_slave_input)); + queue_advance_head(&ec_ec_comm_server_input, + queue_count(&ec_ec_comm_server_input)); usleep(1 * MSEC); - } while (queue_count(&ec_ec_comm_slave_input) > 0); + } while (queue_count(&ec_ec_comm_server_input) > 0); } -/* Write response to master. */ +/* Write response to client. */ static void write_response(uint16_t res, int seq, const void *data, int len) { struct ec_host_response4 header; @@ -89,13 +89,13 @@ static void write_response(uint16_t res, int seq, const void *data, int len) header.reserved = 0; header.header_crc = cros_crc8((uint8_t *)&header, sizeof(header)-1); - QUEUE_ADD_UNITS(&ec_ec_comm_slave_output, + QUEUE_ADD_UNITS(&ec_ec_comm_server_output, (uint8_t *)&header, sizeof(header)); if (len > 0) { - QUEUE_ADD_UNITS(&ec_ec_comm_slave_output, data, len); + QUEUE_ADD_UNITS(&ec_ec_comm_server_output, data, len); crc = cros_crc8(data, len); - QUEUE_ADD_UNITS(&ec_ec_comm_slave_output, &crc, sizeof(crc)); + QUEUE_ADD_UNITS(&ec_ec_comm_server_output, &crc, sizeof(crc)); } } @@ -108,7 +108,7 @@ static int read_data(void *buffer, size_t len, uint32_t start) { uint32_t delta; - while (queue_count(&ec_ec_comm_slave_input) < len) { + while (queue_count(&ec_ec_comm_server_input) < len) { delta = __hw_clock_source_read() - start; if (delta >= COMMAND_TIMEOUT_US) return EC_ERROR_TIMEOUT; @@ -118,7 +118,7 @@ static int read_data(void *buffer, size_t len, uint32_t start) } /* Fetch header */ - QUEUE_REMOVE_UNITS(&ec_ec_comm_slave_input, buffer, len); + QUEUE_REMOVE_UNITS(&ec_ec_comm_server_input, buffer, len); return EC_SUCCESS; } @@ -191,13 +191,13 @@ out: } /* - * On dual-battery slave, we use the charging allowed signal from master to + * On dual-battery server, we use the charging allowed signal from client to * indicate whether external power is present. * - * In most cases, this actually matches the external power status of the master - * (slave battery charging when AC is connected, or discharging when slave - * battery still has enough capacity), with one exception: when we do master to - * slave battery charging (in this case the "external" power is the master). + * In most cases, this actually matches the external power status of the client + * (server battery charging when AC is connected, or discharging when server + * battery still has enough capacity), with one exception: when we do client to + * server battery charging (in this case the "external" power is the client). */ int extpower_is_present(void) { @@ -205,7 +205,7 @@ int extpower_is_present(void) } #endif -void ec_ec_comm_slave_task(void *u) +void ec_ec_comm_server_task(void *u) { struct ec_host_request4 header; /* @@ -219,7 +219,7 @@ void ec_ec_comm_slave_task(void *u) while (1) { task_wait_event(-1); - if (queue_count(&ec_ec_comm_slave_input) == 0) + if (queue_count(&ec_ec_comm_server_input) == 0) continue; /* We got some data, start timeout counter. */ |