Changeset 67352d2 in mainline


Ignore:
Timestamp:
2011-03-12T22:35:30Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0f3e68c, eb0dc58
Parents:
7f810b3
Message:

Debug output fixes and refactoring (less spam, more readability)

Location:
uspace/drv
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ehci-hcd/pci.c

    r7f810b3 r67352d2  
    247247
    248248
    249         if ((value & USBLEGSUP_BIOS_CONTROL) != 0) {
     249        if ((value & USBLEGSUP_BIOS_CONTROL) == 0) {
    250250                usb_log_info("BIOS released control after %d usec.\n", wait);
    251251        } else {
    252252                /* BIOS failed to hand over control, this should not happen. */
    253                 usb_log_warning( "BIOS failed to release control after"
     253                usb_log_warning( "BIOS failed to release control after "
    254254                    "%d usecs, force it.\n", wait);
    255255                ret = async_req_3_0(parent_phone, DEV_IFACE_ID(PCI_DEV_IFACE),
     
    258258                CHECK_RET_HANGUP_RETURN(ret,
    259259                    "Failed(%d) to force OS EHCI control.\n", ret);
    260                 /* TODO: This does not seem to work on my machine */
    261260        }
    262261
     
    280279        usb_log_debug2("USBLEGSUP: %x.\n", value);
    281280
    282 /*
    283  * TURN OFF EHCI FOR NOW, REMOVE IF THE DRIVER IS IMPLEMENTED
    284  */
     281        /*
     282         * TURN OFF EHCI FOR NOW, DRIVER WILL REINITIALIZE IT
     283        */
    285284
    286285        /* Get size of capability registers in memory space. */
  • uspace/drv/uhci-hcd/batch.c

    r7f810b3 r67352d2  
    177177                        usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
    178178                            instance, i, instance->tds[i].status);
     179                        td_print_status(&instance->tds[i]);
    179180
    180181                        device_keeper_set_toggle(instance->manager,
     
    318319                ++packet;
    319320        }
    320         instance->tds[packet - 1].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG;
     321        instance->tds[packet - 1].status |= TD_STATUS_IOC_FLAG;
    321322        device_keeper_set_toggle(instance->manager, instance->target, toggle);
    322323}
     
    371372
    372373
    373         instance->tds[packet].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG;
     374        instance->tds[packet].status |= TD_STATUS_IOC_FLAG;
    374375        usb_log_debug2("Control last TD status: %x.\n",
    375376            instance->tds[packet].status);
  • uspace/drv/uhci-hcd/uhci.c

    r7f810b3 r67352d2  
    436436
    437437                int frnum = pio_read_16(&instance->registers->frnum) & 0x3ff;
    438                 usb_log_debug2("Framelist item: %d \n", frnum );
    439438
    440439                uintptr_t expected_pa = instance->frame_list[frnum] & (~0xf);
    441440                uintptr_t real_pa = addr_to_phys(QH(interrupt));
    442441                if (expected_pa != real_pa) {
    443                         usb_log_debug("Interrupt QH: %p vs. %p.\n",
    444                             expected_pa, real_pa);
     442                        usb_log_debug("Interrupt QH: %p(frame: %d) vs. %p.\n",
     443                            expected_pa, frnum, real_pa);
    445444                }
    446445
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c

    r7f810b3 r67352d2  
    8888        }
    8989
    90         usb_log_debug2("Created TD: %X:%X:%X:%X(%p).\n",
    91             instance->next, instance->status, instance->device,
     90        usb_log_debug2("Created TD(%p): %X:%X:%X:%X(%p).\n",
     91            instance, instance->next, instance->status, instance->device,
    9292            instance->buffer_ptr, buffer);
     93        td_print_status(instance);
    9394        if (pid == USB_PID_SETUP) {
    9495                usb_log_debug("SETUP BUFFER: %s\n",
     
    126127        return EOK;
    127128}
     129/*----------------------------------------------------------------------------*/
     130void td_print_status(td_t *instance)
     131{
     132        assert(instance);
     133        const uint32_t s = instance->status;
     134        usb_log_debug2("TD(%p) status(%#x):%s %d,%s%s%s%s%s%s%s%s%s%s%s %d.\n",
     135            instance, instance->status,
     136            (s & TD_STATUS_SPD_FLAG) ? " SPD," : "",
     137            (s >> TD_STATUS_ERROR_COUNT_POS) & TD_STATUS_ERROR_COUNT_MASK,
     138            (s & TD_STATUS_LOW_SPEED_FLAG) ? " LOW SPEED," : "",
     139            (s & TD_STATUS_ISOCHRONOUS_FLAG) ? " ISOCHRONOUS," : "",
     140            (s & TD_STATUS_IOC_FLAG) ? " IOC," : "",
     141            (s & TD_STATUS_ERROR_ACTIVE) ? " ACTIVE," : "",
     142            (s & TD_STATUS_ERROR_STALLED) ? " STALLED," : "",
     143            (s & TD_STATUS_ERROR_BUFFER) ? " BUFFER," : "",
     144            (s & TD_STATUS_ERROR_BABBLE) ? " BABBLE," : "",
     145            (s & TD_STATUS_ERROR_NAK) ? " NAK," : "",
     146            (s & TD_STATUS_ERROR_CRC) ? " CRC/TIMEOUT," : "",
     147            (s & TD_STATUS_ERROR_BIT_STUFF) ? " BIT_STUFF," : "",
     148            (s & TD_STATUS_ERROR_RESERVED) ? " RESERVED," : "",
     149            (s >> TD_STATUS_ACTLEN_POS) & TD_STATUS_ACTLEN_MASK
     150        );
     151}
    128152/**
    129153 * @}
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.h

    r7f810b3 r67352d2  
    5353#define TD_STATUS_LOW_SPEED_FLAG ( 1 << 26 )
    5454#define TD_STATUS_ISOCHRONOUS_FLAG ( 1 << 25 )
    55 #define TD_STATUS_COMPLETE_INTERRUPT_FLAG ( 1 << 24 )
     55#define TD_STATUS_IOC_FLAG ( 1 << 24 )
    5656
    5757#define TD_STATUS_ERROR_ACTIVE ( 1 << 23 )
     
    127127        return (instance->status & TD_STATUS_ERROR_ACTIVE) != 0;
    128128}
     129
     130void td_print_status(td_t *instance);
    129131#endif
    130132/**
  • uspace/drv/uhci-rhd/port.c

    r7f810b3 r67352d2  
    125125                port_status_t port_status = uhci_port_read_status(instance);
    126126
    127                 uhci_port_print_status(instance, port_status);
     127                /* print the value if it's interesting */
     128                if (port_status & ~STATUS_ALWAYS_ONE)
     129                        uhci_port_print_status(instance, port_status);
    128130
    129131                if ((port_status & STATUS_CONNECTED_CHANGED) == 0)
  • uspace/drv/uhci-rhd/port.h

    r7f810b3 r67352d2  
    9191{
    9292        assert(port);
    93         usb_log_debug2("%s Port status:%s%s%s%s%s%s%s%s.\n",
    94             port->id_string,
     93        usb_log_debug2("%s Port status(%#x):%s%s%s%s%s%s%s%s%s%s%s.\n",
     94            port->id_string, value,
    9595            (value & STATUS_SUSPEND) ? " SUSPENDED," : "",
     96            (value & STATUS_RESUME) ? " IN RESUME," : "",
    9697            (value & STATUS_IN_RESET) ? " IN RESET," : "",
     98            (value & STATUS_LINE_D_MINUS) ? " VD-," : "",
     99            (value & STATUS_LINE_D_PLUS) ? " VD+," : "",
    97100            (value & STATUS_LOW_SPEED) ? " LOWSPEED," : "",
    98101            (value & STATUS_ENABLED_CHANGED) ? " ENABLED-CHANGE," : "",
Note: See TracChangeset for help on using the changeset viewer.