Changeset 53332b5b in mainline for uspace/drv/bus/usb/ehci/main.c


Ignore:
Timestamp:
2012-12-21T11:01:09Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ef03d7
Parents:
a720ff6
Message:

libusbhost: Move ddf specific functions to separate header.

Switch ehci to using libusbhost proided routines.
Make hcd_iface private.

File:
1 edited

Legend:

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

    ra720ff6 r53332b5b  
    4040
    4141#include <usb_iface.h>
    42 #include <usb/ddfiface.h>
    4342#include <usb/debug.h>
    44 #include <usb/host/hcd.h>
     43#include <usb/host/ddf_helpers.h>
    4544
    4645#include "res.h"
     
    5756        .name = NAME,
    5857        .driver_ops = &ehci_driver_ops
    59 };
    60 static ddf_dev_ops_t hc_ops = {
    61         .interfaces[USBHC_DEV_IFACE] = &hcd_iface,
    6258};
    6359
     
    9288            "Failed to disable legacy USB: %s.\n", str_error(ret));
    9389
    94         ddf_fun_t *hc_fun = ddf_fun_create(device, fun_exposed, "ehci_hc");
    95         if (hc_fun == NULL) {
    96                 usb_log_error("Failed to create EHCI function.\n");
    97                 return ENOMEM;
    98         }
    99         hcd_t *ehci_hc = ddf_fun_data_alloc(hc_fun, sizeof(hcd_t));
    100         if (ehci_hc == NULL) {
    101                 usb_log_error("Failed to alloc generic HC driver.\n");
    102                 return ENOMEM;
    103         }
    104         /* High Speed, no bandwidth */
    105         hcd_init(ehci_hc, USB_SPEED_HIGH, 0, NULL);
    106         ddf_fun_set_ops(hc_fun,  &hc_ops);
    107 
    108         ret = ddf_fun_bind(hc_fun);
     90        /* TODO High Speed, no bandwidth */
     91        ret = hcd_ddf_setup_device(device, NULL);       
    10992        CHECK_RET_RETURN(ret,
    110             "Failed to bind EHCI function: %s.\n",
    111             str_error(ret));
    112         ret = ddf_fun_add_to_category(hc_fun, USB_HC_CATEGORY);
    113         CHECK_RET_RETURN(ret,
    114             "Failed to add EHCI to HC class: %s.\n",
    115             str_error(ret));
     93            "Failed to init generci hcd driver: %s\n", str_error(ret));
    11694
    11795        usb_log_info("Controlling new EHCI device `%s' (handle %" PRIun ").\n",
Note: See TracChangeset for help on using the changeset viewer.