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

Changeset 4317827 in mainline


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.

Files:
6 added
15 edited
1 moved

Legend:

Unmodified
Added
Removed
  • .bzrignore

    r62c9661 r4317827  
    9494./uspace/dist/drv/rootia32/
    9595./uspace/dist/drv/uhci/
     96./uspace/dist/drv/usbhub/
    9697./uspace/dist/drv/usbkbd/
    9798./uspace/dist/drv/vhc/
     
    130131./uspace/drv/rootia32/rootia32
    131132./uspace/drv/uhci/uhci
     133./uspace/drv/usbhub/usbhub
    132134./uspace/drv/usbkbd/usbkbd
    133135./uspace/drv/vhc/vhc
  • boot/arch/amd64/Makefile.inc

    r62c9661 r4317827  
    4242        ns8250 \
    4343        uhci \
     44        usbhub \
    4445        usbkbd
    4546       
  • uspace/Makefile

    r62c9661 r4317827  
    118118        DIRS += drv/ns8250
    119119        DIRS += drv/uhci
     120        DIRS += drv/usbhub
    120121        DIRS += drv/usbkbd
    121122endif
  • uspace/drv/uhci/Makefile

    r62c9661 r4317827  
    3333
    3434SOURCES = \
    35         main.c
     35        main.c \
     36        transfers.c
    3637
    3738include $(USPACE_PREFIX)/Makefile.common
  • 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}
  • uspace/drv/uhci/uhci.ma

    r62c9661 r4317827  
    1110 pci/ven=8086&dev=7020
    2 10 usb&hc=uhci
    3 10 usb&hc=uhci&hub
     2
  • uspace/drv/usbhub/utils.c

    r62c9661 r4317827  
    3333 * @brief Hub driver.
    3434 */
    35 #include <usb/hcdhubd.h>
     35#include <driver.h>
    3636#include <usb/devreq.h>
    3737#include <usbhc_iface.h>
     38#include <usb/usbdrv.h>
    3839#include <usb/descriptor.h>
    3940#include <driver.h>
     
    4142#include <errno.h>
    4243#include <usb/classes/hub.h>
    43 #include "hcdhubd_private.h"
     44#include "usbhub.h"
    4445
    4546static void check_hub_changes(void);
     
    108109//*********************************************
    109110
    110 static void set_hub_address(usb_hc_device_t *hc, usb_address_t address);
     111static void set_hub_address(device_t *dev, usb_address_t address);
    111112
    112113usb_hcd_hub_info_t * usb_create_hub_info(device_t * device) {
    113114        usb_hcd_hub_info_t* result = (usb_hcd_hub_info_t*) malloc(sizeof (usb_hcd_hub_info_t));
    114         //get parent device
    115         /// @TODO this code is not correct
    116         device_t * my_hcd = device;
    117         while (my_hcd->parent)
    118                 my_hcd = my_hcd->parent;
    119         //dev->
    120         printf("%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);
    121         //we add the hub into the first hc
    122         //link_t *link_hc = hc_list.next;
    123         //usb_hc_device_t *hc = list_get_instance(link_hc,
    124         //              usb_hc_device_t, link);
    125         //must get generic device info
    126 
    127115
    128116        return result;
     
    135123 */
    136124int usb_add_hub_device(device_t *dev) {
    137         usb_hc_device_t *hc = list_get_instance(hc_list.next, usb_hc_device_t, link);
    138         set_hub_address(hc, 5);
     125        printf(NAME ": add_hub_device(handle=%d)\n", (int) dev->handle);
     126        set_hub_address(dev, 5);
    139127
    140128        check_hub_changes();
     
    145133         * connected devices.
    146134         */
    147         //insert hub into list
    148         //find owner hcd
    149         device_t * my_hcd = dev;
    150         while (my_hcd->parent)
    151                 my_hcd = my_hcd->parent;
    152         //dev->
    153         printf("%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);
    154         my_hcd = dev;
    155         while (my_hcd->parent)
    156                 my_hcd = my_hcd->parent;
    157         //dev->
    158 
    159         printf("%s: owner hcd found: %s\n", hc_driver->name, my_hcd->name);
    160135
    161136        //create the hub structure
    162137        usb_hcd_hub_info_t * hub_info = usb_create_hub_info(dev);
    163 
    164 
    165         //append into the list
    166         //we add the hub into the first hc
    167         list_append(&hub_info->link, &hc->hubs);
    168 
    169 
     138        (void)hub_info;
    170139
    171140        return EOK;
     
    182151 * @param address New hub address.
    183152 */
    184 static void set_hub_address(usb_hc_device_t *hc, usb_address_t address) {
    185         printf("%s: setting hub address to %d\n", hc->generic->name, address);
     153static void set_hub_address(device_t *dev, usb_address_t address) {
     154        printf(NAME ": setting hub address to %d\n", address);
    186155        usb_target_t target = {0, 0};
    187156        usb_handle_t handle;
     
    196165        setup_packet.value = address;
    197166
    198         rc = usb_hc_async_control_write_setup(hc, target,
     167        int hc = usb_drv_hc_connect(dev, 0);
     168
     169        rc = usb_drv_async_control_write_setup(hc, target,
    199170                        &setup_packet, sizeof (setup_packet), &handle);
    200171        if (rc != EOK) {
     
    202173        }
    203174
    204         rc = usb_hc_async_wait_for(handle);
    205         if (rc != EOK) {
    206                 return;
    207         }
    208 
    209         rc = usb_hc_async_control_write_status(hc, target, &handle);
    210         if (rc != EOK) {
    211                 return;
    212         }
    213 
    214         rc = usb_hc_async_wait_for(handle);
    215         if (rc != EOK) {
    216                 return;
    217         }
    218 
    219         printf("%s: hub address changed\n", hc->generic->name);
     175        rc = usb_drv_async_wait_for(handle);
     176        if (rc != EOK) {
     177                return;
     178        }
     179
     180        rc = usb_drv_async_control_write_status(hc, target, &handle);
     181        if (rc != EOK) {
     182                return;
     183        }
     184
     185        rc = usb_drv_async_wait_for(handle);
     186        if (rc != EOK) {
     187                return;
     188        }
     189
     190        printf(NAME ": hub address changed\n");
    220191}
    221192
     
    224195static void check_hub_changes(void) {
    225196        /*
    226          * Iterate through all HCs.
     197         * Iterate through all hubs.
    227198         */
    228         link_t *link_hc;
    229         for (link_hc = hc_list.next;
    230                         link_hc != &hc_list;
    231                         link_hc = link_hc->next) {
    232                 usb_hc_device_t *hc = list_get_instance(link_hc,
    233                                 usb_hc_device_t, link);
    234                 /*
    235                  * Iterate through all their hubs.
    236                  */
    237                 link_t *link_hub;
    238                 for (link_hub = hc->hubs.next;
    239                                 link_hub != &hc->hubs;
    240                                 link_hub = link_hub->next) {
    241                         usb_hcd_hub_info_t *hub = list_get_instance(link_hub,
    242                                         usb_hcd_hub_info_t, link);
    243 
    244                         /*
    245                          * Check status change pipe of this hub.
    246                          */
    247                         usb_target_t target = {
    248                                 .address = hub->device->address,
    249                                 .endpoint = 1
    250                         };
    251 
    252                         // FIXME: count properly
    253                         size_t byte_length = (hub->port_count / 8) + 1;
    254 
    255                         void *change_bitmap = malloc(byte_length);
    256                         size_t actual_size;
    257                         usb_handle_t handle;
    258 
    259                         /*
    260                          * Send the request.
    261                          * FIXME: check returned value for possible errors
    262                          */
    263                         usb_hc_async_interrupt_in(hc, target,
    264                                         change_bitmap, byte_length, &actual_size,
    265                                         &handle);
    266 
    267                         usb_hc_async_wait_for(handle);
    268 
    269                         /*
    270                          * TODO: handle the changes.
    271                          */
     199        for (; false; ) {
     200                /*
     201                 * Check status change pipe of this hub.
     202                 */
     203                usb_target_t target = {
     204                        .address = 5,
     205                        .endpoint = 1
     206                };
     207
     208                size_t port_count = 7;
     209
     210                /*
     211                 * Connect to respective HC.
     212                 */
     213                int hc = usb_drv_hc_connect(NULL, 0);
     214                if (hc < 0) {
     215                        continue;
    272216                }
     217
     218                // FIXME: count properly
     219                size_t byte_length = (port_count / 8) + 1;
     220
     221                void *change_bitmap = malloc(byte_length);
     222                size_t actual_size;
     223                usb_handle_t handle;
     224
     225                /*
     226                 * Send the request.
     227                 * FIXME: check returned value for possible errors
     228                 */
     229                usb_drv_async_interrupt_in(hc, target,
     230                                change_bitmap, byte_length, &actual_size,
     231                                &handle);
     232
     233                usb_drv_async_wait_for(handle);
     234
     235                /*
     236                 * TODO: handle the changes.
     237                 */
     238
     239
     240                /*
     241                 * Hang-up the HC-connected phone.
     242                 */
     243                ipc_hangup(hc);
    273244        }
    274245}
  • uspace/drv/vhc/conn.h

    r62c9661 r4317827  
    3838#include <usb/usb.h>
    3939#include <usb/hcdhubd.h>
     40#include <usbhc_iface.h>
    4041#include "vhcd.h"
    4142#include "devices.h"
     
    4445
    4546usb_hcd_transfer_ops_t vhc_transfer_ops;
     47usbhc_iface_t vhc_iface;
    4648
    4749void default_connection_handler(device_t *, ipc_callid_t, ipc_call_t *);
  • uspace/drv/vhc/connhost.c

    r62c9661 r4317827  
    4343typedef struct {
    4444        usb_direction_t direction;
    45         usb_hcd_transfer_callback_out_t out_callback;
    46         usb_hcd_transfer_callback_in_t in_callback;
    47         usb_hc_device_t *hc;
     45        usbhc_iface_transfer_out_callback_t out_callback;
     46        usbhc_iface_transfer_in_callback_t in_callback;
     47        device_t *dev;
    4848        void *arg;
    4949} transfer_info_t;
     
    5656        switch (transfer->direction) {
    5757                case USB_DIRECTION_IN:
    58                         transfer->in_callback(transfer->hc,
     58                        transfer->in_callback(transfer->dev,
    5959                            size, outcome,
    6060                            transfer->arg);
    6161                        break;
    6262                case USB_DIRECTION_OUT:
    63                         transfer->out_callback(transfer->hc,
     63                        transfer->out_callback(transfer->dev,
    6464                            outcome,
    6565                            transfer->arg);
     
    7373}
    7474
    75 static transfer_info_t *create_transfer_info(usb_hc_device_t *hc,
     75static transfer_info_t *create_transfer_info(device_t *dev,
    7676    usb_direction_t direction, void *arg)
    7777{
     
    8282        transfer->out_callback = NULL;
    8383        transfer->arg = arg;
    84         transfer->hc = hc;
     84        transfer->dev = dev;
    8585
    8686        return transfer;
    8787}
    8888
    89 static int enqueue_transfer_out(usb_hc_device_t *hc,
    90     usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint,
     89static int enqueue_transfer_out(device_t *dev,
     90    usb_target_t target, usb_transfer_type_t transfer_type,
    9191    void *buffer, size_t size,
    92     usb_hcd_transfer_callback_out_t callback, void *arg)
     92    usbhc_iface_transfer_out_callback_t callback, void *arg)
    9393{
    9494        printf(NAME ": transfer OUT [%d.%d (%s); %u]\n",
    95             dev->address, endpoint->endpoint,
    96             usb_str_transfer_type(endpoint->transfer_type),
     95            target.address, target.endpoint,
     96            usb_str_transfer_type(transfer_type),
    9797            size);
    9898
    9999        transfer_info_t *transfer
    100             = create_transfer_info(hc, USB_DIRECTION_OUT, arg);
     100            = create_transfer_info(dev, USB_DIRECTION_OUT, arg);
    101101        transfer->out_callback = callback;
    102 
    103         usb_target_t target = {
    104                 .address = dev->address,
    105                 .endpoint = endpoint->endpoint
    106         };
    107102
    108103        hc_add_transaction_to_device(false, target, buffer, size,
     
    112107}
    113108
    114 static int enqueue_transfer_setup(usb_hc_device_t *hc,
    115     usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint,
     109static int enqueue_transfer_setup(device_t *dev,
     110    usb_target_t target, usb_transfer_type_t transfer_type,
    116111    void *buffer, size_t size,
    117     usb_hcd_transfer_callback_out_t callback, void *arg)
     112    usbhc_iface_transfer_out_callback_t callback, void *arg)
    118113{
    119114        printf(NAME ": transfer SETUP [%d.%d (%s); %u]\n",
    120             dev->address, endpoint->endpoint,
    121             usb_str_transfer_type(endpoint->transfer_type),
     115            target.address, target.endpoint,
     116            usb_str_transfer_type(transfer_type),
    122117            size);
    123118
    124119        transfer_info_t *transfer
    125             = create_transfer_info(hc, USB_DIRECTION_OUT, arg);
     120            = create_transfer_info(dev, USB_DIRECTION_OUT, arg);
    126121        transfer->out_callback = callback;
    127 
    128         usb_target_t target = {
    129                 .address = dev->address,
    130                 .endpoint = endpoint->endpoint
    131         };
    132122
    133123        hc_add_transaction_to_device(true, target, buffer, size,
     
    137127}
    138128
    139 static int enqueue_transfer_in(usb_hc_device_t *hc,
    140     usb_hcd_attached_device_info_t *dev, usb_hc_endpoint_info_t *endpoint,
     129static int enqueue_transfer_in(device_t *dev,
     130    usb_target_t target, usb_transfer_type_t transfer_type,
    141131    void *buffer, size_t size,
    142     usb_hcd_transfer_callback_in_t callback, void *arg)
     132    usbhc_iface_transfer_in_callback_t callback, void *arg)
    143133{
    144134        printf(NAME ": transfer IN [%d.%d (%s); %u]\n",
    145             dev->address, endpoint->endpoint,
    146             usb_str_transfer_type(endpoint->transfer_type),
     135            target.address, target.endpoint,
     136            usb_str_transfer_type(transfer_type),
    147137            size);
    148138
    149139        transfer_info_t *transfer
    150             = create_transfer_info(hc, USB_DIRECTION_IN, arg);
     140            = create_transfer_info(dev, USB_DIRECTION_IN, arg);
    151141        transfer->in_callback = callback;
    152 
    153         usb_target_t target = {
    154                 .address = dev->address,
    155                 .endpoint = endpoint->endpoint
    156         };
    157142
    158143        hc_add_transaction_from_device(target, buffer, size,
     
    163148
    164149
    165 usb_hcd_transfer_ops_t vhc_transfer_ops = {
    166         .transfer_out = enqueue_transfer_out,
    167         .transfer_in = enqueue_transfer_in,
    168         .transfer_setup = enqueue_transfer_setup
     150static int get_address(device_t *dev, devman_handle_t handle,
     151    usb_address_t *address)
     152{
     153        return ENOTSUP;
     154}
     155
     156static int interrupt_out(device_t *dev, usb_target_t target,
     157    void *data, size_t size,
     158    usbhc_iface_transfer_out_callback_t callback, void *arg)
     159{
     160        return enqueue_transfer_out(dev, target, USB_TRANSFER_INTERRUPT,
     161            data, size,
     162            callback, arg);
     163}
     164
     165static int interrupt_in(device_t *dev, usb_target_t target,
     166    void *data, size_t size,
     167    usbhc_iface_transfer_in_callback_t callback, void *arg)
     168{
     169        return enqueue_transfer_in(dev, target, USB_TRANSFER_INTERRUPT,
     170            data, size,
     171            callback, arg);
     172}
     173
     174static int control_write_setup(device_t *dev, usb_target_t target,
     175    void *data, size_t size,
     176    usbhc_iface_transfer_out_callback_t callback, void *arg)
     177{
     178        return enqueue_transfer_setup(dev, target, USB_TRANSFER_CONTROL,
     179            data, size,
     180            callback, arg);
     181}
     182
     183static int control_write_data(device_t *dev, usb_target_t target,
     184    void *data, size_t size,
     185    usbhc_iface_transfer_out_callback_t callback, void *arg)
     186{
     187        return enqueue_transfer_out(dev, target, USB_TRANSFER_CONTROL,
     188            data, size,
     189            callback, arg);
     190}
     191
     192static int control_write_status(device_t *dev, usb_target_t target,
     193    usbhc_iface_transfer_in_callback_t callback, void *arg)
     194{
     195        return enqueue_transfer_in(dev, target, USB_TRANSFER_CONTROL,
     196            NULL, 0,
     197            callback, arg);
     198}
     199
     200static int control_read_setup(device_t *dev, usb_target_t target,
     201    void *data, size_t size,
     202    usbhc_iface_transfer_out_callback_t callback, void *arg)
     203{
     204        return enqueue_transfer_setup(dev, target, USB_TRANSFER_CONTROL,
     205            data, size,
     206            callback, arg);
     207}
     208
     209static int control_read_data(device_t *dev, usb_target_t target,
     210    void *data, size_t size,
     211    usbhc_iface_transfer_in_callback_t callback, void *arg)
     212{
     213        return enqueue_transfer_in(dev, target, USB_TRANSFER_CONTROL,
     214            data, size,
     215            callback, arg);
     216}
     217
     218static int control_read_status(device_t *dev, usb_target_t target,
     219    usbhc_iface_transfer_out_callback_t callback, void *arg)
     220{
     221        return enqueue_transfer_out(dev, target, USB_TRANSFER_CONTROL,
     222            NULL, 0,
     223            callback, arg);
     224}
     225
     226
     227usbhc_iface_t vhc_iface = {
     228        .tell_address = get_address,
     229        .interrupt_out = interrupt_out,
     230        .interrupt_in = interrupt_in,
     231        .control_write_setup = control_write_setup,
     232        .control_write_data = control_write_data,
     233        .control_write_status = control_write_status,
     234        .control_read_setup = control_read_setup,
     235        .control_read_data = control_read_data,
     236        .control_read_status = control_read_status
    169237};
    170238
  • uspace/drv/vhc/hcd.c

    r62c9661 r4317827  
    5252#include "conn.h"
    5353
     54static device_ops_t vhc_ops = {
     55        .interfaces[USBHC_DEV_IFACE] = &vhc_iface,
     56        .default_handler = default_connection_handler
     57};
    5458
    5559static int vhc_count = 0;
    56 static int vhc_add_device(usb_hc_device_t *dev)
     60static int vhc_add_device(device_t *dev)
    5761{
    5862        /*
     
    6569        vhc_count++;
    6670
    67         dev->transfer_ops = &vhc_transfer_ops;
    68         dev->generic->ops->default_handler = default_connection_handler;
     71        dev->ops = &vhc_ops;
    6972
    7073        /*
     
    7982}
    8083
    81 static usb_hc_driver_t vhc_driver = {
     84static driver_ops_t vhc_driver_ops = {
     85        .add_device = vhc_add_device,
     86};
     87
     88static driver_t vhc_driver = {
    8289        .name = NAME,
    83         .add_hc = &vhc_add_device
     90        .driver_ops = &vhc_driver_ops
    8491};
    8592
     
    114121        sleep(4);
    115122
    116         return usb_hcd_main(&vhc_driver);
     123        return driver_main(&vhc_driver);
    117124}
    118125
  • uspace/drv/vhc/vhc.ma

    r62c9661 r4317827  
    1110 usb&hc=vhc
    2 10 usb&hc=vhc&hub
     2
  • uspace/lib/usb/Makefile

    r62c9661 r4317827  
    3535        src/hcdhubd.c \
    3636        src/hcdrv.c \
    37         src/hubdrv.c \
    3837        src/localdrv.c \
    3938        src/remotedrv.c \
  • uspace/lib/usb/include/usb/hcdhubd.h

    r62c9661 r4317827  
    146146
    147147int usb_hcd_main(usb_hc_driver_t *);
    148 int usb_hcd_add_root_hub(usb_hc_device_t *dev);
     148int usb_hcd_add_root_hub(device_t *dev);
    149149
    150150
  • uspace/lib/usb/src/hcdhubd.c

    r62c9661 r4317827  
    5151 */
    5252static int add_device(device_t *dev) {
    53         bool is_hc = str_cmp(dev->name, USB_HUB_DEVICE_NAME) != 0;
    54         printf("%s: add_device(name=\"%s\")\n", hc_driver->name, dev->name);
    55 
    56         if (is_hc) {
    57                 /*
    58                  * We are the HC itself.
    59                  */
    60                 return usb_add_hc_device(dev);
    61         } else {
    62                 /*
    63                  * We are some (maybe deeply nested) hub.
    64                  * Thus, assign our own operations and explore already
    65                  * connected devices.
    66                  */
    67                 return usb_add_hub_device(dev);
    68         }
     53        return ENOTSUP;
    6954}
    7055
     
    10590 * @return Error code.
    10691 */
    107 int usb_hcd_add_root_hub(usb_hc_device_t *dev)
     92int usb_hcd_add_root_hub(device_t *dev)
    10893{
    10994        char *id;
    110         int rc = asprintf(&id, "usb&hc=%s&hub", hc_driver->name);
     95        int rc = asprintf(&id, "usb&hub");
    11196        if (rc <= 0) {
    11297                return rc;
    11398        }
    11499
    115         rc = usb_hc_add_child_device(dev->generic, USB_HUB_DEVICE_NAME, id, true);
     100        rc = usb_hc_add_child_device(dev, USB_HUB_DEVICE_NAME, id, true);
    116101        if (rc != EOK) {
    117102                free(id);
  • uspace/lib/usb/src/hcdhubd_private.h

    r62c9661 r4317827  
    4646usb_address_t usb_get_address_by_handle(devman_handle_t);
    4747int usb_add_hc_device(device_t *);
    48 int usb_add_hub_device(device_t *);
    4948
    5049#endif
  • uspace/lib/usb/src/hcdrv.c

    r62c9661 r4317827  
    4747LIST_INITIALIZE(hc_list);
    4848
     49/* Fake driver to have the name item initialized. */
     50static usb_hc_driver_t hc_driver_fake = {
     51        .name = "HCD",
     52};
     53
    4954/** Our HC driver. */
    50 usb_hc_driver_t *hc_driver = NULL;
     55usb_hc_driver_t *hc_driver = &hc_driver_fake;
    5156
    5257static device_ops_t usb_device_ops = {
     
    7176int usb_add_hc_device(device_t *dev)
    7277{
     78        return ENOTSUP;
    7379        usb_hc_device_t *hc_dev = usb_hc_device_create(dev);
    7480
Note: See TracChangeset for help on using the changeset viewer.