diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2012-05-10 23:35:56 +0000 |
---|---|---|
committer | Vincent Palatin <vpalatin@chromium.org> | 2012-05-15 18:34:50 -0700 |
commit | b74cbd8a74d15bde904b99912df9663a58073bbb (patch) | |
tree | f442a46b161c4aea3881424cdd6b184f52000910 /common/pstore_commands.c | |
parent | dd839d851aa6369a81423da9d59762950f21c592 (diff) | |
download | chrome-ec-b74cbd8a74d15bde904b99912df9663a58073bbb.tar.gz |
de-LPCify the EC host interface
Preparatory work to use common host command code between ARM and x86.
Just rename constants, do not change the binary API.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=chrome-os-partner:9614
TEST=make BOARD=link
Change-Id: I534d427c9b50103273835a6f32a0ddb622c762b3
Diffstat (limited to 'common/pstore_commands.c')
-rw-r--r-- | common/pstore_commands.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/common/pstore_commands.c b/common/pstore_commands.c index 036f5d6b3b..fdd0eaf26c 100644 --- a/common/pstore_commands.c +++ b/common/pstore_commands.c @@ -13,26 +13,26 @@ int pstore_command_get_info(uint8_t *data, int *resp_size) { - struct lpc_response_pstore_info *r = - (struct lpc_response_pstore_info *)data; + struct ec_response_pstore_info *r = + (struct ec_response_pstore_info *)data; ASSERT(EEPROM_BLOCK_START_PSTORE + EEPROM_BLOCK_COUNT_PSTORE <= eeprom_get_block_count()); r->pstore_size = EEPROM_BLOCK_COUNT_PSTORE * eeprom_get_block_size(); r->access_size = sizeof(uint32_t); - *resp_size = sizeof(struct lpc_response_pstore_info); - return EC_LPC_RESULT_SUCCESS; + *resp_size = sizeof(struct ec_response_pstore_info); + return EC_RES_SUCCESS; } -DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_INFO, pstore_command_get_info); +DECLARE_HOST_COMMAND(EC_CMD_PSTORE_INFO, pstore_command_get_info); int pstore_command_read(uint8_t *data, int *resp_size) { - struct lpc_params_pstore_read *p = - (struct lpc_params_pstore_read *)data; - struct lpc_response_pstore_read *r = - (struct lpc_response_pstore_read *)data; + struct ec_params_pstore_read *p = + (struct ec_params_pstore_read *)data; + struct ec_response_pstore_read *r = + (struct ec_response_pstore_read *)data; char *dest = r->data; int block_size = eeprom_get_block_size(); int block = p->offset / block_size + EEPROM_BLOCK_COUNT_PSTORE; @@ -40,7 +40,7 @@ int pstore_command_read(uint8_t *data, int *resp_size) int bytes_left = p->size; if (p->size > sizeof(r->data)) - return EC_LPC_RESULT_ERROR; + return EC_RES_ERROR; while (bytes_left) { /* Read what we can from the current block */ @@ -48,10 +48,10 @@ int pstore_command_read(uint8_t *data, int *resp_size) if (block >= EEPROM_BLOCK_START_PSTORE + EEPROM_BLOCK_COUNT_PSTORE) - return EC_LPC_RESULT_ERROR; + return EC_RES_ERROR; if (eeprom_read(block, offset, bytes_this, dest)) - return EC_LPC_RESULT_ERROR; + return EC_RES_ERROR; /* Continue to the next block if necessary */ offset = 0; @@ -60,16 +60,16 @@ int pstore_command_read(uint8_t *data, int *resp_size) dest += bytes_this; } - *resp_size = sizeof(struct lpc_response_pstore_read); - return EC_LPC_RESULT_SUCCESS; + *resp_size = sizeof(struct ec_response_pstore_read); + return EC_RES_SUCCESS; } -DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_READ, pstore_command_read); +DECLARE_HOST_COMMAND(EC_CMD_PSTORE_READ, pstore_command_read); int pstore_command_write(uint8_t *data, int *resp_size) { - struct lpc_params_pstore_write *p = - (struct lpc_params_pstore_write *)data; + struct ec_params_pstore_write *p = + (struct ec_params_pstore_write *)data; const char *src = p->data; int block_size = eeprom_get_block_size(); @@ -78,7 +78,7 @@ int pstore_command_write(uint8_t *data, int *resp_size) int bytes_left = p->size; if (p->size > sizeof(p->data)) - return EC_LPC_RESULT_ERROR; + return EC_RES_ERROR; while (bytes_left) { /* Write what we can to the current block */ @@ -86,10 +86,10 @@ int pstore_command_write(uint8_t *data, int *resp_size) if (block >= EEPROM_BLOCK_START_PSTORE + EEPROM_BLOCK_COUNT_PSTORE) - return EC_LPC_RESULT_ERROR; + return EC_RES_ERROR; if (eeprom_write(block, offset, bytes_this, src)) - return EC_LPC_RESULT_ERROR; + return EC_RES_ERROR; /* Continue to the next block if necessary */ offset = 0; @@ -98,6 +98,6 @@ int pstore_command_write(uint8_t *data, int *resp_size) src += bytes_this; } - return EC_LPC_RESULT_SUCCESS; + return EC_RES_SUCCESS; } -DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_WRITE, pstore_command_write); +DECLARE_HOST_COMMAND(EC_CMD_PSTORE_WRITE, pstore_command_write); |