Skip to content

Commit 14bc435

Browse files
Max.Nekludov@us.elster.comdavem330
authored andcommitted
ks8851: Fix interpretation of rxlen field.
According to the Datasheet (page 52): 15-12 Reserved 11-0 RXBC Receive Byte Count This field indicates the present received frame byte size. The code has a bug: rxh = ks8851_rdreg32(ks, KS_RXFHSR); rxstat = rxh & 0xffff; rxlen = rxh >> 16; // BUG!!! 0xFFF mask should be applied Signed-off-by: Max Nekludov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 00cfec3 commit 14bc435

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/micrel/ks8851.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
528528
for (; rxfc != 0; rxfc--) {
529529
rxh = ks8851_rdreg32(ks, KS_RXFHSR);
530530
rxstat = rxh & 0xffff;
531-
rxlen = rxh >> 16;
531+
rxlen = (rxh >> 16) & 0xfff;
532532

533533
netif_dbg(ks, rx_status, ks->netdev,
534534
"rx: stat 0x%04x, len 0x%04x\n", rxstat, rxlen);

0 commit comments

Comments
 (0)