Prefer passing a USB "pipe" structure over a USB endp encoding.
[seabios.git] / src / usb-uhci.h
index 03ac9cd858df93381917d90b575e6f0ff0fbd817..8dbee9c495a0147271cabd3c2831ac609f96233e 100644 (file)
@@ -1,13 +1,15 @@
 #ifndef __USB_UHCI_H
 #define __USB_UHCI_H
 
-#include "usb.h" // struct usb_pipe
-
 // usb-uhci.c
-struct usb_s;
 void uhci_init(void *data);
-int uhci_control(u32 endp, int dir, const void *cmd, int cmdsize
+struct usb_pipe;
+void uhci_free_pipe(struct usb_pipe *pipe);
+struct usb_pipe *uhci_alloc_control_pipe(u32 endp);
+int uhci_control(struct usb_pipe *pipe, int dir, const void *cmd, int cmdsize
                  , void *data, int datasize);
+struct usb_pipe *uhci_alloc_bulk_pipe(u32 endp);
+int uhci_send_bulk(struct usb_pipe *pipe, int dir, void *data, int datasize);
 struct usb_pipe *uhci_alloc_intr_pipe(u32 endp, int frameexp);
 int uhci_poll_intr(struct usb_pipe *pipe, void *data);
 
@@ -88,7 +90,7 @@ struct uhci_framelist {
 #define TD_CTRL_ACTLEN_MASK     0x7FF   /* actual length, encoded as n - 1 */
 
 #define TD_CTRL_ANY_ERROR       (TD_CTRL_STALLED | TD_CTRL_DBUFERR | \
-                                 TD_CTRL_BABBLE | TD_CTRL_CRCTIME | \
+                                 TD_CTRL_BABBLE | TD_CTRL_CRCTIMEO | \
                                  TD_CTRL_BITSTUFF)
 #define uhci_maxerr(err)                ((err) << TD_CTRL_C_ERR_SHIFT)
 
@@ -118,10 +120,6 @@ struct uhci_td {
 struct uhci_qh {
     u32 link;
     u32 element;
-
-    // Software fields
-    struct uhci_td *next_td;
-    struct usb_pipe pipe;
 } PACKED;
 
 #define UHCI_PTR_BITS           0x000F