Print a meaningful warning message when trying to use OHCI bulk.
---
src/usb-ohci.c | 15 +++++++++++++++
src/usb-ohci.h | 2 ++
src/usb.c | 4 ++--
3 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/usb-ohci.c b/src/usb-ohci.c
index 7b975d9..7e91b9f 100644
--- a/src/usb-ohci.c
+++ b/src/usb-ohci.c
@@ -412,6 +412,21 @@ ohci_control(struct usb_pipe *p, int dir, const void *cmd, int cmdsize
}
struct usb_pipe *
+ohci_alloc_bulk_pipe(struct usb_pipe *dummy)
+{
+ if (! CONFIG_USB_OHCI)
+ return NULL;
+ dprintf(1, "OHCI Bulk transfers not supported.\n");
+ return NULL;
+}
+
+int
+ohci_send_bulk(struct usb_pipe *p, int dir, void *data, int datasize)
+{
+ return -1;
+}
+
+struct usb_pipe *
ohci_alloc_intr_pipe(struct usb_pipe *dummy, int frameexp)
{
if (! CONFIG_USB_OHCI)
diff --git a/src/usb-ohci.h b/src/usb-ohci.h
index 0cadbd6..7dd2f09 100644
--- a/src/usb-ohci.h
+++ b/src/usb-ohci.h
@@ -8,6 +8,8 @@ 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);
+struct usb_pipe *ohci_alloc_bulk_pipe(struct usb_pipe *dummy);
+int ohci_send_bulk(struct usb_pipe *p, int dir, void *data, int datasize);
struct usb_pipe *ohci_alloc_intr_pipe(struct usb_pipe *dummy, int frameexp);
int ohci_poll_intr(struct usb_pipe *p, void *data);
diff --git a/src/usb.c b/src/usb.c
index 7e6a18b..cefc5f3 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -94,7 +94,7 @@ alloc_bulk_pipe(struct usb_pipe *pipe, struct usb_endpoint_descriptor *epdesc)
case USB_TYPE_UHCI:
return uhci_alloc_bulk_pipe(&dummy);
case USB_TYPE_OHCI:
- return NULL;
+ return ohci_alloc_bulk_pipe(&dummy);
case USB_TYPE_EHCI:
return ehci_alloc_bulk_pipe(&dummy);
}
@@ -108,7 +108,7 @@ usb_send_bulk(struct usb_pipe *pipe_fl, int dir, void *data, int datasize)
case USB_TYPE_UHCI:
return uhci_send_bulk(pipe_fl, dir, data, datasize);
case USB_TYPE_OHCI:
- return -1;
+ return ohci_send_bulk(pipe_fl, dir, data, datasize);
case USB_TYPE_EHCI:
return ehci_send_bulk(pipe_fl, dir, data, datasize);
}
--
1.7.2.3