Changeset 096a1ff in mainline for uspace/drv/uhci/root_hub/port.c


Ignore:
Timestamp:
2011-01-28T23:54:15Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5935fe4c
Parents:
f0e25e8
Message:

Shorter debug messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/root_hub/port.c

    rf0e25e8 r096a1ff  
    11
    22#include <errno.h>
     3#include <str_error.h>
    34//#include <usb/devreq.h> /* for usb_device_request_setup_packet_t */
    45#include <usb/usb.h>
     
    2223
    2324        while (1) {
    24                 uhci_print_info("Port(%d) status address %p:\n",
    25                   port_instance->number, port_instance->address);
    26 
    27                 /* read register value */
     25                /* Read port status. */
    2826                port_status_t port_status =
    2927                        port_status_read(port_instance->address);
    3028
    31                 /* debug print */
    32                 uhci_print_info("Port(%d) status %#.4x:\n",
    33                   port_instance->number, port_status);
    34                 print_port_status(port_status);
     29                uhci_print_info("Port %d: %04X (@ 0x%x) = " \
     30                    "%s,%s,%s,%s,[%s,%s],%s,%s,%s,%s\n",
     31                    port_instance->number, port_status, port_instance->address,
     32                    UHCI_GET_STR_FLAG(port_status, STATUS_SUSPEND, "suspend", "up"),
     33                    UHCI_GET_STR_FLAG(port_status, STATUS_IN_RESET, "in reset", "-"),
     34                    UHCI_GET_STR_FLAG(port_status, STATUS_LOW_SPEED, "lowsp", "fullsp"),
     35                    UHCI_GET_STR_FLAG(port_status, STATUS_RESUME, "resume", "k-state"),
     36                    UHCI_GET_STR_FLAG(port_status, STATUS_LINE_D_MINUS, "D- on", "D- off"),
     37                    UHCI_GET_STR_FLAG(port_status, STATUS_LINE_D_PLUS, "D+ on", "D+ off"),
     38                    UHCI_GET_STR_FLAG(port_status, STATUS_ENABLED_CHANGED, "enblchg", "-"),
     39                    UHCI_GET_STR_FLAG(port_status, STATUS_ENABLED, "enabled", "disabled"),
     40                    UHCI_GET_STR_FLAG(port_status, STATUS_CONNECTED_CHANGED, "connchg", "-"),
     41                    UHCI_GET_STR_FLAG(port_status, STATUS_CONNECTED, "hasdev", "nodev"));
    3542
    3643                if (port_status & STATUS_CONNECTED_CHANGED) {
     
    8188
    8289        if (ret != EOK) { /* address assigning went wrong */
    83                 uhci_print_error("Failed(%d) to assign address to the device.\n", ret);
     90                uhci_print_error("Failed to assign address (port %d): %s.\n",
     91                    port->number, str_error(ret));
    8492                uhci_port_set_enabled(port, false);
    8593                usb_address_keeping_release_default(&uhci_instance->address_manager);
Note: See TracChangeset for help on using the changeset viewer.