Changeset 0c2d9bb in mainline for uspace/drv/bus/usb/uhci/uhci.c


Ignore:
Timestamp:
2013-12-25T22:54:29Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b51cf2c
Parents:
f7a33de (diff), ac36aed (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/uhci.c

    rf7a33de r0c2d9bb  
    132132};
    133133
     134static pio_window_t *get_pio_window(ddf_fun_t *fun)
     135{
     136        rh_t *rh = ddf_fun_data_get(fun);
     137       
     138        if (rh == NULL)
     139                return NULL;
     140        return &rh->pio_window;
     141}
     142
     143static pio_window_ops_t pio_window_iface = {
     144        .get_pio_window = get_pio_window
     145};
     146
    134147/** RH function support for uhci_rhd */
    135148static ddf_dev_ops_t rh_ops = {
    136149        .interfaces[USB_DEV_IFACE] = &usb_iface,
    137         .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface
     150        .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface,
     151        .interfaces[PIO_WINDOW_DEV_IFACE] = &pio_window_iface
    138152};
    139153
     
    184198        ddf_fun_data_implant(instance->rh_fun, &instance->rh);
    185199
    186         uintptr_t reg_base = 0;
    187         size_t reg_size = 0;
     200        addr_range_t regs;
    188201        int irq = 0;
    189202
    190         rc = get_my_registers(device, &reg_base, &reg_size, &irq);
     203        rc = get_my_registers(device, &regs, &irq);
    191204        if (rc != EOK) {
    192205                usb_log_error("Failed to get I/O addresses for %" PRIun ": %s.\n",
     
    194207                goto error;
    195208        }
    196         usb_log_debug("I/O regs at 0x%p (size %zu), IRQ %d.\n",
    197             (void *) reg_base, reg_size, irq);
     209        usb_log_debug("I/O regs at %p (size %zu), IRQ %d.\n",
     210            RNGABSPTR(regs), RNGSZ(regs), irq);
    198211
    199212        rc = disable_legacy(device);
     
    204217        }
    205218
    206         rc = hc_register_irq_handler(device, reg_base, reg_size, irq, irq_handler);
     219        rc = hc_register_irq_handler(device, &regs, irq, irq_handler);
    207220        if (rc != EOK) {
    208221                usb_log_error("Failed to register interrupt handler: %s.\n",
     
    223236        }
    224237
    225         rc = hc_init(&instance->hc, (void*)reg_base, reg_size, interrupts);
     238        rc = hc_init(&instance->hc, &regs, interrupts);
    226239        if (rc != EOK) {
    227240                usb_log_error("Failed to init uhci_hcd: %s.\n", str_error(rc));
     
    247260        }
    248261
    249         rc = rh_init(&instance->rh, instance->rh_fun,
    250             (uintptr_t)instance->hc.registers + 0x10, 4);
     262        rc = rh_init(&instance->rh, instance->rh_fun, &regs, 0x10, 4);
    251263        if (rc != EOK) {
    252264                usb_log_error("Failed to setup UHCI root hub: %s.\n",
Note: See TracChangeset for help on using the changeset viewer.