Changeset 50114ef in mainline for uspace/drv/uhci-hcd/uhci.c


Ignore:
Timestamp:
2011-03-24T13:45:48Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
915a851
Parents:
5f80527 (diff), e18e0d6 (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 development/ changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/uhci.c

    r5f80527 r50114ef  
    5454{
    5555        assert(dev);
    56         uhci_hc_t *hc = &((uhci_t*)dev->driver_data)->hc;
     56        hc_t *hc = &((uhci_t*)dev->driver_data)->hc;
    5757        uint16_t status = IPC_GET_ARG1(*call);
    5858        assert(hc);
    59         uhci_hc_interrupt(hc, status);
     59        hc_interrupt(hc, status);
    6060}
    6161/*----------------------------------------------------------------------------*/
     
    7070{
    7171        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;
    7373
    7474        usb_address_t addr = usb_device_keeper_find(manager, handle);
     
    107107};
    108108/*----------------------------------------------------------------------------*/
    109 static ddf_dev_ops_t uhci_hc_ops = {
     109static ddf_dev_ops_t hc_ops = {
    110110        .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 */
    112112};
    113113/*----------------------------------------------------------------------------*/
     
    120120{
    121121        assert(fun);
    122         return &((uhci_rh_t*)fun->driver_data)->resource_list;
     122        return &((rh_t*)fun->driver_data)->resource_list;
    123123}
    124124/*----------------------------------------------------------------------------*/
     
    128128};
    129129/*----------------------------------------------------------------------------*/
    130 static ddf_dev_ops_t uhci_rh_ops = {
     130static ddf_dev_ops_t rh_ops = {
    131131        .interfaces[USB_DEV_IFACE] = &usb_iface,
    132132        .interfaces[HW_RES_DEV_IFACE] = &hw_res_iface
     
    175175
    176176        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
    177181        ret = pci_enable_interrupts(device);
    178182        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");
    182187        } else {
    183188                usb_log_debug("Hw interrupts enabled.\n");
    184189                interrupts = true;
    185190        }
     191#endif
    186192
    187193        instance->hc_fun = ddf_fun_create(device, fun_exposed, "uhci-hc");
     
    190196            "Failed(%d) to create HC function.\n", ret);
    191197
    192         ret = uhci_hc_init(&instance->hc, instance->hc_fun,
     198        ret = hc_init(&instance->hc, instance->hc_fun,
    193199            (void*)io_reg_base, io_reg_size, interrupts);
    194200        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;
    196202        instance->hc_fun->driver_data = &instance->hc;
    197203        ret = ddf_fun_bind(instance->hc_fun);
     
    208214        if (instance->rh_fun) \
    209215                ddf_fun_destroy(instance->rh_fun); \
    210         uhci_hc_fini(&instance->hc); \
     216        hc_fini(&instance->hc); \
    211217        return ret; \
    212218}
     
    223229            "Failed(%d) to create root hub function.\n", ret);
    224230
    225         ret = uhci_rh_init(&instance->rh, instance->rh_fun,
     231        ret = rh_init(&instance->rh, instance->rh_fun,
    226232            (uintptr_t)instance->hc.registers + 0x10, 4);
    227233        CHECK_RET_FINI_RETURN(ret,
    228234            "Failed(%d) to setup UHCI root hub.\n", ret);
    229235
    230         instance->rh_fun->ops = &uhci_rh_ops;
     236        instance->rh_fun->ops = &rh_ops;
    231237        instance->rh_fun->driver_data = &instance->rh;
    232238        ret = ddf_fun_bind(instance->rh_fun);
Note: See TracChangeset for help on using the changeset viewer.