Changeset ebf59e4 in mainline


Ignore:
Timestamp:
2011-03-18T22:31:02Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
13b9cb5
Parents:
d3991b2
Message:

Reverse error priorities

STALL should be reported only if there is no other error
otherwise it is the only reported

File:
1 edited

Legend:

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

    rd3991b2 rebf59e4  
    114114        assert(instance);
    115115
    116         if ((instance->status & TD_STATUS_ERROR_STALLED) != 0)
    117                 return ESTALL;
     116        /* this is hc internal error it should never be reported */
     117        if ((instance->status & TD_STATUS_ERROR_BIT_STUFF) != 0)
     118                return EAGAIN;
    118119
     120        /* CRC or timeout error, like device not present or bad data,
     121         * it won't be reported unless err count reached zero */
    119122        if ((instance->status & TD_STATUS_ERROR_CRC) != 0)
    120123                return EBADCHECKSUM;
    121124
    122         if ((instance->status & TD_STATUS_ERROR_BUFFER) != 0)
     125        /* hc does not end transaction on these, it should never be reported */
     126        if ((instance->status & TD_STATUS_ERROR_NAK) != 0)
    123127                return EAGAIN;
    124128
     129        /* buffer overrun or underrun */
     130        if ((instance->status & TD_STATUS_ERROR_BUFFER) != 0)
     131                return ERANGE;
     132
     133        /* device babble is something serious */
    125134        if ((instance->status & TD_STATUS_ERROR_BABBLE) != 0)
    126135                return EIO;
    127136
    128         if ((instance->status & TD_STATUS_ERROR_NAK) != 0)
    129                 return EAGAIN;
    130 
    131         if ((instance->status & TD_STATUS_ERROR_BIT_STUFF) != 0)
    132                 return EAGAIN;
     137        /* stall might represent err count reaching zero or stall response from
     138         * the device, is err count reached zero, one of the above is reported*/
     139        if ((instance->status & TD_STATUS_ERROR_STALLED) != 0)
     140                return ESTALL;
    133141
    134142        return EOK;
Note: See TracChangeset for help on using the changeset viewer.