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

Changeset 243cb86 in mainline for uspace/drv/uhci/main.c


Ignore:
Timestamp:
2010-12-12T10:50:19Z (11 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master
Children:
8365533
Parents:
101ef25c (diff), ebb98c5 (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 from development + several changes to hid driver.

Changes to hid driver:

  • copied some code to usbkbd_get_descriptors() function
  • base structure for hid descriptor and report parser (files uspace/lib/usb/include/usb/classes/hidparser.h

and uspace/lib/usb/src/hidparser.c)

File:
1 edited

Legend:

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

    r101ef25c r243cb86  
    2727 */
    2828#include <usb/hcdhubd.h>
     29#include <usb/debug.h>
    2930#include <errno.h>
     31#include "uhci.h"
    3032
    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
     33static device_ops_t uhci_ops = {
     34        .interfaces[USBHC_DEV_IFACE] = &uhci_iface,
    7135};
    7236
    73 static int uhci_add_hc(usb_hc_device_t *device)
     37static int uhci_add_device(device_t *device)
    7438{
    75         device->transfer_ops = &uhci_transfer_ops;
     39        usb_dprintf(NAME, 1, "uhci_add_device() called\n");
     40        device->ops = &uhci_ops;
    7641
    7742        /*
    7843         * We need to announce the presence of our root hub.
    7944         */
     45        usb_dprintf(NAME, 2, "adding root hub\n");
    8046        usb_hcd_add_root_hub(device);
    8147
     
    8349}
    8450
    85 usb_hc_driver_t uhci_driver = {
    86         .name = "uhci",
    87         .add_hc = uhci_add_hc
     51static driver_ops_t uhci_driver_ops = {
     52        .add_device = uhci_add_device,
     53};
     54
     55static driver_t uhci_driver = {
     56        .name = NAME,
     57        .driver_ops = &uhci_driver_ops
    8858};
    8959
     
    9363         * Do some global initializations.
    9464         */
     65        sleep(5);
     66        usb_dprintf_enable(NAME, 5);
    9567
    96         return usb_hcd_main(&uhci_driver);
     68        return driver_main(&uhci_driver);
    9769}
Note: See TracChangeset for help on using the changeset viewer.