Bug in ks8851.c

From: Max . Nekludov
Date: Thu Mar 28 2013 - 14:32:49 EST



According to the Datasheet (page 52):
15-12 Reserved
11-0 RXBC Receive Byte Count
This field indicates the present received frame byte size.

I suppose the code has a bug:
rxh = ks8851_rdreg32(ks, KS_RXFHSR);
rxstat = rxh & 0xffff;
rxlen = rxh >> 16; // BUG!!! 0xFFF mask should be applied

P.S.
without bit mask applied I saw rxlen equal to 15360 which is bigger then
entire RX queue size (12KB).

Thanks,
Max Nekludov