Changes in uspace/drv/uhci-hcd/uhci.c [05ead5c:68b5ed6e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified uspace/drv/uhci-hcd/uhci.c ¶
r05ead5c r68b5ed6e 54 54 { 55 55 assert(dev); 56 hc_t *hc = &((uhci_t*)dev->driver_data)->hc;56 uhci_hc_t *hc = &((uhci_t*)dev->driver_data)->hc; 57 57 uint16_t status = IPC_GET_ARG1(*call); 58 58 assert(hc); 59 hc_interrupt(hc, status);59 uhci_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. manager;72 usb_device_keeper_t *manager = &((uhci_t*)fun->dev->driver_data)->hc.device_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 hc_ops = {109 static ddf_dev_ops_t uhci_hc_ops = { 110 110 .interfaces[USB_DEV_IFACE] = &usb_iface, 111 .interfaces[USBHC_DEV_IFACE] = & hc_iface, /* see iface.h/c */111 .interfaces[USBHC_DEV_IFACE] = &uhci_hc_iface, /* see iface.h/c */ 112 112 }; 113 113 /*----------------------------------------------------------------------------*/ … … 120 120 { 121 121 assert(fun); 122 return &(( rh_t*)fun->driver_data)->resource_list;122 return &((uhci_rh_t*)fun->driver_data)->resource_list; 123 123 } 124 124 /*----------------------------------------------------------------------------*/ … … 128 128 }; 129 129 /*----------------------------------------------------------------------------*/ 130 static ddf_dev_ops_t rh_ops = {130 static ddf_dev_ops_t uhci_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_ debug("I/O regs at 0x%X (size %zu), IRQ %d.\n",169 usb_log_info("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_INTERRUPTS178 usb_log_warning("Interrupts disabled in OS config, " \179 "falling back to polling.\n");180 #else181 177 ret = pci_enable_interrupts(device); 182 178 if (ret != EOK) { 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"); 179 usb_log_warning( 180 "Failed(%d) to enable interrupts, fall back to polling.\n", 181 ret); 187 182 } else { 188 183 usb_log_debug("Hw interrupts enabled.\n"); 189 184 interrupts = true; 190 185 } 191 #endif192 186 193 187 instance->hc_fun = ddf_fun_create(device, fun_exposed, "uhci-hc"); … … 196 190 "Failed(%d) to create HC function.\n", ret); 197 191 198 ret = hc_init(&instance->hc, instance->hc_fun,192 ret = uhci_hc_init(&instance->hc, instance->hc_fun, 199 193 (void*)io_reg_base, io_reg_size, interrupts); 200 194 CHECK_RET_DEST_FUN_RETURN(ret, "Failed(%d) to init uhci-hcd.\n", ret); 201 instance->hc_fun->ops = & hc_ops;195 instance->hc_fun->ops = &uhci_hc_ops; 202 196 instance->hc_fun->driver_data = &instance->hc; 203 197 ret = ddf_fun_bind(instance->hc_fun); … … 214 208 if (instance->rh_fun) \ 215 209 ddf_fun_destroy(instance->rh_fun); \ 216 hc_fini(&instance->hc); \210 uhci_hc_fini(&instance->hc); \ 217 211 return ret; \ 218 212 } … … 229 223 "Failed(%d) to create root hub function.\n", ret); 230 224 231 ret = rh_init(&instance->rh, instance->rh_fun,225 ret = uhci_rh_init(&instance->rh, instance->rh_fun, 232 226 (uintptr_t)instance->hc.registers + 0x10, 4); 233 227 CHECK_RET_FINI_RETURN(ret, 234 228 "Failed(%d) to setup UHCI root hub.\n", ret); 235 229 236 instance->rh_fun->ops = & rh_ops;230 instance->rh_fun->ops = &uhci_rh_ops; 237 231 instance->rh_fun->driver_data = &instance->rh; 238 232 ret = ddf_fun_bind(instance->rh_fun);
Note:
See TracChangeset
for help on using the changeset viewer.