• C
    gianfar: Fix and cleanup rxbd status handling · f966082e
    Claudiu Manoil 提交于
    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: NClaudiu Manoil <claudiu.manoil@freescale.com>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    f966082e
gianfar.c 93.4 KB