summaryrefslogtreecommitdiffstats
path: root/payloads/libpayload/drivers/usb/uhci.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-06-07 13:58:17 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2010-06-07 13:58:17 +0000
commitd78691d49db4efb03c1466f9a02c590df1f5efc1 (patch)
treed3381d14d72586bbed660287d2ccba27328378bb /payloads/libpayload/drivers/usb/uhci.c
parentaed992054f3af248e12ec88de4c047456fe9b104 (diff)
downloadcoreboot-d78691d49db4efb03c1466f9a02c590df1f5efc1.tar.gz
coreboot-d78691d49db4efb03c1466f9a02c590df1f5efc1.tar.bz2
coreboot-d78691d49db4efb03c1466f9a02c590df1f5efc1.zip
Avoid using the name "pid_t", which is used on unixoid systems.
Move controller specific data structures into private headers, to avoid conflicts between controller drivers. Factor out the USB PID ids, which are only exposed on UHCI. It's of not much use on the other controllers. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5616 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/drivers/usb/uhci.c')
-rw-r--r--payloads/libpayload/drivers/usb/uhci.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/payloads/libpayload/drivers/usb/uhci.c b/payloads/libpayload/drivers/usb/uhci.c
index b6ed994e9368..36d8945d5179 100644
--- a/payloads/libpayload/drivers/usb/uhci.c
+++ b/payloads/libpayload/drivers/usb/uhci.c
@@ -29,16 +29,17 @@
//#define USB_DEBUG
+#include <arch/virtual.h>
#include <usb/usb.h>
#include "uhci.h"
-#include <arch/virtual.h>
+#include "uhci_private.h"
static void uhci_start (hci_t *controller);
static void uhci_stop (hci_t *controller);
static void uhci_reset (hci_t *controller);
static void uhci_shutdown (hci_t *controller);
static int uhci_bulk (endpoint_t *ep, int size, u8 *data, int finalize);
-static int uhci_control (usbdev_t *dev, pid_t dir, int drlen, void *devreq,
+static int uhci_control (usbdev_t *dev, direction_t dir, int drlen, void *devreq,
int dalen, u8 *data);
static void* uhci_create_intr_queue (endpoint_t *ep, int reqsize, int reqcount, int reqtiming);
static void uhci_destroy_intr_queue (endpoint_t *ep, void *queue);
@@ -66,13 +67,13 @@ td_dump (td_t *td)
char td_value[3];
char *td_type;
switch (td->pid) {
- case SETUP:
+ case UHCI_SETUP:
td_type="SETUP";
break;
- case IN:
+ case UHCI_IN:
td_type="IN";
break;
- case OUT:
+ case UHCI_OUT:
td_type="OUT";
break;
default:
@@ -296,7 +297,7 @@ min (int a, int b)
}
static int
-uhci_control (usbdev_t *dev, pid_t dir, int drlen, void *devreq, int dalen,
+uhci_control (usbdev_t *dev, direction_t dir, int drlen, void *devreq, int dalen,
unsigned char *data)
{
int endp = 0; /* this is control: always 0 */
@@ -316,7 +317,7 @@ uhci_control (usbdev_t *dev, pid_t dir, int drlen, void *devreq, int dalen,
tds[count].depth_first = 1;
tds[count].terminate = 1;
- tds[0].pid = SETUP;
+ tds[0].pid = UHCI_SETUP;
tds[0].dev_addr = dev->address;
tds[0].endp = endp;
tds[0].maxlen = maxlen (drlen);
@@ -328,7 +329,11 @@ uhci_control (usbdev_t *dev, pid_t dir, int drlen, void *devreq, int dalen,
int toggle = 1;
for (i = 1; i < count; i++) {
- tds[i].pid = dir;
+ switch (dir) {
+ case SETUP: tds[i].pid = UHCI_SETUP; break;
+ case IN: tds[i].pid = UHCI_IN; break;
+ case OUT: tds[i].pid = UHCI_OUT; break;
+ }
tds[i].dev_addr = dev->address;
tds[i].endp = endp;
tds[i].maxlen = maxlen (min (mlen, dalen));
@@ -342,7 +347,7 @@ uhci_control (usbdev_t *dev, pid_t dir, int drlen, void *devreq, int dalen,
data += mlen;
}
- tds[count].pid = (dir == OUT) ? IN : OUT;
+ tds[count].pid = (dir == OUT) ? UHCI_IN : UHCI_OUT;
tds[count].dev_addr = dev->address;
tds[count].endp = endp;
tds[count].maxlen = maxlen (0);