Now that all controllers use a free list, maintain the free list in
the common code.

Signed-off-by: Kevin O'Connor <ke...@koconnor.net>
---
 src/usb-ehci.c |   11 -----------
 src/usb-ehci.h |    1 -
 src/usb-ohci.c |    9 ---------
 src/usb-ohci.h |    1 -
 src/usb-uhci.c |   11 -----------
 src/usb-uhci.h |    1 -
 src/usb.c      |   13 ++++---------
 7 files changed, 4 insertions(+), 43 deletions(-)

diff --git a/src/usb-ehci.c b/src/usb-ehci.c
index 2978072..5717dc6 100644
--- a/src/usb-ehci.c
+++ b/src/usb-ehci.c
@@ -423,17 +423,6 @@ ehci_wait_td(struct ehci_pipe *pipe, struct ehci_qtd *td, 
int timeout)
     return 0;
 }
 
-void
-ehci_free_pipe(struct usb_pipe *pipe)
-{
-    if (! CONFIG_USB_EHCI)
-        return;
-    // Add to controller's free list.
-    struct usb_s *cntl = pipe->cntl;
-    pipe->freenext = cntl->freelist;
-    cntl->freelist = pipe;
-}
-
 static struct usb_pipe *
 ehci_alloc_pipe(struct usb_pipe *dummy, int iscontrol)
 {
diff --git a/src/usb-ehci.h b/src/usb-ehci.h
index 1a2c6c7..fd38b73 100644
--- a/src/usb-ehci.h
+++ b/src/usb-ehci.h
@@ -4,7 +4,6 @@
 // usb-ehci.c
 int ehci_init(struct pci_device *pci, int busid, struct pci_device *comppci);
 struct usb_pipe;
-void ehci_free_pipe(struct usb_pipe *p);
 struct usb_pipe *ehci_alloc_control_pipe(struct usb_pipe *dummy);
 int ehci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
                  , void *data, int datasize);
diff --git a/src/usb-ohci.c b/src/usb-ohci.c
index 7a437ad..ac1eb37 100644
--- a/src/usb-ohci.c
+++ b/src/usb-ohci.c
@@ -319,15 +319,6 @@ wait_ed(struct ohci_ed *ed)
     }
 }
 
-void
-ohci_free_pipe(struct usb_pipe *pipe)
-{
-    // Add to controller's free list.
-    struct usb_s *cntl = pipe->cntl;
-    pipe->freenext = cntl->freelist;
-    cntl->freelist = pipe;
-}
-
 struct usb_pipe *
 ohci_alloc_control_pipe(struct usb_pipe *dummy)
 {
diff --git a/src/usb-ohci.h b/src/usb-ohci.h
index c7670ff..6162d32 100644
--- a/src/usb-ohci.h
+++ b/src/usb-ohci.h
@@ -4,7 +4,6 @@
 // usb-ohci.c
 void ohci_init(struct pci_device *pci, int busid);
 struct usb_pipe;
-void ohci_free_pipe(struct usb_pipe *p);
 struct usb_pipe *ohci_alloc_control_pipe(struct usb_pipe *dummy);
 int ohci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
                  , void *data, int datasize);
diff --git a/src/usb-uhci.c b/src/usb-uhci.c
index 015b974..4f7fbb4 100644
--- a/src/usb-uhci.c
+++ b/src/usb-uhci.c
@@ -294,17 +294,6 @@ wait_pipe(struct uhci_pipe *pipe, int timeout)
     }
 }
 
-void
-uhci_free_pipe(struct usb_pipe *pipe)
-{
-    if (! CONFIG_USB_UHCI)
-        return;
-    // Add to controller's free list.
-    struct usb_s *cntl = pipe->cntl;
-    pipe->freenext = cntl->freelist;
-    cntl->freelist = pipe;
-}
-
 static struct usb_pipe *
 uhci_alloc_pipe(struct usb_pipe *dummy, int iscontrol)
 {
diff --git a/src/usb-uhci.h b/src/usb-uhci.h
index b5f70f7..59b190d 100644
--- a/src/usb-uhci.h
+++ b/src/usb-uhci.h
@@ -4,7 +4,6 @@
 // usb-uhci.c
 void uhci_init(struct pci_device *pci, int busid);
 struct usb_pipe;
-void uhci_free_pipe(struct usb_pipe *p);
 struct usb_pipe *uhci_alloc_control_pipe(struct usb_pipe *dummy);
 int uhci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
                  , void *data, int datasize);
diff --git a/src/usb.c b/src/usb.c
index 1f69d16..f522e1a 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -30,15 +30,10 @@ free_pipe(struct usb_pipe *pipe)
     ASSERT32FLAT();
     if (!pipe)
         return;
-    switch (pipe->type) {
-    default:
-    case USB_TYPE_UHCI:
-        return uhci_free_pipe(pipe);
-    case USB_TYPE_OHCI:
-        return ohci_free_pipe(pipe);
-    case USB_TYPE_EHCI:
-        return ehci_free_pipe(pipe);
-    }
+    // Add to controller's free list.
+    struct usb_s *cntl = pipe->cntl;
+    pipe->freenext = cntl->freelist;
+    cntl->freelist = pipe;
 }
 
 // Allocate a control pipe to a default endpoint (which can only be
-- 
1.7.6.5


_______________________________________________
SeaBIOS mailing list
SeaBIOS@seabios.org
http://www.seabios.org/mailman/listinfo/seabios

Reply via email to