Changeset 15d0046 in mainline for uspace/drv/bus/usb/uhci/hc.c


Ignore:
Timestamp:
2014-09-12T13:22:33Z (10 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
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.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/hc.c

    r8db09e4 r15d0046  
    151151                return rc;
    152152        }
    153 
     153       
    154154        irq_code_t irq_code = {
    155155                .rangecount = hc_irq_pio_range_count,
     
    158158                .cmds = irq_cmds
    159159        };
    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 
     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       
    169169        return EOK;
    170170}
     
    230230 *
    231231 * @param[in] instance Memory place to initialize.
     232 * @param[in] HC function node
    232233 * @param[in] regs Range of device's I/O control registers.
    233234 * @param[in] interrupts True if hw interrupts should be used.
     
    238239 * interrupt fibrils.
    239240 */
    240 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts)
     241int hc_init(hc_t *instance, ddf_fun_t *fun, addr_range_t *regs, bool interrupts)
    241242{
    242243        assert(regs->size >= sizeof(uhci_regs_t));
     
    266267        }
    267268
    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,
    269276            BANDWIDTH_AVAILABLE_USB11, bandwidth_count_usb11);
    270277
    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;
    274281
    275282        hc_init_hw(instance);
     
    425432        instance->transfers[USB_SPEED_FULL][USB_TRANSFER_BULK] =
    426433          &instance->transfers_bulk_full;
     434        instance->transfers[USB_SPEED_LOW][USB_TRANSFER_BULK] =
     435          &instance->transfers_bulk_full;
    427436
    428437        return EOK;
Note: See TracChangeset for help on using the changeset viewer.