From 482af6d15ca8eed28b51edc11692815419326d65 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Fri, 24 May 2013 15:48:56 +0200 Subject: libpayload: Redirect USB slave init through controller driver xHCI requires special treatment of set_address since it determines the device number itself (instead of the driver, as with the other controllers). The controller also wants to validate a chosen device configuration and we need to setup additional structures for the device and the endpoints. Therefore, we add three functions to the hci_t structure, namely: set_address() finish_device_config() destroy_device() Current implementation for the Set Address request moved into generic_set_address() which is set_address() for the UHCI, OCHI and EHCI drivers. The latter two are only provided as hooks for the xHCI driver. The Set Configuration request is moved after endpoint enumeration. For all other controller drivers nothing changes, as there is no other device communication between the lines where the set_configuration() call moved. Change-Id: I6127627b9367ef573aa1a1525782bc1304ea350d Signed-off-by: Nico Huber Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/3447 Tested-by: build bot (Jenkins) Reviewed-by: Anton Kochkov Reviewed-by: Paul Menzel Reviewed-by: Stefan Reinauer --- payloads/libpayload/drivers/usb/ohci.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'payloads/libpayload/drivers/usb/ohci.c') diff --git a/payloads/libpayload/drivers/usb/ohci.c b/payloads/libpayload/drivers/usb/ohci.c index 44eba310c3..95db5f4af8 100644 --- a/payloads/libpayload/drivers/usb/ohci.c +++ b/payloads/libpayload/drivers/usb/ohci.c @@ -189,6 +189,9 @@ ohci_init (pcidev_t addr) controller->shutdown = ohci_shutdown; controller->bulk = ohci_bulk; controller->control = ohci_control; + controller->set_address = generic_set_address; + controller->finish_device_config = NULL; + controller->destroy_device = NULL; controller->create_intr_queue = ohci_create_intr_queue; controller->destroy_intr_queue = ohci_destroy_intr_queue; controller->poll_intr_queue = ohci_poll_intr_queue; -- cgit v1.2.3