diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2014-10-16 13:40:42 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2014-10-16 16:30:15 -0400 |
commit | 277ea6f5d145f77d2374b9425016735c302811a0 (patch) | |
tree | 7e12c803d58c3c248066a179c9235f1922fb6eb6 | |
parent | 2e0c2ea74f1b02cb7a112b59643862f886608e97 (diff) | |
download | seabios-277ea6f5d145f77d2374b9425016735c302811a0.zip seabios-277ea6f5d145f77d2374b9425016735c302811a0.tar.gz seabios-277ea6f5d145f77d2374b9425016735c302811a0.tar.bz2 |
ehci: Export ehci_realloc_pipe() instead of ehci_alloc_pipe()
Support alloc, update, and free from the single exported function.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/hw/usb-ehci.c | 7 | ||||
-rw-r--r-- | src/hw/usb-ehci.h | 5 | ||||
-rw-r--r-- | src/hw/usb.c | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/hw/usb-ehci.c b/src/hw/usb-ehci.c index 1df7ec8..8938915 100644 --- a/src/hw/usb-ehci.c +++ b/src/hw/usb-ehci.c @@ -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); diff --git a/src/hw/usb-ehci.h b/src/hw/usb-ehci.h index 6346d78..da74438 100644 --- a/src/hw/usb-ehci.h +++ b/src/hw/usb-ehci.h @@ -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); diff --git a/src/hw/usb.c b/src/hw/usb.c index 8551c4d..1714968 100644 --- a/src/hw/usb.c +++ b/src/hw/usb.c @@ -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); } |