summaryrefslogtreecommitdiff
path: root/common/pstore_commands.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-03-01 15:18:56 -0800
committerRandall Spangler <rspangler@chromium.org>2012-03-01 15:22:14 -0800
commit9a60f37c8da8a61eb03d940f08f177a287b8f5ee (patch)
tree9fd17284ededb1921c9a1637c363546a8381c841 /common/pstore_commands.c
parent5cd0f292e9c769264c5fa1f0fe262c910a9194ec (diff)
downloadchrome-ec-9a60f37c8da8a61eb03d940f08f177a287b8f5ee.tar.gz
Refactor LPC status / result codes
This is necessary to support SCI/SMI events. Note that this breaks compatibility with previous ectool builds - and probably also breaks flashrom support. Signed-off-by: Randall Spangler <rspangler@chromium.org> BUG=chrome-os-partner:8253 TEST='ectool hello' and 'ectool flashinfo' still work and 'ectool usbchargemode 3 1' fails with error 2 Change-Id: If39e5b6e7cdcec1b5ec765594e8492925b430b10
Diffstat (limited to 'common/pstore_commands.c')
-rw-r--r--common/pstore_commands.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/common/pstore_commands.c b/common/pstore_commands.c
index 67c35d1bab..49ffa47a99 100644
--- a/common/pstore_commands.c
+++ b/common/pstore_commands.c
@@ -31,7 +31,7 @@ enum lpc_status pstore_command_get_info(uint8_t *data)
r->pstore_size = PSTORE_EEPROM_BLOCK_COUNT * eeprom_get_block_size();
r->access_size = sizeof(uint32_t);
- return EC_LPC_STATUS_SUCCESS;
+ return EC_LPC_RESULT_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_INFO, pstore_command_get_info);
@@ -49,7 +49,7 @@ enum lpc_status pstore_command_read(uint8_t *data)
int bytes_left = p->size;
if (p->size > sizeof(r->data))
- return EC_LPC_STATUS_ERROR;
+ return EC_LPC_RESULT_ERROR;
while (bytes_left) {
/* Read what we can from the current block */
@@ -57,10 +57,10 @@ enum lpc_status pstore_command_read(uint8_t *data)
if (block >=
PSTORE_EEPROM_BLOCK_START + PSTORE_EEPROM_BLOCK_COUNT)
- return EC_LPC_STATUS_ERROR;
+ return EC_LPC_RESULT_ERROR;
if (eeprom_read(block, offset, bytes_this, dest))
- return EC_LPC_STATUS_ERROR;
+ return EC_LPC_RESULT_ERROR;
/* Continue to the next block if necessary */
offset = 0;
@@ -69,7 +69,7 @@ enum lpc_status pstore_command_read(uint8_t *data)
dest += bytes_this;
}
- return EC_LPC_STATUS_SUCCESS;
+ return EC_LPC_RESULT_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_READ, pstore_command_read);
@@ -86,7 +86,7 @@ enum lpc_status pstore_command_write(uint8_t *data)
int bytes_left = p->size;
if (p->size > sizeof(p->data))
- return EC_LPC_STATUS_ERROR;
+ return EC_LPC_RESULT_ERROR;
while (bytes_left) {
/* Write what we can to the current block */
@@ -94,10 +94,10 @@ enum lpc_status pstore_command_write(uint8_t *data)
if (block >=
PSTORE_EEPROM_BLOCK_START + PSTORE_EEPROM_BLOCK_COUNT)
- return EC_LPC_STATUS_ERROR;
+ return EC_LPC_RESULT_ERROR;
if (eeprom_write(block, offset, bytes_this, src))
- return EC_LPC_STATUS_ERROR;
+ return EC_LPC_RESULT_ERROR;
/* Continue to the next block if necessary */
offset = 0;
@@ -106,6 +106,6 @@ enum lpc_status pstore_command_write(uint8_t *data)
src += bytes_this;
}
- return EC_LPC_STATUS_SUCCESS;
+ return EC_LPC_RESULT_SUCCESS;
}
DECLARE_HOST_COMMAND(EC_LPC_COMMAND_PSTORE_WRITE, pstore_command_write);