• Claudiu Manoil's avatar
    gianfar: Fix and cleanup rxbd status handling · f966082e
    Claudiu Manoil authored
    There are several (long standing) problems about how the status
    field of the rx buffer descriptor (rxbd) is currently handled on
    the error path:
    - too many unnecessary 16bit reads of the two halves of the rxbd
    status field (32bit), also resulting in overuse of endianness
    convesion macros;
    - "bdp->status = RXBD_LARGE" makes no sense, since the "large"
    flag is read only (only eTSEC can write it), and trying to clear
    the other status bits is also error prone in this context
    (most of the rx status bits are read only anyway).
    This is fixed with a single 32bit read of the "status" field,
    and then the appropriate 16bit shifting is applied to access
    the various status bits or the rx frame length. Also corrected
    the use of the RXBD_LARGE flag.
    Additional fix:
    "rx_over_errors" stat is incremented instead of "rx_crc_errors"
    in case of RXBD_OVERRUN occurrence.
    Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>