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

Changeset 9e9d018 in mainline


Ignore:
Timestamp:
2015-07-05T02:19:57Z (7 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
bc8bc6e
Parents:
7a1757e
Message:

uhci/rh: sanitize logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/uhci_rh.c

    r7a1757e r9e9d018  
    168168} while (0)
    169169
    170 #define RH_DEBUG(d, port, msg, ...) \
     170#define RH_DEBUG(hub, port, msg, ...) \
    171171        if ((int)port >= 0) \
    172                 usb_log_debug("%s: rh-%d: " msg, d->name, port, ##__VA_ARGS__); \
     172                usb_log_debug("RH(%p-%d): " msg, hub, port, ##__VA_ARGS__); \
    173173        else \
    174                 usb_log_debug("%s: rh: " msg, d->name, ##__VA_ARGS__) \
     174                usb_log_debug("RH(%p):" msg, hub, ##__VA_ARGS__) \
    175175
    176176/** USB HUB port state request handler.
     
    198198        data[0] = ((value & STATUS_LINE_D_MINUS) ? 1 : 0)
    199199            | ((value & STATUS_LINE_D_PLUS) ? 2 : 0);
    200         RH_DEBUG(device, port, "Bus state %" PRIx8 "(source %" PRIx16")\n",
     200        RH_DEBUG(hub, port, "Bus state %" PRIx8 "(source %" PRIx16")\n",
    201201            data[0], value);
    202202        *act_size = 1;
     
    243243            ((hub->reset_changed[port] ? 1 : 0) << USB_HUB_FEATURE_C_PORT_RESET)
    244244        );
    245         RH_DEBUG(device, port, "Port status %" PRIx32 " (source %" PRIx16
     245        RH_DEBUG(hub, port, "Port status %" PRIx32 " (source %" PRIx16
    246246            "%s)\n", uint32_usb2host(status), val,
    247247            hub->reset_changed[port] ? "-reset" : "");
     
    271271        switch (feature) {
    272272        case USB_HUB_FEATURE_PORT_ENABLE:
    273                 RH_DEBUG(device, port, "Clear port enable (status %"
     273                RH_DEBUG(hub, port, "Clear port enable (status %"
    274274                    PRIx16 ")\n", status);
    275275                pio_write_16(hub->ports[port], val & ~STATUS_ENABLED);
    276276                break;
    277277        case USB_HUB_FEATURE_PORT_SUSPEND:
    278                 RH_DEBUG(device, port, "Clear port suspend (status %"
     278                RH_DEBUG(hub, port, "Clear port suspend (status %"
    279279                    PRIx16 ")\n", status);
    280280                pio_write_16(hub->ports[port], val & ~STATUS_SUSPEND);
     
    283283                break;
    284284        case USB_HUB_FEATURE_PORT_POWER:
    285                 RH_DEBUG(device, port, "Clear port power (status %" PRIx16 ")\n",
     285                RH_DEBUG(hub, port, "Clear port power (status %" PRIx16 ")\n",
    286286                    status);
    287287                /* We are always powered */
     
    289289                break;
    290290        case USB_HUB_FEATURE_C_PORT_CONNECTION:
    291                 RH_DEBUG(device, port, "Clear port conn change (status %"
     291                RH_DEBUG(hub, port, "Clear port conn change (status %"
    292292                    PRIx16 ")\n", status);
    293293                pio_write_16(hub->ports[port], val | STATUS_CONNECTED_CHANGED);
    294294                break;
    295295        case USB_HUB_FEATURE_C_PORT_RESET:
    296                 RH_DEBUG(device, port, "Clear port reset change (status %"
     296                RH_DEBUG(hub, port, "Clear port reset change (status %"
    297297                    PRIx16 ")\n", status);
    298298                hub->reset_changed[port] = false;
    299299                break;
    300300        case USB_HUB_FEATURE_C_PORT_ENABLE:
    301                 RH_DEBUG(device, port, "Clear port enable change (status %"
     301                RH_DEBUG(hub, port, "Clear port enable change (status %"
    302302                    PRIx16 ")\n", status);
    303303                pio_write_16(hub->ports[port], status | STATUS_ENABLED_CHANGED);
    304304                break;
    305305        case USB_HUB_FEATURE_C_PORT_SUSPEND:
    306                 RH_DEBUG(device, port, "Clear port suspend change (status %"
     306                RH_DEBUG(hub, port, "Clear port suspend change (status %"
    307307                    PRIx16 ")\n", status);
    308308                //TODO
    309309                return ENOTSUP;
    310310        case USB_HUB_FEATURE_C_PORT_OVER_CURRENT:
    311                 RH_DEBUG(device, port, "Clear port OC change (status %"
     311                RH_DEBUG(hub, port, "Clear port OC change (status %"
    312312                    PRIx16 ")\n", status);
    313313                /* UHCI Does not report over current */
    314                 //TODO: newer chips do, but some have broken wiring 
     314                //TODO: newer chips do, but some have broken wiring
    315315                break;
    316316        default:
    317                 RH_DEBUG(device, port, "Clear unknown feature %d (status %"
     317                RH_DEBUG(hub, port, "Clear unknown feature %d (status %"
    318318                    PRIx16 ")\n", feature, status);
    319319                usb_log_warning("Clearing feature %d is unsupported\n",
     
    343343        switch (feature) {
    344344        case USB_HUB_FEATURE_PORT_RESET:
    345                 RH_DEBUG(device, port, "Set port reset before (status %" PRIx16
     345                RH_DEBUG(hub, port, "Set port reset before (status %" PRIx16
    346346                    ")\n", status);
    347347                uhci_port_reset_enable(hub->ports[port]);
    348348                hub->reset_changed[port] = true;
    349                 RH_DEBUG(device, port, "Set port reset after (status %" PRIx16
     349                RH_DEBUG(hub, port, "Set port reset after (status %" PRIx16
    350350                    ")\n", pio_read_16(hub->ports[port]));
    351351                break;
    352352        case USB_HUB_FEATURE_PORT_SUSPEND:
    353                 RH_DEBUG(device, port, "Set port suspend (status %" PRIx16
     353                RH_DEBUG(hub, port, "Set port suspend (status %" PRIx16
    354354                    ")\n", status);
    355355                pio_write_16(hub->ports[port],
     
    358358                break;
    359359        case USB_HUB_FEATURE_PORT_POWER:
    360                 RH_DEBUG(device, port, "Set port power (status %" PRIx16
     360                RH_DEBUG(hub, port, "Set port power (status %" PRIx16
    361361                    ")\n", status);
    362362                /* We are always powered */
     
    367367        case USB_HUB_FEATURE_C_PORT_SUSPEND:
    368368        case USB_HUB_FEATURE_C_PORT_OVER_CURRENT:
    369                 RH_DEBUG(device, port, "Set port change flag (status %" PRIx16
     369                RH_DEBUG(hub, port, "Set port change flag (status %" PRIx16
    370370                    ")\n", status);
    371371                /* These are voluntary and don't have to be set
     
    373373                break;
    374374        default:
    375                 RH_DEBUG(device, port, "Set unknown feature %d (status %" PRIx16
     375                RH_DEBUG(hub, port, "Set unknown feature %d (status %" PRIx16
    376376                    ")\n", feature, status);
    377377                usb_log_warning("Setting feature %d is unsupported\n",
     
    412412                0x4 : 0);
    413413
    414         RH_DEBUG(device, -1, "Event mask %" PRIx8
     414        RH_DEBUG(hub, -1, "Event mask %" PRIx8
    415415            " (status_a %" PRIx16 "%s),"
    416416            " (status_b %" PRIx16 "%s)\n", status,
Note: See TracChangeset for help on using the changeset viewer.