Changeset 3f03199 in mainline for uspace/drv/bus/usb/ehci/res.c


Ignore:
Timestamp:
2013-09-15T06:33:53Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9348862
Parents:
dd7078c (diff), 1c0cef0 (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.

Major conflicts in USB HC drivers.
Compiles and UHCI works (qemu).
OHCI has device remove problems.

File:
1 edited

Legend:

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

    rdd7078c r3f03199  
    7171 *
    7272 * @param[in] dev Device asking for the addresses.
    73  * @param[out] mem_reg_address Base address of the memory range.
    74  * @param[out] mem_reg_size Size of the memory range.
     73 * @param[out] mem_regs_p Pointer to the register range.
    7574 * @param[out] irq_no IRQ assigned to the device.
    7675 * @return Error code.
    7776 */
    7877int get_my_registers(ddf_dev_t *dev,
    79     uintptr_t *mem_reg_address, size_t *mem_reg_size, int *irq_no)
     78    addr_range_t *mem_regs_p, int *irq_no)
    8079{
    8180        assert(dev);
     
    9998        }
    10099
    101         if (mem_reg_address)
    102                 *mem_reg_address = hw_res.mem_ranges.ranges[0].address;
    103         if (mem_reg_size)
    104                 *mem_reg_size = hw_res.mem_ranges.ranges[0].size;
     100        if (mem_regs_p)
     101                *mem_regs_p = hw_res.mem_ranges.ranges[0];
    105102        if (irq_no)
    106103                *irq_no = hw_res.irqs.irqs[0];
     
    234231}
    235232
    236 int disable_legacy(ddf_dev_t *device, uintptr_t reg_base, size_t reg_size)
     233int disable_legacy(ddf_dev_t *device, addr_range_t *reg_range)
    237234{
    238235        assert(device);
    239236        usb_log_debug("Disabling EHCI legacy support.\n");
    240237
    241 #define CHECK_RET_RETURN(ret, message...) \
    242         if (ret != EOK) { \
    243                 usb_log_error(message); \
    244                 return ret; \
    245         } else (void)0
    246 
    247238        /* Map EHCI registers */
    248239        void *regs = NULL;
    249         int ret = pio_enable((void*)reg_base, reg_size, &regs);
    250         CHECK_RET_RETURN(ret, "Failed to map registers %p: %s.\n",
    251             (void *) reg_base, str_error(ret));
     240        int ret = pio_enable_range(reg_range, &regs);
     241        if (ret != EOK) {
     242                usb_log_error("Failed to map registers %p: %s.\n",
     243                    RNGABSPTR(*reg_range), str_error(ret));
     244                return ret;
     245        }
    252246
    253247        usb_log_debug2("Registers mapped at: %p.\n", regs);
     
    264258
    265259        ret = disable_extended_caps(device, eecp);
    266         CHECK_RET_RETURN(ret, "Failed to disable extended capabilities: %s.\n",
    267             str_error(ret));
    268 
    269 #undef CHECK_RET_RETURN
     260        if (ret != EOK) {
     261                usb_log_error("Failed to disable extended capabilities: %s.\n",
     262                    str_error(ret));
     263                return ret;
     264        }
     265
    270266
    271267        /*
Note: See TracChangeset for help on using the changeset viewer.