summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/usb/usbhub.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-03-25 22:17:36 +0000
committerStefan Reinauer <stepan@openbios.org>2010-03-25 22:17:36 +0000
commitb56f2d0ad4bfc81e7ef5ffd406c652f2c3bd954a (patch)
treeec2bbc0918ee3e1f2ee66491c7b87da204e607da /payloads/libpayload/drivers/usb/usbhub.c
parente5d30b78b7720ba3e511819b7fc51c11d642153b (diff)
downloadcoreboot-b56f2d0ad4bfc81e7ef5ffd406c652f2c3bd954a.tar.xz
USB updates from our internal tree
- support MMC2 devices - make usb stack more solid - drop some unused functions - fix lowspeed/speed naming - add support for "quirks" - improve usbhid driver Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Joseph Smith <joe@settoplinux.org> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5299 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/drivers/usb/usbhub.c')
-rw-r--r--payloads/libpayload/drivers/usb/usbhub.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/payloads/libpayload/drivers/usb/usbhub.c b/payloads/libpayload/drivers/usb/usbhub.c
index 0a5d0ebcb5..fcf4f36d5f 100644
--- a/payloads/libpayload/drivers/usb/usbhub.c
+++ b/payloads/libpayload/drivers/usb/usbhub.c
@@ -1,7 +1,7 @@
/*
* This file is part of the libpayload project.
*
- * Copyright (C) 2008 coresystems GmbH
+ * Copyright (C) 2008-2010 coresystems GmbH
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -74,9 +74,15 @@ usb_hub_scanport (usbdev_t *dev, int port)
mdelay (20);
get_status (dev, port, DR_PORT, 4, buf);
- int lowspeed = (buf[0] >> 9) & 1;
- HUB_INST (dev)->ports[port] = usb_attach_device(dev->controller, dev->address, port, lowspeed);
+ /* bit 10 9
+ * 0 0 full speed
+ * 0 1 low speed
+ * 1 0 high speed
+ */
+ int speed = ((buf[0] >> 9) & 3) ;
+
+ HUB_INST (dev)->ports[port] = usb_attach_device(dev->controller, dev->address, port, speed);
}
static int
@@ -93,7 +99,7 @@ usb_hub_report_port_changes (usbdev_t *dev)
return port;
}
-// no change
+ // no change
return -1;
}
@@ -131,12 +137,8 @@ usb_hub_init (usbdev_t *dev)
if (!dev->data)
usb_fatal("Not enough memory for USB hub.\n");
- HUB_INST (dev)->descriptor =
- (hub_descriptor_t *) get_descriptor (dev,
- gen_bmRequestType
- (device_to_host,
- class_type, dev_recp),
- 0x29, 0, 0);
+ HUB_INST (dev)->descriptor = (hub_descriptor_t *) get_descriptor(dev,
+ gen_bmRequestType(device_to_host, class_type, dev_recp), 0x29, 0, 0);
HUB_INST (dev)->num_ports = HUB_INST (dev)->descriptor->bNbrPorts;
HUB_INST (dev)->ports =
malloc (sizeof (int) * (HUB_INST (dev)->num_ports + 1));