summaryrefslogtreecommitdiff
path: root/extra/usb_updater/gsctool.c
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-07-18 05:19:22 +0000
commit41234da76c8f3a797ca665c66a30302cda8803be (patch)
tree2a88dbfb8aae489fd775b2f844710b85de8fd15f /extra/usb_updater/gsctool.c
parentf7c8c331a306285b61cfe14a9a78f14a75d4a8e4 (diff)
downloadchrome-ec-41234da76c8f3a797ca665c66a30302cda8803be.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/1141524 Reviewed-by: Nick Sanders <nsanders@chromium.org> Commit-Queue: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org>
Diffstat (limited to 'extra/usb_updater/gsctool.c')
-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 de26319271..2fbc443a78 100644
--- a/extra/usb_updater/gsctool.c
+++ b/extra/usb_updater/gsctool.c
@@ -1719,19 +1719,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,