summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@google.com>2018-02-19 13:12:40 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-06-01 05:13:55 +0000
commit15f5fa9b2e1f44a0c594d6543f31f39a44fdd809 (patch)
treea77e2806410d2b07315110d60465c20c96ca8832
parentff50c4f127a11dddcae16798150b56396ef37072 (diff)
downloadchrome-ec-15f5fa9b2e1f44a0c594d6543f31f39a44fdd809.tar.gz
gsctool: fix Board ID retrieval function
The function used to read or write Board ID value, when invoked for reading, reports the value on the console, but does not save the read value in the passed in structure. Let's always save it in the structure so that the caller of this function has access to the retrieved value. BRANCH=none BUG=chromium:812880 TEST=verified that 'gsctool -i' still operates as expected. Change-Id: I9bc713386758ca6701e6b853e042652e2f392871 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/925692 Reviewed-by: Randall Spangler <rspangler@chromium.org> (cherry picked from commit cd76cde2173e7e18d54865d97beece25fa2cb14e) Reviewed-on: https://chromium-review.googlesource.com/1082071 Reviewed-by: Marco Chen <marcochen@chromium.org> Commit-Queue: Marco Chen <marcochen@chromium.org> Tested-by: Marco Chen <marcochen@chromium.org>
-rw-r--r--extra/usb_updater/gsctool.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/extra/usb_updater/gsctool.c b/extra/usb_updater/gsctool.c
index 035fb373ac..6985501127 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -1714,19 +1714,17 @@ static void process_bid(struct transfer_descriptor *td,
size_t response_size;
if (bid_action == bid_get) {
- struct board_id bid;
- response_size = sizeof(bid);
+ response_size = sizeof(*bid);
send_vendor_command(td, VENDOR_CC_GET_BOARD_ID,
- &bid, sizeof(bid),
- &bid, &response_size);
+ bid, sizeof(*bid),
+ bid, &response_size);
- if (response_size == sizeof(bid)) {
+ if (response_size == sizeof(*bid)) {
printf("Board ID space: %08x:%08x:%08x\n",
- be32toh(bid.type), be32toh(bid.type_inv),
- be32toh(bid.flags));
+ be32toh(bid->type), be32toh(bid->type_inv),
+ be32toh(bid->flags));
return;
-
}
fprintf(stderr, "Error reading board ID: response size %zd,"
" first byte %#02x\n", response_size,