Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-rhd/main.c

    rf123909 r275bf456  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup drvusbuhcirh
     28/** @addtogroup usb
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief UHCI root hub initialization routines
     32 * @brief UHCI driver
    3333 */
    3434#include <ddf/driver.h>
     
    4040#include <usb/debug.h>
    4141
     42
     43
    4244#include "root_hub.h"
    4345
     
    4547static int hc_get_my_registers(ddf_dev_t *dev,
    4648    uintptr_t *io_reg_address, size_t *io_reg_size);
    47 #if 0
    4849/*----------------------------------------------------------------------------*/
    4950static int usb_iface_get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle)
     
    6667        .interfaces[USB_DEV_IFACE] = &uhci_rh_usb_iface,
    6768};
    68 #endif
    6969/*----------------------------------------------------------------------------*/
    70 /** Initialize a new ddf driver instance of UHCI root hub.
     70/** Initializes a new ddf driver instance of UHCI root hub.
    7171 *
    7272 * @param[in] device DDF instance of the device to initialize.
     
    8181
    8282        //device->ops = &uhci_rh_ops;
     83        (void) uhci_rh_ops;
     84
     85        uhci_root_hub_t *rh = malloc(sizeof(uhci_root_hub_t));
     86        if (!rh) {
     87                usb_log_error("Failed to allocate memory for driver instance.\n");
     88                return ENOMEM;
     89        }
     90
    8391        uintptr_t io_regs = 0;
    8492        size_t io_size = 0;
    8593
    8694        int ret = hc_get_my_registers(device, &io_regs, &io_size);
    87         if (ret != EOK) {
    88                 usb_log_error("Failed(%d) to get registers from parent hc.",
    89                     ret);
    90         }
    91         usb_log_info("I/O regs at %#X (size %zu).\n", io_regs, io_size);
     95        assert(ret == EOK);
    9296
    93         uhci_root_hub_t *rh = malloc(sizeof(uhci_root_hub_t));
    94         if (!rh) {
    95                 usb_log_error("Failed to allocate driver instance.\n");
    96                 return ENOMEM;
    97         }
    98 
     97        /* TODO: verify values from hc */
     98        usb_log_info("I/O regs at 0x%X (size %zu).\n", io_regs, io_size);
    9999        ret = uhci_root_hub_init(rh, (void*)io_regs, io_size, device);
    100100        if (ret != EOK) {
     
    119119};
    120120/*----------------------------------------------------------------------------*/
    121 /** Initialize global driver structures (NONE).
     121/** Initializes global driver structures (NONE).
    122122 *
    123123 * @param[in] argc Nmber of arguments in argv vector (ignored).
Note: See TracChangeset for help on using the changeset viewer.