Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ehci-hcd/main.c

    r0969e45e r81608b5b  
    2727 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828 */
    29 /** @addtogroup usbdrvehci
     29/** @addtogroup drvusbehci
    3030 * @{
    3131 */
     
    4444
    4545#include "pci.h"
    46 
    47 #define NAME "ehci-hcd"
     46#include "ehci.h"
    4847
    4948static int ehci_add_device(ddf_dev_t *device);
     
    5756        .driver_ops = &ehci_driver_ops
    5857};
     58static ddf_dev_ops_t hc_ops = {
     59        .interfaces[USBHC_DEV_IFACE] = &ehci_hc_iface,
     60};
     61
    5962/*----------------------------------------------------------------------------*/
     63/** Initializes a new ddf driver instance of EHCI hcd.
     64 *
     65 * @param[in] device DDF instance of the device to initialize.
     66 * @return Error code.
     67 */
    6068static int ehci_add_device(ddf_dev_t *device)
    6169{
     
    6674        return ret; \
    6775}
    68 
    69         usb_log_info("uhci_add_device() called\n");
    7076
    7177        uintptr_t mem_reg_base = 0;
     
    8490            "Failed(%d) disable legacy USB: %s.\n", ret, str_error(ret));
    8591
     92        ddf_fun_t *hc_fun = ddf_fun_create(device, fun_exposed, "ehci-hc");
     93        if (hc_fun == NULL) {
     94                usb_log_error("Failed to create EHCI function.\n");
     95                return ENOMEM;
     96        }
     97        hc_fun->ops = &hc_ops;
     98        ret = ddf_fun_bind(hc_fun);
     99
     100        CHECK_RET_RETURN(ret,
     101            "Failed to bind EHCI function: %s.\n",
     102            str_error(ret));
     103
     104        usb_log_info("Controlling new EHCI device `%s' (handle %llu).\n",
     105            device->name, device->handle);
     106
    86107        return EOK;
    87108#undef CHECK_RET_RETURN
    88109}
    89110/*----------------------------------------------------------------------------*/
     111/** Initializes global driver structures (NONE).
     112 *
     113 * @param[in] argc Nmber of arguments in argv vector (ignored).
     114 * @param[in] argv Cmdline argument vector (ignored).
     115 * @return Error code.
     116 *
     117 * Driver debug level is set here.
     118 */
    90119int main(int argc, char *argv[])
    91120{
    92         usb_log_enable(USB_LOG_LEVEL_ERROR, NAME);
     121        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    93122        return ddf_driver_main(&ehci_driver);
    94123}
Note: See TracChangeset for help on using the changeset viewer.