From 026ff3e436799b54daec8805dc574146793f4903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Mon, 8 Jul 2013 18:11:44 +0300 Subject: usbdebug: Split endpoint buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor the structure to better support receive and another set of endpoints over usbdebug. Change-Id: Ib0f76afdf4e638363ff30c67010920142c58f250 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/3726 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/include/usbdebug.h | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'src/include') diff --git a/src/include/usbdebug.h b/src/include/usbdebug.h index 16077b0448..2728be0e4f 100644 --- a/src/include/usbdebug.h +++ b/src/include/usbdebug.h @@ -40,31 +40,18 @@ void pci_ehci_read_resources(struct device *dev); #endif #endif -struct ehci_debug_info { - void *ehci_caps; - void *ehci_regs; - void *ehci_debug; - u32 devnum; - u32 endpoint_out; - u32 endpoint_in; - char buf[8]; - u8 bufidx; - u8 status; -}; - -#define DBGP_EP_VALID (1<<0) -#define DBGP_EP_ENABLED (1<<1) -#define DBGP_EP_STATMASK (DBGP_EP_VALID | DBGP_EP_ENABLED) +struct dbgp_pipe; void enable_usbdebug(unsigned int port); -int dbgp_bulk_write_x(struct ehci_debug_info *dbg_info, const char *bytes, int size); -int dbgp_bulk_read_x(struct ehci_debug_info *dbg_info, void *data, int size); void set_debug_port(unsigned port); int usbdebug_init(void); -struct ehci_debug_info *dbgp_console_output(void); -struct ehci_debug_info *dbgp_console_input(void); -int dbgp_ep_is_active(struct ehci_debug_info *dbg_info); -void usbdebug_tx_byte(struct ehci_debug_info *info, unsigned char data); -void usbdebug_tx_flush(struct ehci_debug_info *info); + +struct dbgp_pipe *dbgp_console_output(void); +struct dbgp_pipe *dbgp_console_input(void); +int dbgp_ep_is_active(struct dbgp_pipe *pipe); +int dbgp_bulk_write_x(struct dbgp_pipe *pipe, const char *bytes, int size); +int dbgp_bulk_read_x(struct dbgp_pipe *pipe, void *data, int size); +void usbdebug_tx_byte(struct dbgp_pipe *pipe, unsigned char data); +void usbdebug_tx_flush(struct dbgp_pipe *pipe); #endif -- cgit v1.2.3