Changeset 62f4212 in mainline for uspace/drv/usbhub/main.c


Ignore:
Timestamp:
2011-03-22T10:07:53Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f8e4cb6
Parents:
18b3cfd (diff), b01995b (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:

Merged changes from development

File:
1 edited

Legend:

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

    r18b3cfd r62f4212  
    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
    41 
    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,
     44/** Hub status-change endpoint description.
     45 *
     46 * For more information see section 11.15.1 of USB 1.1 specification.
     47 */
     48static 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
    4755};
    4856
    49 static driver_t hub_driver = {
    50         .name = "usbhub",
    51         .driver_ops = &hub_driver_ops
     57
     58static usb_driver_ops_t usb_hub_driver_ops = {
     59        .add_device = usb_hub_add_device
    5260};
     61
     62static usb_endpoint_description_t *usb_hub_endpoints[] = {
     63        &hub_status_change_endpoint_description,
     64        NULL
     65};
     66
     67static usb_driver_t usb_hub_driver = {
     68        .name = NAME,
     69        .ops = &usb_hub_driver_ops,
     70        .endpoints = usb_hub_endpoints
     71};
     72
    5373
    5474int main(int argc, char *argv[])
    5575{
    56         usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
    57         dprintf(USB_LOG_LEVEL_INFO, "starting hub driver");
     76        printf(NAME ": HelenOS USB hub driver.\n");
    5877
    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);
     78        usb_log_enable(USB_LOG_LEVEL_DEFAULT, NAME);
    6479       
    65         return ddf_driver_main(&hub_driver);
     80        return usb_driver_main(&usb_hub_driver);
    6681}
    6782
Note: See TracChangeset for help on using the changeset viewer.