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

Changeset 4317827 in mainline for uspace/drv/uhci/main.c


Ignore:
Timestamp:
2010-12-04T14:00:41Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
36c410e
Parents:
62c9661
Message:

USB hub driver in separate task

The commit only includes changes necessary to get working (i.e. appearing
under /dev/devices) hub and VHC.

Clean-up will come later.

File:
1 edited

Legend:

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

    r62c9661 r4317827  
    2828#include <usb/hcdhubd.h>
    2929#include <errno.h>
     30#include "uhci.h"
    3031
    31 static int enqueue_transfer_out(usb_hc_device_t *hc,
    32     usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint,
    33     void *buffer, size_t size,
    34     usb_hcd_transfer_callback_out_t callback, void *arg)
    35 {
    36         printf("UHCI: transfer OUT [%d.%d (%s); %u]\n",
    37             dev->address, endpoint->endpoint,
    38             usb_str_transfer_type(endpoint->transfer_type),
    39             size);
    40         return ENOTSUP;
    41 }
    42 
    43 static int enqueue_transfer_setup(usb_hc_device_t *hc,
    44     usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint,
    45     void *buffer, size_t size,
    46     usb_hcd_transfer_callback_out_t callback, void *arg)
    47 {
    48         printf("UHCI: transfer SETUP [%d.%d (%s); %u]\n",
    49             dev->address, endpoint->endpoint,
    50             usb_str_transfer_type(endpoint->transfer_type),
    51             size);
    52         return ENOTSUP;
    53 }
    54 
    55 static int enqueue_transfer_in(usb_hc_device_t *hc,
    56     usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint,
    57     void *buffer, size_t size,
    58     usb_hcd_transfer_callback_in_t callback, void *arg)
    59 {
    60         printf("UHCI: transfer IN [%d.%d (%s); %u]\n",
    61             dev->address, endpoint->endpoint,
    62             usb_str_transfer_type(endpoint->transfer_type),
    63             size);
    64         return ENOTSUP;
    65 }
    66 
    67 static usb_hcd_transfer_ops_t uhci_transfer_ops = {
    68         .transfer_out = enqueue_transfer_out,
    69         .transfer_in = enqueue_transfer_in,
    70         .transfer_setup = enqueue_transfer_setup
     32static device_ops_t uhci_ops = {
     33        .interfaces[USBHC_DEV_IFACE] = &uhci_iface,
    7134};
    7235
    73 static int uhci_add_hc(usb_hc_device_t *device)
     36static int uhci_add_device(device_t *device)
    7437{
    75         device->transfer_ops = &uhci_transfer_ops;
     38        device->ops = &uhci_ops;
    7639
    7740        /*
     
    8346}
    8447
    85 usb_hc_driver_t uhci_driver = {
    86         .name = "uhci",
    87         .add_hc = uhci_add_hc
     48static driver_ops_t uhci_driver_ops = {
     49        .add_device = uhci_add_device,
     50};
     51
     52static driver_t uhci_driver = {
     53        .name = NAME,
     54        .driver_ops = &uhci_driver_ops
    8855};
    8956
     
    9360         * Do some global initializations.
    9461         */
     62        sleep(5);
    9563
    96         return usb_hcd_main(&uhci_driver);
     64        return driver_main(&uhci_driver);
    9765}
Note: See TracChangeset for help on using the changeset viewer.