Changeset 7813516 in mainline for uspace/drv/bus/usb/ehci/hc.c


Ignore:
Timestamp:
2014-01-01T01:19:10Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7191992
Parents:
d1df381
Message:

uhci,ohci,ehci: Use all hw resources to initialize HC

File:
1 edited

Legend:

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

    rd1df381 r7813516  
    157157 * @return Error code
    158158 */
    159 int hc_init(hc_t *instance, addr_range_t *regs, bool interrupts)
    160 {
    161         assert(instance);
    162 
    163         int ret = pio_enable_range(regs, (void **) &instance->caps);
     159int hc_init(hc_t *instance, const hw_res_list_parsed_t *hw_res, bool interrupts)
     160{
     161        assert(instance);
     162        assert(hw_res);
     163        if (hw_res->mem_ranges.count != 1 ||
     164            hw_res->mem_ranges.ranges[0].size <
     165                (sizeof(ehci_caps_regs_t) + sizeof(ehci_regs_t)))
     166            return EINVAL;
     167
     168        int ret = pio_enable_range(&hw_res->mem_ranges.ranges[0],
     169            (void **)&instance->caps);
    164170        if (ret != EOK) {
    165171                usb_log_error("Failed to gain access to device registers: %s.\n",
     
    167173                return ret;
    168174        }
     175        usb_log_debug("Device registers at %" PRIx64 " (%zuB) accessible.\n",
     176            hw_res->mem_ranges.ranges[0].address.absolute,
     177            hw_res->mem_ranges.ranges[0].size);
    169178        instance->registers =
    170179            (void*)instance->caps + EHCI_RD8(instance->caps->caplength);
     
    194203        return EOK;
    195204}
     205
     206/** Safely dispose host controller internal structures
     207 *
     208 * @param[in] instance Host controller structure to use.
     209 */
     210void hc_fini(hc_t *instance)
     211{
     212        assert(instance);
     213        /* TODO: implement*/
     214};
    196215
    197216void hc_enqueue_endpoint(hc_t *instance, const endpoint_t *ep)
Note: See TracChangeset for help on using the changeset viewer.