summaryrefslogtreecommitdiff
path: root/chip/g/usb-stream.h
diff options
context:
space:
mode:
authorNamyoon Woo <namyoon@chromium.org>2019-06-05 12:20:07 -0700
committerCommit Bot <commit-bot@chromium.org>2019-06-06 02:21:03 +0000
commit67114fa836c2c0d201dbb16ae88a6a9b66f1d94b (patch)
tree1754e74a517e5b0fb5b649525bbc490f8af4c69d /chip/g/usb-stream.h
parent9a5e19845eb76e0b10311b4829ab39ba73835fa3 (diff)
downloadchrome-ec-67114fa836c2c0d201dbb16ae88a6a9b66f1d94b.tar.gz
g: add rx_handled into USB_STREAM_CONFIG
The variable rx_handled tracks how many of the bytes in the HW FIFO was moved into the incoming queue. It used to be defined as local static variable for multiple USB_STREAM_CONFIGs, and could cause a problem if multiple USB downstream traffic get heavier. It should be defined for each USB_STREAM_CONFIG. This patch add rx_handled into USB_STREAM_CONFIG, which tracks how many of the bytes in the HW FIFO was moved into the incoming queue. BUG=None BRANCH=None TEST=manually ran uart_stress_tester.sh and flash_ec on Bob. Change-Id: I561a54b0594a71b557693007a181bde48155d403 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1644958 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip/g/usb-stream.h')
-rw-r--r--chip/g/usb-stream.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/chip/g/usb-stream.h b/chip/g/usb-stream.h
index 5eb03865b0..4787b50d08 100644
--- a/chip/g/usb-stream.h
+++ b/chip/g/usb-stream.h
@@ -46,6 +46,8 @@ struct usb_stream_config {
struct g_usb_desc *out_desc;
struct g_usb_desc *in_desc;
+
+ int *rx_handled;
};
/*
@@ -113,6 +115,7 @@ extern struct producer_ops const usb_stream_producer_ops;
DECLARE_DEFERRED(CONCAT2(NAME, _deferred_tx_)); \
static void CONCAT2(NAME, _deferred_rx_)(void); \
DECLARE_DEFERRED(CONCAT2(NAME, _deferred_rx_)); \
+ static int CONCAT2(NAME, _rx_handled); \
struct usb_stream_config const NAME = { \
.endpoint = ENDPOINT, \
.is_reset = &CONCAT2(NAME, _is_reset_), \
@@ -132,6 +135,7 @@ extern struct producer_ops const usb_stream_producer_ops;
.queue = &RX_QUEUE, \
.ops = &usb_stream_producer_ops, \
}, \
+ .rx_handled = &CONCAT2(NAME, _rx_handled), \
}; \
const struct usb_interface_descriptor \
USB_IFACE_DESC(INTERFACE) = { \
@@ -208,8 +212,8 @@ extern struct producer_ops const usb_stream_producer_ops;
/*
* Handle USB and Queue request in a deferred callback.
*/
-int rx_stream_handler(struct usb_stream_config const *config);
-int tx_stream_handler(struct usb_stream_config const *config);
+void rx_stream_handler(struct usb_stream_config const *config);
+void tx_stream_handler(struct usb_stream_config const *config);
/*
* These functions are used by the trampoline functions defined above to