Commit 14bc435e authored by Max.Nekludov@us.elster.com's avatar Max.Nekludov@us.elster.com Committed by David S. Miller

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: default avatarMax Nekludov <Max.Nekludov@us.elster.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00cfec37
...@@ -528,7 +528,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks) ...@@ -528,7 +528,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
for (; rxfc != 0; rxfc--) { for (; rxfc != 0; rxfc--) {
rxh = ks8851_rdreg32(ks, KS_RXFHSR); rxh = ks8851_rdreg32(ks, KS_RXFHSR);
rxstat = rxh & 0xffff; rxstat = rxh & 0xffff;
rxlen = rxh >> 16; rxlen = (rxh >> 16) & 0xfff;
netif_dbg(ks, rx_status, ks->netdev, netif_dbg(ks, rx_status, ks->netdev,
"rx: stat 0x%04x, len 0x%04x\n", rxstat, rxlen); "rx: stat 0x%04x, len 0x%04x\n", rxstat, rxlen);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment