Changeset d09791e6 in mainline
- Timestamp:
- 2012-12-20T15:40:23Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a720ff6
- Parents:
- d9b2c73
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci.c
rd9b2c73 rd09791e6 117 117 "Failed to register irq handler: %s.\n", str_error(ret)); 118 118 119 120 119 /* Try to enable interrupts */ 121 120 bool interrupts = false; … … 131 130 } 132 131 133 ret = hcd_setup_device(device); 132 /* Initialize generic HCD driver */ 133 ret = hcd_setup_device(device, NULL); 134 134 if (ret != EOK) { 135 135 unregister_interrupt_handler(device, irq); … … 138 138 139 139 140 // TODO: Undo device_setup_hcd140 // TODO: Undo hcd_setup_device 141 141 #define CHECK_RET_CLEAN_RETURN(ret, message...) \ 142 142 if (ret != EOK) { \ … … 147 147 hc_t *hc_impl = malloc(sizeof(hc_t)); 148 148 ret = hc_impl ? EOK : ENOMEM; 149 CHECK_RET_CLEAN_RETURN(ret, "Failed to al oocate driver structure.\n");149 CHECK_RET_CLEAN_RETURN(ret, "Failed to allocate driver structure.\n"); 150 150 151 /* Initialize OHCI HC */ 151 152 ret = hc_init(hc_impl, reg_base, reg_size, interrupts); 152 153 CHECK_RET_CLEAN_RETURN(ret, "Failed to init hc: %s.\n", str_error(ret)); 153 154 155 /* Connect OHCI to generic HCD */ 154 156 hcd_set_implementation(dev_to_hcd(device), hc_impl, 155 157 hc_schedule, ohci_endpoint_init, ohci_endpoint_fini); 158 159 /* HC should be running OK. We can add root hub */ 156 160 ret = hcd_setup_hub(dev_to_hcd(device), &hc_impl->rh.address, device); 157 161 CHECK_RET_CLEAN_RETURN(ret, -
uspace/lib/usbhost/include/usb/host/hcd.h
rd9b2c73 rd09791e6 107 107 const match_id_list_t *mids); 108 108 109 int hcd_setup_device(ddf_dev_t *device );109 int hcd_setup_device(ddf_dev_t *device, ddf_fun_t **fun); 110 110 int hcd_setup_hub(hcd_t *instance, usb_address_t *address, ddf_dev_t *dev); 111 111 -
uspace/lib/usbhost/src/hcd.c
rd9b2c73 rd09791e6 307 307 * - registers interrupt handler 308 308 */ 309 int hcd_setup_device(ddf_dev_t *device )309 int hcd_setup_device(ddf_dev_t *device, ddf_fun_t **hc_fun) 310 310 { 311 311 if (device == NULL) … … 355 355 356 356 /* HC should be ok at this point (except it can't do anything) */ 357 if (hc_fun) 358 *hc_fun = instance->hc_fun; 357 359 358 360 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.