From 578ce1c9222e1d25dd6f2462bf346a3ee0c62e7a Mon Sep 17 00:00:00 2001 From: marius Date: Sun, 5 Jul 2015 20:16:51 +0000 Subject: [PATCH] MFC: r281337 Don't enable RX and TX before their initial configuration is done, i. e. after setting up interrupt moderation but before turning interrupts on. This matches what Realtek's r8168 Linux driver does as of version 8.039.00 and fixes problems with certain incarnations of certain MAC revisions like the interface requiring an extra up/down-cycle after boot to start working or DMA configuration not being adhered to. PR: 193743, 197535 git-svn-id: svn://svn.freebsd.org/base/stable/8@285179 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/re/if_re.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/sys/dev/re/if_re.c b/sys/dev/re/if_re.c index 2f6fed19b..d52a58e2a 100644 --- a/sys/dev/re/if_re.c +++ b/sys/dev/re/if_re.c @@ -3108,11 +3108,6 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_4(sc, RL_TXLIST_ADDR_LO, RL_ADDR_LO(sc->rl_ldata.rl_tx_list_addr)); - /* - * Enable transmit and receive. - */ - CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); - /* * Set the initial TX configuration. */ @@ -3139,6 +3134,11 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_2(sc, RL_INTRMOD, 0x5100); } + /* + * Enable transmit and receive. + */ + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB | RL_CMD_RX_ENB); + #ifdef DEVICE_POLLING /* * Disable interrupts if we are polling. @@ -3162,10 +3162,6 @@ re_init_locked(struct rl_softc *sc) /* Start RX/TX process. */ CSR_WRITE_4(sc, RL_MISSEDPKT, 0); -#ifdef notdef - /* Enable receiver and transmitter. */ - CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); -#endif /* * Initialize the timer interrupt register so that -- 2.42.0