diff options
author | Mary Ruthven <mruthven@chromium.org> | 2019-05-07 15:43:39 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-05-12 19:27:40 -0700 |
commit | d68548eebbe93a6c3009cf20ddf0da7b27fe2012 (patch) | |
tree | 9a6effed3c59ea43462322fa705f95b990b6480a /util/usb_if.h | |
parent | e02b08ceca36300a602c50b2b3cc81f3a5385978 (diff) | |
download | chrome-ec-d68548eebbe93a6c3009cf20ddf0da7b27fe2012.tar.gz |
usb_if: use the device with the matching serial number
There might be multiple devices with the same VID:PID connected to the
host. Use the serial number to find the correct device if it is given.
BUG=none
BRANCH=none
TEST=none
Change-Id: I96f31e8e7ceb0dd2c3c643771b38752da88a2a9e
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1600500
Reviewed-by: Matthew Blecker <matthewb@chromium.org>
Diffstat (limited to 'util/usb_if.h')
-rw-r--r-- | util/usb_if.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/util/usb_if.h b/util/usb_if.h index 220564d2a3..8cc1088c6e 100644 --- a/util/usb_if.h +++ b/util/usb_if.h @@ -17,14 +17,16 @@ struct usb_endpoint { }; /* - * Find the requested USB endpoint, as determined by vid, pid, subclass and - * protocol parameters. If found, fill up the uep structure. If succeeded, - * usb_shut_down() must be invoked before program exits. + * Find the requested USB endpoint. This finds the device using the device + * serial number, vendor id, and product id. The subclass and protocol are used + * to find the correct endpoint. If a matching endpoint is found, fill up the + * uep structure. If succeeded, usb_shut_down() must be invoked before program + * exits. * * Return 0 on success, -1 on failure. */ -int usb_findit(uint16_t vid, uint16_t pid, uint16_t subclass, - uint16_t protocol, struct usb_endpoint *uep); +int usb_findit(const char *serialno, uint16_t vid, uint16_t pid, + uint16_t subclass, uint16_t protocol, struct usb_endpoint *uep); /* * Actual USB transfer function, the 'allow_less' flag indicates that the |