[realtek] Use explicit value for TCR.MXDMA

Some RTL8169 cards (observed with an RTL8169SC) power up with
TCR.MXDMA set to 16 bytes.  While this does not prevent proper
operation, it almost certainly degrades performance.

Fix by explicitly setting TCR.MXDMA to "unlimited".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-08-23 13:27:31 +01:00
parent 5d05220ee0
commit 77afdc5643
2 changed files with 13 additions and 0 deletions

View File

@@ -500,6 +500,7 @@ static void realtek_refill_rx ( struct realtek_nic *rtl ) {
*/
static int realtek_open ( struct net_device *netdev ) {
struct realtek_nic *rtl = netdev->priv;
uint32_t tcr;
uint32_t rcr;
int rc;
@@ -524,6 +525,12 @@ static int realtek_open ( struct net_device *netdev ) {
*/
writeb ( ( RTL_CR_TE | RTL_CR_RE ), rtl->regs + RTL_CR );
/* Configure transmitter */
tcr = readl ( rtl->regs + RTL_TCR );
tcr &= ~RTL_TCR_MXDMA_MASK;
tcr |= RTL_TCR_MXDMA_DEFAULT;
writel ( tcr, rtl->regs + RTL_TCR );
/* Configure receiver */
rcr = readl ( rtl->regs + RTL_RCR );
rcr &= ~( RTL_RCR_RXFTH_MASK | RTL_RCR_RBLEN_MASK |