Changeset f97717d9 in mainline for uspace/drv/uhci-hcd/uhci.c
- Timestamp:
- 2011-03-25T16:22:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- da3dafc, e6223239
- Parents:
- d8421c4 (diff), f08c560 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/uhci.c
rd8421c4 rf97717d9 54 54 { 55 55 assert(dev); 56 uhci_hc_t *hc = &((uhci_t*)dev->driver_data)->hc;56 hc_t *hc = &((uhci_t*)dev->driver_data)->hc; 57 57 uint16_t status = IPC_GET_ARG1(*call); 58 58 assert(hc); 59 uhci_hc_interrupt(hc, status);59 hc_interrupt(hc, status); 60 60 } 61 61 /*----------------------------------------------------------------------------*/ … … 70 70 { 71 71 assert(fun); 72 usb_device_keeper_t *manager = &((uhci_t*)fun->dev->driver_data)->hc. device_manager;72 usb_device_keeper_t *manager = &((uhci_t*)fun->dev->driver_data)->hc.manager; 73 73 74 74 usb_address_t addr = usb_device_keeper_find(manager, handle); … … 107 107 }; 108 108 /*----------------------------------------------------------------------------*/ 109 static ddf_dev_ops_t uhci_hc_ops = {109 static ddf_dev_ops_t hc_ops = { 110 110 .interfaces[USB_DEV_IFACE] = &usb_iface, 111 .interfaces[USBHC_DEV_IFACE] = & uhci_hc_iface, /* see iface.h/c */111 .interfaces[USBHC_DEV_IFACE] = &hc_iface, /* see iface.h/c */ 112 112 }; 113 113 /*----------------------------------------------------------------------------*/ … … 120 120 { 121 121 assert(fun); 122 return &(( uhci_rh_t*)fun->driver_data)->resource_list;122 return &((rh_t*)fun->driver_data)->resource_list; 123 123 } 124 124 /*----------------------------------------------------------------------------*/ … … 128 128 }; 129 129 /*----------------------------------------------------------------------------*/ 130 static ddf_dev_ops_t uhci_rh_ops = {130 static ddf_dev_ops_t rh_ops = { 131 131 .interfaces[USB_DEV_IFACE] = &usb_iface, 132 132 .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface … … 167 167 CHECK_RET_DEST_FUN_RETURN(ret, 168 168 "Failed(%d) to get I/O addresses:.\n", ret, device->handle); 169 usb_log_ info("I/O regs at 0x%X (size %zu), IRQ %d.\n",169 usb_log_debug("I/O regs at 0x%X (size %zu), IRQ %d.\n", 170 170 io_reg_base, io_reg_size, irq); 171 171 … … 175 175 176 176 bool interrupts = false; 177 #ifdef CONFIG_USBHC_NO_INTERRUPTS 178 usb_log_warning("Interrupts disabled in OS config, " \ 179 "falling back to polling.\n"); 180 #else 177 181 ret = pci_enable_interrupts(device); 178 182 if (ret != EOK) { 179 usb_log_warning( 180 "Failed(%d) to enable interrupts, fall back to polling.\n", 181 ret); 183 usb_log_warning("Failed to enable interrupts: %s.\n", 184 str_error(ret)); 185 usb_log_info("HW interrupts not available, " \ 186 "falling back to polling.\n"); 182 187 } else { 183 188 usb_log_debug("Hw interrupts enabled.\n"); 184 189 interrupts = true; 185 190 } 191 #endif 186 192 187 193 instance->hc_fun = ddf_fun_create(device, fun_exposed, "uhci-hc"); … … 190 196 "Failed(%d) to create HC function.\n", ret); 191 197 192 ret = uhci_hc_init(&instance->hc, instance->hc_fun,198 ret = hc_init(&instance->hc, instance->hc_fun, 193 199 (void*)io_reg_base, io_reg_size, interrupts); 194 200 CHECK_RET_DEST_FUN_RETURN(ret, "Failed(%d) to init uhci-hcd.\n", ret); 195 instance->hc_fun->ops = & uhci_hc_ops;201 instance->hc_fun->ops = &hc_ops; 196 202 instance->hc_fun->driver_data = &instance->hc; 197 203 ret = ddf_fun_bind(instance->hc_fun); … … 208 214 if (instance->rh_fun) \ 209 215 ddf_fun_destroy(instance->rh_fun); \ 210 uhci_hc_fini(&instance->hc); \216 hc_fini(&instance->hc); \ 211 217 return ret; \ 212 218 } … … 223 229 "Failed(%d) to create root hub function.\n", ret); 224 230 225 ret = uhci_rh_init(&instance->rh, instance->rh_fun,231 ret = rh_init(&instance->rh, instance->rh_fun, 226 232 (uintptr_t)instance->hc.registers + 0x10, 4); 227 233 CHECK_RET_FINI_RETURN(ret, 228 234 "Failed(%d) to setup UHCI root hub.\n", ret); 229 235 230 instance->rh_fun->ops = & uhci_rh_ops;236 instance->rh_fun->ops = &rh_ops; 231 237 instance->rh_fun->driver_data = &instance->rh; 232 238 ret = ddf_fun_bind(instance->rh_fun);
Note:
See TracChangeset
for help on using the changeset viewer.