Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 561f41b in mainline for uspace/drv/ohci/main.c


Ignore:
Timestamp:
2011-05-07T16:00:10Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
60b3bea
Parents:
b23e9cc (diff), 3ae5ca8 (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:

Major refactoring #211 should be fixed

UHCI: all interrupts are either communication driven or fatal
OHCI: control is taken only after we can handle interrupts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/main.c

    rb23e9cc r561f41b  
    4343#define NAME "ohci"
    4444
    45 static int ohci_add_device(ddf_dev_t *device);
     45/** Initializes a new ddf driver instance of OHCI hcd.
     46 *
     47 * @param[in] device DDF instance of the device to initialize.
     48 * @return Error code.
     49 */
     50static int ohci_add_device(ddf_dev_t *device)
     51{
     52        usb_log_debug("ohci_add_device() called\n");
     53        assert(device);
     54
     55        int ret = device_setup_ohci(device);
     56        if (ret != EOK) {
     57                usb_log_error("Failed to initialize OHCI driver: %s.\n",
     58                    str_error(ret));
     59                return ret;
     60        }
     61        usb_log_info("Controlling new OHCI device '%s'.\n", device->name);
     62
     63        return EOK;
     64}
    4665/*----------------------------------------------------------------------------*/
    4766static driver_ops_t ohci_driver_ops = {
     
    5372        .driver_ops = &ohci_driver_ops
    5473};
    55 /*----------------------------------------------------------------------------*/
    56 /** Initializes a new ddf driver instance of OHCI hcd.
    57  *
    58  * @param[in] device DDF instance of the device to initialize.
    59  * @return Error code.
    60  */
    61 int ohci_add_device(ddf_dev_t *device)
    62 {
    63         usb_log_debug("ohci_add_device() called\n");
    64         assert(device);
    65         ohci_t *ohci = malloc(sizeof(ohci_t));
    66         if (ohci == NULL) {
    67                 usb_log_error("Failed to allocate OHCI driver.\n");
    68                 return ENOMEM;
    69         }
    70 
    71         int ret = ohci_init(ohci, device);
    72         if (ret != EOK) {
    73                 usb_log_error("Failed to initialize OHCI driver: %s.\n",
    74                     str_error(ret));
    75                 return ret;
    76         }
    77 //      device->driver_data = ohci;
    78         hc_register_hub(&ohci->hc, ohci->rh_fun);
    79 
    80         usb_log_info("Controlling new OHCI device `%s'.\n", device->name);
    81 
    82         return EOK;
    83 }
    8474/*----------------------------------------------------------------------------*/
    8575/** Initializes global driver structures (NONE).
Note: See TracChangeset for help on using the changeset viewer.