Changeset 79c8a96 in mainline for uspace/drv/usbhub/main.c


Ignore:
Timestamp:
2011-03-21T10:27:44Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2e1d5d70, c15070c
Parents:
81dce9f (diff), f0fdc7d (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:

Development branch changes

File:
1 edited

Legend:

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

    r81dce9f r79c8a96  
    3636#include <stdio.h>
    3737
     38#include <usb/devdrv.h>
     39#include <usb/classes/classes.h>
     40
    3841#include "usbhub.h"
    3942#include "usbhub_private.h"
    4043
    4144
    42 usb_general_list_t usb_hub_list;
    43 fibril_mutex_t usb_hub_list_lock;
    44 
    45 static driver_ops_t hub_driver_ops = {
    46         .add_device = usb_add_hub_device,
     45usb_endpoint_description_t hub_status_change_endpoint_description = {
     46        .transfer_type = USB_TRANSFER_INTERRUPT,
     47        .direction = USB_DIRECTION_IN,
     48        .interface_class = USB_CLASS_HUB,
     49        .interface_subclass = 0,
     50        .interface_protocol = 0,
     51        .flags = 0
    4752};
    4853
    49 static driver_t hub_driver = {
     54
     55static usb_driver_ops_t usb_hub_driver_ops = {
     56        .add_device = usb_hub_add_device
     57};
     58
     59static usb_driver_t usb_hub_driver = {
    5060        .name = "usbhub",
    51         .driver_ops = &hub_driver_ops
     61        .ops = &usb_hub_driver_ops
    5262};
     63
    5364
    5465int main(int argc, char *argv[])
    5566{
    5667        usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    57         dprintf(USB_LOG_LEVEL_INFO, "starting hub driver");
     68        usb_log_info("starting hub driver\n");
    5869
    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);
    6470       
    65         return ddf_driver_main(&hub_driver);
     71        usb_hub_driver.endpoints = (usb_endpoint_description_t**)
     72                        malloc(2 * sizeof(usb_endpoint_description_t*));
     73        usb_hub_driver.endpoints[0] = &hub_status_change_endpoint_description;
     74        usb_hub_driver.endpoints[1] = NULL;
     75
     76        return usb_driver_main(&usb_hub_driver);
    6677}
    6778
Note: See TracChangeset for help on using the changeset viewer.