Ignore:
Timestamp:
2011-03-21T14:23:15Z (13 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
55e388a1
Parents:
c32688d (diff), 48fe0c9 (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:

merge with development

File:
1 edited

Legend:

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

    rc32688d r361e61b  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup usb
     28/** @addtogroup drvusbuhcihc
    2929 * @{
    3030 */
     
    3838#include "utils/malloc32.h"
    3939
    40 /** Initializes Transfer Descriptor
     40/** Initialize Transfer Descriptor
    4141 *
    4242 * @param[in] instance Memory place to initialize.
     
    4444 * @param[in] size Size of data source.
    4545 * @param[in] toggle Value of toggle bit.
    46  * @param[in] iso True if TD is for Isochronous transfer.
     46 * @param[in] iso True if TD represents Isochronous transfer.
    4747 * @param[in] low_speed Target device's speed.
    4848 * @param[in] target Address and endpoint receiving the transfer.
     
    5151 * @param[in] next Net TD in transaction.
    5252 * @return Error code.
     53 *
     54 * Uses a mix of supplied and default values.
     55 * Implicit values:
     56 *  - all TDs have vertical flag set (makes transfers to endpoints atomic)
     57 *  - in the error field only active it is set
     58 *  - if the packet uses PID_IN and is not isochronous SPD is set
     59 *
     60 * Dumps 8 bytes of buffer if PID_SETUP is used.
    5361 */
    5462void td_init(td_t *instance, int err_count, size_t size, bool toggle, bool iso,
     
    8896        }
    8997
    90         usb_log_debug2("Created TD: %X:%X:%X:%X(%p).\n",
    91             instance->next, instance->status, instance->device,
     98        usb_log_debug2("Created TD(%p): %X:%X:%X:%X(%p).\n",
     99            instance, instance->next, instance->status, instance->device,
    92100            instance->buffer_ptr, buffer);
     101        td_print_status(instance);
    93102        if (pid == USB_PID_SETUP) {
    94103                usb_log_debug("SETUP BUFFER: %s\n",
    95                         usb_debug_str_buffer(buffer, 8, 8));
     104                    usb_debug_str_buffer(buffer, 8, 8));
    96105        }
    97106}
    98107/*----------------------------------------------------------------------------*/
    99 /** Converts TD status into standard error code
     108/** Convert TD status into standard error code
    100109 *
    101110 * @param[in] instance TD structure to use.
     
    126135        return EOK;
    127136}
     137/*----------------------------------------------------------------------------*/
     138/** Print values in status field (dw1) in a human readable way.
     139 *
     140 * @param[in] instance TD structure to use.
     141 */
     142void td_print_status(td_t *instance)
     143{
     144        assert(instance);
     145        const uint32_t s = instance->status;
     146        usb_log_debug2("TD(%p) status(%#x):%s %d,%s%s%s%s%s%s%s%s%s%s%s %d.\n",
     147            instance, instance->status,
     148            (s & TD_STATUS_SPD_FLAG) ? " SPD," : "",
     149            (s >> TD_STATUS_ERROR_COUNT_POS) & TD_STATUS_ERROR_COUNT_MASK,
     150            (s & TD_STATUS_LOW_SPEED_FLAG) ? " LOW SPEED," : "",
     151            (s & TD_STATUS_ISOCHRONOUS_FLAG) ? " ISOCHRONOUS," : "",
     152            (s & TD_STATUS_IOC_FLAG) ? " IOC," : "",
     153            (s & TD_STATUS_ERROR_ACTIVE) ? " ACTIVE," : "",
     154            (s & TD_STATUS_ERROR_STALLED) ? " STALLED," : "",
     155            (s & TD_STATUS_ERROR_BUFFER) ? " BUFFER," : "",
     156            (s & TD_STATUS_ERROR_BABBLE) ? " BABBLE," : "",
     157            (s & TD_STATUS_ERROR_NAK) ? " NAK," : "",
     158            (s & TD_STATUS_ERROR_CRC) ? " CRC/TIMEOUT," : "",
     159            (s & TD_STATUS_ERROR_BIT_STUFF) ? " BIT_STUFF," : "",
     160            (s & TD_STATUS_ERROR_RESERVED) ? " RESERVED," : "",
     161            td_act_size(instance)
     162        );
     163}
    128164/**
    129165 * @}
Note: See TracChangeset for help on using the changeset viewer.