Changeset 0c2d9bb in mainline for uspace/drv/bus/usb/uhcirh/root_hub.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/uhcirh/root_hub.c

    rf7a33de r0c2d9bb  
    3636#include <ddi.h>
    3737#include <usb/debug.h>
     38#include <device/hw_res_parsed.h>
    3839
    3940#include "root_hub.h"
     
    4243 *
    4344 * @param[in] instance Driver memory structure to use.
    44  * @param[in] addr Address of I/O registers.
    45  * @param[in] size Size of available I/O space.
     45 * @param[in] io_regs Range of I/O registers.
    4646 * @param[in] rh Pointer to DDF instance of the root hub driver.
    4747 * @return Error code.
    4848 */
    49 int uhci_root_hub_init(
    50   uhci_root_hub_t *instance, void *addr, size_t size, ddf_dev_t *rh)
     49int uhci_root_hub_init(uhci_root_hub_t *instance, addr_range_t *io_regs,
     50    ddf_dev_t *rh)
    5151{
     52        port_status_t *regs;
     53
    5254        assert(instance);
    5355        assert(rh);
    5456
    5557        /* Allow access to root hub port registers */
    56         assert(sizeof(port_status_t) * UHCI_ROOT_HUB_PORT_COUNT <= size);
    57         port_status_t *regs;
    58         int ret = pio_enable(addr, size, (void**)&regs);
     58        assert(sizeof(*regs) * UHCI_ROOT_HUB_PORT_COUNT <= io_regs->size);
     59
     60        int ret = pio_enable_range(io_regs, (void **) &regs);
    5961        if (ret < 0) {
    6062                usb_log_error(
    6163                    "Failed(%d) to gain access to port registers at %p: %s.\n",
    62                     ret, regs, str_error(ret));
     64                    ret, RNGABSPTR(*io_regs), str_error(ret));
    6365                return ret;
    6466        }
Note: See TracChangeset for help on using the changeset viewer.