Changeset 4f66cc7b in mainline for uspace/drv/uhci-rhd/main.c


Ignore:
Timestamp:
2011-03-17T12:45:23Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4fec9ee, 6e3b9a58
Parents:
45dd8bf (diff), 039c66c (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:

Merged development changes

File:
1 edited

Legend:

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

    r45dd8bf r4f66cc7b  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup usb
     28/** @addtogroup drvusbuhcirh
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief UHCI driver
     32 * @brief UHCI root hub initialization routines
    3333 */
    3434#include <ddf/driver.h>
     
    4040#include <usb/debug.h>
    4141
    42 
    43 
    4442#include "root_hub.h"
    4543
     
    4745static int hc_get_my_registers(ddf_dev_t *dev,
    4846    uintptr_t *io_reg_address, size_t *io_reg_size);
     47#if 0
    4948/*----------------------------------------------------------------------------*/
    5049static int usb_iface_get_hc_handle(ddf_fun_t *fun, devman_handle_t *handle)
     
    6766        .interfaces[USB_DEV_IFACE] = &uhci_rh_usb_iface,
    6867};
     68#endif
    6969/*----------------------------------------------------------------------------*/
    70 /** Initializes a new ddf driver instance of UHCI root hub.
     70/** Initialize 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 
    9183        uintptr_t io_regs = 0;
    9284        size_t io_size = 0;
    9385
    9486        int ret = hc_get_my_registers(device, &io_regs, &io_size);
    95         assert(ret == EOK);
     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);
    9692
    97         /* TODO: verify values from hc */
    98         usb_log_info("I/O regs at 0x%X (size %zu).\n", io_regs, io_size);
     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
    9999        ret = uhci_root_hub_init(rh, (void*)io_regs, io_size, device);
    100100        if (ret != EOK) {
     
    119119};
    120120/*----------------------------------------------------------------------------*/
    121 /** Initializes global driver structures (NONE).
     121/** Initialize 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.