Ignore:
File:
1 edited

Legend:

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

    r215b001 rdff940f8  
    3636#include <stdio.h>
    3737
    38 #include <usb/devdrv.h>
    39 #include <usb/classes/classes.h>
    40 
    4138#include "usbhub.h"
    4239#include "usbhub_private.h"
    4340
    44 /** Hub status-change endpoint description.
    45  *
    46  * For more information see section 11.15.1 of USB 1.1 specification.
    47  */
    48 static usb_endpoint_description_t hub_status_change_endpoint_description = {
    49         .transfer_type = USB_TRANSFER_INTERRUPT,
    50         .direction = USB_DIRECTION_IN,
    51         .interface_class = USB_CLASS_HUB,
    52         .interface_subclass = 0,
    53         .interface_protocol = 0,
    54         .flags = 0
     41
     42usb_general_list_t usb_hub_list;
     43fibril_mutex_t usb_hub_list_lock;
     44
     45static driver_ops_t hub_driver_ops = {
     46        .add_device = usb_add_hub_device,
    5547};
    5648
    57 
    58 static usb_driver_ops_t usb_hub_driver_ops = {
    59         .add_device = usb_hub_add_device
     49static driver_t hub_driver = {
     50        .name = "usbhub",
     51        .driver_ops = &hub_driver_ops
    6052};
    61 
    62 static usb_endpoint_description_t *usb_hub_endpoints[] = {
    63         &hub_status_change_endpoint_description,
    64         NULL
    65 };
    66 
    67 static usb_driver_t usb_hub_driver = {
    68         .name = NAME,
    69         .ops = &usb_hub_driver_ops,
    70         .endpoints = usb_hub_endpoints
    71 };
    72 
    7353
    7454int main(int argc, char *argv[])
    7555{
    76         printf(NAME ": HelenOS USB hub driver.\n");
     56        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
     57        dprintf(USB_LOG_LEVEL_INFO, "starting hub driver");
    7758
    78         usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME);
     59        //this is probably not needed anymore
     60        fibril_mutex_initialize(&usb_hub_list_lock);
     61        fibril_mutex_lock(&usb_hub_list_lock);
     62        usb_lst_init(&usb_hub_list);
     63        fibril_mutex_unlock(&usb_hub_list_lock);
    7964       
    80         return usb_driver_main(&usb_hub_driver);
     65        return ddf_driver_main(&hub_driver);
    8166}
    8267
Note: See TracChangeset for help on using the changeset viewer.