Changeset 15d3b54 in mainline for uspace/drv/uhci-hcd/uhci.c


Ignore:
Timestamp:
2011-03-14T21:24:02Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fcf07e6
Parents:
c69209d (diff), 9370884 (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:

Doxygen comments, enable hw interrupts if possible

File:
1 edited

Legend:

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

    rc69209d r15d3b54  
    6060}
    6161/*----------------------------------------------------------------------------*/
     62/** Get address of the device identified by handle.
     63 *
     64 * @param[in] dev DDF instance of the device to use.
     65 * @param[in] iid (Unused).
     66 * @param[in] call Pointer to the call that represents interrupt.
     67 */
    6268static int usb_iface_get_address(
    6369    ddf_fun_t *fun, devman_handle_t handle, usb_address_t *address)
     
    106112};
    107113/*----------------------------------------------------------------------------*/
    108 /** Gets root hub hw resources.
     114/** Get root hub hw resources (I/O registers).
    109115 *
    110116 * @param[in] fun Root hub function.
     
    127133};
    128134/*----------------------------------------------------------------------------*/
     135/** Initialize hc and rh ddf structures and their respective drivers.
     136 *
     137 * @param[in] instance UHCI structure to use.
     138 * @param[in] device DDF instance of the device to use.
     139 *
     140 * This function does all the preparatory work for hc and rh drivers:
     141 *  - gets device hw resources
     142 *  - disables UHCI legacy support
     143 *  - asks for interrupt
     144 *  - registers interrupt handler
     145 */
    129146int uhci_init(uhci_t *instance, ddf_dev_t *device)
    130147{
     
    157174            "Failed(%d) to disable legacy USB: %s.\n", ret, str_error(ret));
    158175
    159 #if 0
     176        bool interrupts = false;
    160177        ret = pci_enable_interrupts(device);
    161178        if (ret != EOK) {
     
    163180                    "Failed(%d) to enable interrupts, fall back to polling.\n",
    164181                    ret);
     182        } else {
     183                usb_log_debug("Hw interrupts enabled.\n");
     184                interrupts = true;
    165185        }
    166 #endif
    167186
    168187        instance->hc_fun = ddf_fun_create(device, fun_exposed, "uhci-hc");
    169188        ret = (instance->hc_fun == NULL) ? ENOMEM : EOK;
    170         CHECK_RET_DEST_FUN_RETURN(ret, "Failed(%d) to create HC function.\n", ret);
    171 
    172         ret = uhci_hc_init(
    173             &instance->hc, instance->hc_fun, (void*)io_reg_base, io_reg_size);
     189        CHECK_RET_DEST_FUN_RETURN(ret,
     190            "Failed(%d) to create HC function.\n", ret);
     191
     192        ret = uhci_hc_init(&instance->hc, instance->hc_fun,
     193            (void*)io_reg_base, io_reg_size, interrupts);
    174194        CHECK_RET_DEST_FUN_RETURN(ret, "Failed(%d) to init uhci-hcd.\n", ret);
    175195        instance->hc_fun->ops = &uhci_hc_ops;
     
    217237#undef CHECK_RET_FINI_RETURN
    218238}
    219 
    220239/**
    221240 * @}
Note: See TracChangeset for help on using the changeset viewer.