Changeset 15d0046 in mainline for uspace/drv/bus/usb/uhci/hc.c
- Timestamp:
- 2014-09-12T13:22:33Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b20126
- Parents:
- 8db09e4 (diff), 105d8d6 (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/bus/usb/uhci/hc.c
r8db09e4 r15d0046 151 151 return rc; 152 152 } 153 153 154 154 irq_code_t irq_code = { 155 155 .rangecount = hc_irq_pio_range_count, … … 158 158 .cmds = irq_cmds 159 159 }; 160 161 162 163 164 165 166 167 168 160 161 /* Register handler to avoid interrupt lockup */ 162 rc = register_interrupt_handler(device, irq, handler, &irq_code); 163 if (rc != EOK) { 164 usb_log_error("Failed to register interrupt handler: %s.\n", 165 str_error(rc)); 166 return rc; 167 } 168 169 169 return EOK; 170 170 } … … 230 230 * 231 231 * @param[in] instance Memory place to initialize. 232 * @param[in] HC function node 232 233 * @param[in] regs Range of device's I/O control registers. 233 234 * @param[in] interrupts True if hw interrupts should be used. … … 238 239 * interrupt fibrils. 239 240 */ 240 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts)241 int hc_init(hc_t *instance, ddf_fun_t *fun, addr_range_t *regs, bool interrupts) 241 242 { 242 243 assert(regs->size >= sizeof(uhci_regs_t)); … … 266 267 } 267 268 268 hcd_init(&instance->generic, USB_SPEED_FULL, 269 instance->generic = ddf_fun_data_alloc(fun, sizeof(hcd_t)); 270 if (instance->generic == NULL) { 271 usb_log_error("Out of memory.\n"); 272 return ENOMEM; 273 } 274 275 hcd_init(instance->generic, USB_SPEED_FULL, 269 276 BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11); 270 277 271 instance->generic .private_data = instance;272 instance->generic .schedule = hc_schedule;273 instance->generic .ep_add_hook = NULL;278 instance->generic->private_data = instance; 279 instance->generic->schedule = hc_schedule; 280 instance->generic->ep_add_hook = NULL; 274 281 275 282 hc_init_hw(instance); … … 425 432 instance->transfers[USB_SPEED_FULL][USB_TRANSFER_BULK] = 426 433 &instance->transfers_bulk_full; 434 instance->transfers[USB_SPEED_LOW][USB_TRANSFER_BULK] = 435 &instance->transfers_bulk_full; 427 436 428 437 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.