[SeaBIOS] [PATCH 0/9] Refactor USB send_bulk and send_control

Kevin O'Connor kevin at koconnor.net
Thu Jan 1 01:57:21 CET 2015


This series refactors parts of the internal USB driver code interface.
It merges the ?hci_send_bulk() and ?hci_send_control() functions into
one function ?hci_send_pipe().  The control and bulk transmission
functions were similar, but often had slightly different
implementations and quirks.  Unifying them reduces the overall code
size.  It also makes it easier to issue control commands at run-time,
which should make it easier for future enhancements (such as keyboard
led control).

I tested this on qemu and with a bunch of devices on my c720 and
e350m1.  However, I don't have a uhci board readily available.  I'll
have to dust off my via board and see if it still works.  If others
can run some tests that would be appreciated.

In the process of testing this series, I found that USB3 hubs aren't
working that great - I sometimes get timeout messages on my e350m1
(though all functionality still works), and usb3 hubs aren't working
on my c720.  This does not look to be a regression though.  (It does
seem that USB3 hubs still need more work though).

This series is also available at:
  https://github.com/KevinOConnor/seabios/tree/testing

-Kevin


Kevin O'Connor (9):
  ehci: No need to support td array wrapping
  ehci: Merge ehci_send_control with ehci_send_bulk
  ohci: Merge ohci_send_control with ohci_send_bulk
  uhci: Merge uhci_send_control with uhci_send_bulk
  xhci: Merge xhci_send_control with xhci_send_bulk
  usb: Use usb_send_pipe() now that all drivers have x_send_pipe()
  xhci: Move xhci_xfer_x() functions together
  xhci: Merge some xhci_xfer_x() functions into xhci_send_pipe()
  usb: Control transfers always have an 8 byte command size

 src/hw/usb-ehci.c | 123 +++++++++++++++---------------------------
 src/hw/usb-ehci.h |   5 +-
 src/hw/usb-ohci.c |  87 ++++++++++--------------------
 src/hw/usb-ohci.h |   5 +-
 src/hw/usb-uhci.c |  96 ++++++++++++---------------------
 src/hw/usb-uhci.h |   5 +-
 src/hw/usb-xhci.c | 156 +++++++++++++++++-------------------------------------
 src/hw/usb-xhci.h |   5 +-
 src/hw/usb.c      |  40 ++++++--------
 src/hw/usb.h      |   2 +
 10 files changed, 180 insertions(+), 344 deletions(-)

-- 
1.9.3




More information about the SeaBIOS mailing list