drivers: eth_enc28j60: fix calculation of frame length

Fix calculation of frame length in eth_enc28j60_rx().
The calculation was incorrect because the CRC size was
subtracted only from the lower byte.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2019-03-06 17:55:46 +01:00 committed by Anas Nashif
commit 5d14f94c73

View file

@ -533,7 +533,7 @@ static int eth_enc28j60_rx(struct device *dev)
/* Get the frame length from the rx status vector, /* Get the frame length from the rx status vector,
* minus CRC size at the end which is always present * minus CRC size at the end which is always present
*/ */
frm_len = (info[1] << 8) | (info[0] - 4); frm_len = sys_get_le16(info) - 4;
lengthfr = frm_len; lengthfr = frm_len;
/* Get the frame from the buffer */ /* Get the frame from the buffer */