Ignore:
Timestamp:
2011-03-12T22:36:33Z (15 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
335382d
Parents:
dd6f59f (diff), 67352d2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Minor fixes and refactoring

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c

    rdd6f59f r0f3e68c  
    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 * @}
Note: See TracChangeset for help on using the changeset viewer.