3 Apr 2010 02:14
[PATCH] Refactor USB hub code.
Kevin O'Connor <kevin <at> koconnor.net>
2010-04-03 00:14:50 GMT
2010-04-03 00:14:50 GMT
All four implementations of hubs (and root hubs) were very similar.
Replace them with a single implementation that uses callbacks for the
three custom parts (detect, reset, disconnect) of each type of hub.
---
src/usb-ehci.c | 100 ++++++++++++++++++++++++++---------------------------
src/usb-hub.c | 106 ++++++++++++++++++++++++++-----------------------------
src/usb-hub.h | 10 -----
src/usb-ohci.c | 82 ++++++++++++++++++-------------------------
src/usb-uhci.c | 75 ++++++++++++++++++---------------------
src/usb.c | 64 ++++++++++++++++++++++++++++++++-
src/usb.h | 25 ++++++++++++--
7 files changed, 253 insertions(+), 209 deletions(-)
diff --git a/src/usb-ehci.c b/src/usb-ehci.c
index 8e3219f..1f683c8 100644
--- a/src/usb-ehci.c
+++ b/src/usb-ehci.c
<at> <at> -13,7 +13,6 <at> <at>
#include "pci_regs.h" // PCI_BASE_ADDRESS_0
#include "usb.h" // struct usb_s
#include "farptr.h" // GET_FLATPTR
-#include "usb-hub.h" // struct usbhub_s
#include "usb-uhci.h" // init_uhci
#include "usb-ohci.h" // init_ohci
<at> <at> -40,13 +39,17 <at> <at> struct usb_ehci_s {
#define EHCI_TIME_POSTPOWER 20
#define EHCI_TIME_POSTRESET 2
(Continue reading)
RSS Feed