aboutsummaryrefslogtreecommitdiff
path: root/src/usb-uhci.h
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2010-02-26 08:57:13 -0500
committerKevin O'Connor <kevin@koconnor.net>2010-02-28 17:26:25 -0500
commit357bdfa26a681d614f04e842f85850fe5848f6fe (patch)
tree3b992d2b421d990cf3fe41ed5401826e3015bdf1 /src/usb-uhci.h
parent7fb8ba866e112491feb64b2cf82b762fd9071f89 (diff)
downloadseabios-hppa-357bdfa26a681d614f04e842f85850fe5848f6fe.zip
seabios-hppa-357bdfa26a681d614f04e842f85850fe5848f6fe.tar.gz
seabios-hppa-357bdfa26a681d614f04e842f85850fe5848f6fe.tar.bz2
Prefer passing a USB "pipe" structure over a USB endp encoding.
Instead of passing the "u32 endp" encoding of the usb endpoint, allocate a "struct usb_pipe" for each end point and pass that. Allocate a control pipe for every device found. Support freeing the pipes after they are done. Implement pipe allocation and freeing for both UHCI and OHCI controllers. Also, don't define every UHCI qh to include a pipe - create a separate structure "struct uhci_pipe". Also, be sure to clear the USBControllers on reset. Also, convert usb_hub_init to return 0 on success. Also, cleanup some of the USB debug messages to make them more consistent.
Diffstat (limited to 'src/usb-uhci.h')
-rw-r--r--src/usb-uhci.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/usb-uhci.h b/src/usb-uhci.h
index d7ebb4e..8dbee9c 100644
--- a/src/usb-uhci.h
+++ b/src/usb-uhci.h
@@ -1,12 +1,12 @@
#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);
@@ -120,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