mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-22 09:31:51 +00:00
[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:
parent
5d05220ee0
commit
77afdc5643
@ -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 |
|
||||
|
@ -132,6 +132,12 @@ enum realtek_legacy_status {
|
||||
/** Interrupt Status Register (word) */
|
||||
#define RTL_ISR 0x3e
|
||||
|
||||
/** Transmit (Tx) Configuration Register (dword) */
|
||||
#define RTL_TCR 0x40
|
||||
#define RTL_TCR_MXDMA(x) ( (x) << 8 ) /**< Max DMA burst size */
|
||||
#define RTL_TCR_MXDMA_MASK RTL_TCR_MXDMA ( 0x7 )
|
||||
#define RTL_TCR_MXDMA_DEFAULT RTL_TCR_MXDMA ( 0x7 /* Unlimited */ )
|
||||
|
||||
/** Receive (Rx) Configuration Register (dword) */
|
||||
#define RTL_RCR 0x44
|
||||
#define RTL_RCR_RXFTH(x) ( (x) << 13 ) /**< Receive FIFO threshold */
|
||||
|
Loading…
Reference in New Issue
Block a user