Changeset 1a0fa29c in mainline
- Timestamp:
- 2014-01-02T20:28:50Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- da06e92
- Parents:
- 7191992
- Location:
- uspace/drv/bus/usb/uhci
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/Makefile
r7191992 r1a0fa29c 48 48 main.c \ 49 49 transfer_list.c \ 50 uhci.c \51 50 uhci_batch.c \ 52 51 uhci_rh.c \ -
uspace/drv/bus/usb/uhci/main.c
r7191992 r1a0fa29c 42 42 #include <str_error.h> 43 43 #include <usb/debug.h> 44 #include <usb/host/ddf_helpers.h> 44 45 45 #include " uhci.h"46 #include "hc.h" 46 47 47 48 #define NAME "uhci" 49 50 // TODO: This should be merged to hc_interrupt 51 static void uhci_interrupt(hcd_t *hcd, uint32_t status) 52 { 53 assert(hcd); 54 if (hcd->driver.data) 55 hc_interrupt(hcd->driver.data, status); 56 } 57 58 static int uhci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, bool irq) 59 { 60 assert(hcd); 61 assert(hcd->driver.data == NULL); 62 63 hc_t *instance = malloc(sizeof(hc_t)); 64 if (!instance) 65 return ENOMEM; 66 67 const int ret = hc_init(instance, res, irq); 68 if (ret == EOK) 69 hcd_set_implementation(hcd, instance, hc_schedule, NULL, NULL, 70 uhci_interrupt); 71 return ret; 72 } 73 74 static void uhci_driver_fini(hcd_t *hcd) 75 { 76 assert(hcd); 77 if (hcd->driver.data) 78 hc_fini(hcd->driver.data); 79 80 free(hcd->driver.data); 81 hcd_set_implementation(hcd, NULL, NULL, NULL, NULL, NULL); 82 } 48 83 49 84 static int uhci_dev_add(ddf_dev_t *device); … … 98 133 99 134 100 ret = device_setup_uhci(device); 135 ret = ddf_hcd_device_setup_all(device, USB_SPEED_FULL, 136 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11, 137 ddf_hcd_gen_irq_handler, hc_gen_irq_code, 138 uhci_driver_init, uhci_driver_fini); 101 139 if (ret != EOK) { 102 140 usb_log_error("Failed to initialize UHCI driver: %s.\n",
Note:
See TracChangeset
for help on using the changeset viewer.