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

Changeset 84439d7 in mainline for uspace/drv/uhci/main.c


Ignore:
Timestamp:
2010-12-05T09:34:46Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
75732da
Parents:
56b962d (diff), 35537a7 (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:

Merge with development/

File:
1 edited

Legend:

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

    r56b962d r84439d7  
    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        /*
    7841         * We need to announce the presence of our root hub.
    79          * Commented out until the problem which causes the whole task to
    80          * block is solved.
    8142         */
    82         //usb_hcd_add_root_hub(device);
     43        usb_hcd_add_root_hub(device);
    8344
    8445        return EOK;
    8546}
    8647
    87 usb_hc_driver_t uhci_driver = {
    88         .name = "uhci",
    89         .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
    9055};
    9156
     
    9560         * Do some global initializations.
    9661         */
     62        sleep(5);
    9763
    98         return usb_hcd_main(&uhci_driver);
     64        return driver_main(&uhci_driver);
    9965}
Note: See TracChangeset for help on using the changeset viewer.