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

Changeset c86ca9a in mainline


Ignore:
Timestamp:
2015-06-29T00:35:29Z (6 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
68a61f19
Parents:
92900e2
Message:

libusbhost: Add more debugging output

Location:
uspace/lib/usbhost/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/ddf_helpers.c

    r92900e2 rc86ca9a  
    472472        }
    473473
     474        usb_log_debug("Found new %s speed USB device\n", usb_str_speed(speed));
     475
    474476        static const usb_target_t default_target = {{
    475477                .address = USB_ADDRESS_DEFAULT,
     
    481483                return address;
    482484
     485        usb_log_debug("Reserved new address: %d\n", address);
     486
    483487        const usb_target_t target = {{
    484488                .address = address,
     
    489493
    490494        /* Add default pipe on default address */
     495        usb_log_debug("Device(%d): Adding default target(0:0)\n", address);
    491496        ret = hcd_add_ep(hcd,
    492497            default_target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
    493498            CTRL_PIPE_MIN_PACKET_SIZE, CTRL_PIPE_MIN_PACKET_SIZE, 1,
    494499            tt_address, port);
    495 
    496500        if (ret != EOK) {
    497501                hcd_release_address(hcd, address);
     
    505509
    506510        // TODO CALLBACKS
     511        usb_log_debug("Device(%d): Requesting first 8B of device descriptor\n",
     512            address);
    507513        ssize_t got = hcd_send_batch_sync(hcd, default_target, USB_DIRECTION_IN,
    508514            &desc, CTRL_PIPE_MIN_PACKET_SIZE, *(uint64_t *)&get_device_desc_8,
     
    516522
    517523        /* Register EP on the new address */
     524        usb_log_debug("Device(%d): Registering control EP\n", address);
    518525        ret = hcd_add_ep(hcd, target, USB_DIRECTION_BOTH, USB_TRANSFER_CONTROL,
    519526            ED_MPS_PACKET_SIZE_GET(uint16_usb2host(desc.max_packet_size)),
     
    532539            SET_ADDRESS(target.address);
    533540
     541        usb_log_debug("Device(%d): Setting USB address.\n", address);
    534542        got = hcd_send_batch_sync(hcd, default_target, USB_DIRECTION_OUT,
    535543            NULL, 0, *(uint64_t *)&set_address, "set address");
    536544
     545        usb_log_debug("Device(%d): Removing default (0:0) EP\n", address);
    537546        hcd_remove_ep(hcd, default_target, USB_DIRECTION_BOTH);
    538547
     
    547556            GET_DEVICE_DESC(sizeof(desc));
    548557
     558        usb_log_debug("Device(%d): Requesting full device descriptor\n",
     559            address);
    549560        got = hcd_send_batch_sync(hcd, target, USB_DIRECTION_IN,
    550561            &desc, sizeof(desc), *(uint64_t *)&get_device_desc,
     
    560571        init_match_ids(&mids);
    561572
     573        usb_log_debug("Device(%d): Creating match IDs\n", address);
    562574        ret = create_match_ids(&mids, &desc);
    563575        if (ret != EOK) {
     
    568580
    569581        /* Register device */
     582        usb_log_debug("Device(%d): Registering DDF device\n", address);
    570583        ret = hcd_ddf_add_device(device, hub, port, address, speed, NULL, &mids);
    571584        clean_match_ids(&mids);
     
    848861        hw_res_list_parsed_clean(&hw_res);
    849862        if (ret != EOK) {
    850                 usb_log_error("Failed to init uhci_hcd: %s.\n", str_error(ret));
     863                usb_log_error("Failed to init HCD: %s.\n", str_error(ret));
    851864                goto irq_unregister;
    852865        }
     
    871884        ret = hcd_ddf_setup_root_hub(device);
    872885        if (ret != EOK) {
    873                 usb_log_error("Failed to setup UHCI root hub: %s.\n",
     886                usb_log_error("Failed to setup HC root hub: %s.\n",
    874887                    str_error(ret));
    875888                driver_fini(dev_to_hcd(device));
  • uspace/lib/usbhost/src/usb_bus.c

    r92900e2 rc86ca9a  
    3434
    3535#include <usb/host/usb_bus.h>
     36#include <usb/debug.h>
    3637
    3738#include <assert.h>
     
    244245
    245246        instance->free_bw -= ep->bandwidth;
     247        usb_log_debug("Registered EP(%d:%d:%s:%s)\n", ep->address, ep->endpoint,
     248            usb_str_transfer_type_short(ep->transfer_type),
     249            usb_str_direction(ep->direction));
    246250        fibril_mutex_unlock(&instance->guard);
    247251        return EOK;
     
    267271        list_remove(&ep->link);
    268272        instance->free_bw += ep->bandwidth;
     273        usb_log_debug("Unregistered EP(%d:%d:%s:%s)\n", ep->address,
     274            ep->endpoint, usb_str_transfer_type_short(ep->transfer_type),
     275            usb_str_direction(ep->direction));
    269276        fibril_mutex_unlock(&instance->guard);
    270277        return EOK;
Note: See TracChangeset for help on using the changeset viewer.