mirror of
https://github.com/xcat2/xNBA.git
synced 2024-11-22 17:41:55 +00:00
[realtek] Use explicit values for RCR.RXFTH and RCR.MXDMA
Some RTL8169 cards (observed with an RTL8169SC) power up with invalid values in RCR.RXFTH and RCR.MXDMA, causing receive DMA to fail. Fix by setting explicit values for both fields. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
b0ba892333
commit
5d05220ee0
@ -526,8 +526,10 @@ static int realtek_open ( struct net_device *netdev ) {
|
||||
|
||||
/* Configure receiver */
|
||||
rcr = readl ( rtl->regs + RTL_RCR );
|
||||
rcr &= ~( RTL_RCR_RBLEN_MASK );
|
||||
rcr |= ( RTL_RCR_RBLEN_DEFAULT | RTL_RCR_WRAP | RTL_RCR_AB |
|
||||
rcr &= ~( RTL_RCR_RXFTH_MASK | RTL_RCR_RBLEN_MASK |
|
||||
RTL_RCR_MXDMA_MASK );
|
||||
rcr |= ( RTL_RCR_RXFTH_DEFAULT | RTL_RCR_RBLEN_DEFAULT |
|
||||
RTL_RCR_MXDMA_DEFAULT | RTL_RCR_WRAP | RTL_RCR_AB |
|
||||
RTL_RCR_AM | RTL_RCR_APM | RTL_RCR_AAP );
|
||||
writel ( rcr, rtl->regs + RTL_RCR );
|
||||
|
||||
|
@ -134,9 +134,15 @@ enum realtek_legacy_status {
|
||||
|
||||
/** Receive (Rx) Configuration Register (dword) */
|
||||
#define RTL_RCR 0x44
|
||||
#define RTL_RCR_RXFTH(x) ( (x) << 13 ) /**< Receive FIFO threshold */
|
||||
#define RTL_RCR_RXFTH_MASK RTL_RCR_RXFTH ( 0x7 )
|
||||
#define RTL_RCR_RXFTH_DEFAULT RTL_RCR_RXFTH ( 0x7 /* Whole packet */ )
|
||||
#define RTL_RCR_RBLEN(x) ( (x) << 11 ) /**< Receive buffer length */
|
||||
#define RTL_RCR_RBLEN_MASK RTL_RCR_RBLEN ( 0x3 )
|
||||
#define RTL_RCR_RBLEN_DEFAULT RTL_RCR_RBLEN ( 0 /* 8kB */ )
|
||||
#define RTL_RCR_MXDMA(x) ( (x) << 8 ) /**< Max DMA burst size */
|
||||
#define RTL_RCR_MXDMA_MASK RTL_RCR_MXDMA ( 0x7 )
|
||||
#define RTL_RCR_MXDMA_DEFAULT RTL_RCR_MXDMA ( 0x7 /* Unlimited */ )
|
||||
#define RTL_RCR_WRAP 0x00000080UL /**< Overrun receive buffer */
|
||||
#define RTL_RCR_9356SEL 0x00000040UL /**< EEPROM is a 93C56 */
|
||||
#define RTL_RCR_AB 0x00000008UL /**< Accept broadcast packets */
|
||||
|
Loading…
Reference in New Issue
Block a user