]> xenbits.xensource.com Git - seabios.git/commitdiff
ehci: Export ehci_realloc_pipe() instead of ehci_alloc_pipe()
authorKevin O'Connor <kevin@koconnor.net>
Thu, 16 Oct 2014 17:40:42 +0000 (13:40 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 16 Oct 2014 20:30:15 +0000 (16:30 -0400)
Support alloc, update, and free from the single exported function.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/hw/usb-ehci.c
src/hw/usb-ehci.h
src/hw/usb.c

index 1df7ec877097776b8018f0ea20ccfdd3d0d412ad..8938915a956555e5d8176f9eb6f5012da3d82e7a 100644 (file)
@@ -445,11 +445,14 @@ fail:
 }
 
 struct usb_pipe *
-ehci_alloc_pipe(struct usbdevice_s *usbdev
-                , struct usb_endpoint_descriptor *epdesc)
+ehci_realloc_pipe(struct usbdevice_s *usbdev, struct usb_pipe *upipe
+                  , struct usb_endpoint_descriptor *epdesc)
 {
     if (! CONFIG_USB_EHCI)
         return NULL;
+    usb_add_freelist(upipe);
+    if (!epdesc)
+        return NULL;
     u8 eptype = epdesc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK;
     if (eptype == USB_ENDPOINT_XFER_INT)
         return ehci_alloc_intr_pipe(usbdev, epdesc);
index 6346d78a3445b69cb36016314ab91655267a40e4..da74438f6749af4b188cff3d6192ecdfc4e52d7a 100644 (file)
@@ -5,9 +5,10 @@
 void ehci_setup(void);
 struct usbdevice_s;
 struct usb_endpoint_descriptor;
-struct usb_pipe *ehci_alloc_pipe(struct usbdevice_s *usbdev
-                                 , struct usb_endpoint_descriptor *epdesc);
 struct usb_pipe;
+struct usb_pipe *ehci_realloc_pipe(struct usbdevice_s *usbdev
+                                   , struct usb_pipe *upipe
+                                   , struct usb_endpoint_descriptor *epdesc);
 int ehci_send_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
                       , void *data, int datasize);
 int ehci_send_bulk(struct usb_pipe *p, int dir, void *data, int datasize);
index 8551c4da4f9307b9a30c4ced1c1f1249b940e61a..1714968d577466ffda04a6e578c98250f0f80289 100644 (file)
@@ -38,7 +38,7 @@ usb_alloc_pipe(struct usbdevice_s *usbdev
     case USB_TYPE_OHCI:
         return ohci_realloc_pipe(usbdev, NULL, epdesc);
     case USB_TYPE_EHCI:
-        return ehci_alloc_pipe(usbdev, epdesc);
+        return ehci_realloc_pipe(usbdev, NULL, epdesc);
     case USB_TYPE_XHCI:
         return xhci_realloc_pipe(usbdev, NULL, epdesc);
     }