提交 dd70ff48 编写于 作者: M Marek Vasut 提交者: Tom Rini

net: ks8851: Reset internal RXFC count on bad packet

A sporadic condition occurs when the "bad packet" error is triggered
repeatedly, which results in "bad packet" messages scrolling on the
console during transfer. To avoid triggering this, reset the internal
RXFC count on the first occurance of the "bad packet", which forces
the code to re-read the RX packet count from the MAC, and prevents
any additional "bad packet" messages if there are no more packets in
the MAC. Also print better debug information if this condition occurs.
Signed-off-by: NMarek Vasut <marex@denx.de>
Cc: Eugen Hristev <eugen.hristev@microchip.com>
Cc: Joe Hershberger <joe.hershberger@ni.com>
Cc: Tom Rini <trini@konsulko.com>
上级 ea707dc0
...@@ -251,7 +251,8 @@ static int ks_rcv(struct ks_net *ks, uchar *data) ...@@ -251,7 +251,8 @@ static int ks_rcv(struct ks_net *ks, uchar *data)
} }
ks_wrreg16(ks, KS_RXQCR, RXQCR_CMD_CNTL | RXQCR_RRXEF); ks_wrreg16(ks, KS_RXQCR, RXQCR_CMD_CNTL | RXQCR_RRXEF);
printf(DRIVERNAME ": bad packet\n"); printf(DRIVERNAME ": bad packet (sts=0x%04x len=0x%04x)\n", sts, len);
ks->rxfc = 0;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册