diff options
Diffstat (limited to 'sys/pci')
-rw-r--r-- | sys/pci/if_xl.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sys/pci/if_xl.c b/sys/pci/if_xl.c index 930227e..afc9567 100644 --- a/sys/pci/if_xl.c +++ b/sys/pci/if_xl.c @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_xl.c,v 1.44 1999/07/08 00:42:02 wpaul Exp $ + * $Id: if_xl.c,v 1.48 1999/07/23 02:06:57 wpaul Exp $ */ /* @@ -163,7 +163,7 @@ #if !defined(lint) static const char rcsid[] = - "$Id: if_xl.c,v 1.44 1999/07/08 00:42:02 wpaul Exp $"; + "$Id: if_xl.c,v 1.48 1999/07/23 02:06:57 wpaul Exp $"; #endif /* @@ -1261,6 +1261,12 @@ static void xl_reset(sc) if (i == XL_TIMEOUT) printf("xl%d: reset didn't complete\n", sc->xl_unit); + /* Reset TX and RX. */ + CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_RESET); + xl_wait(sc); + CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_RESET); + xl_wait(sc); + /* Wait a little while for the chip to get its brains in order. */ DELAY(100000); return; @@ -1787,11 +1793,15 @@ static int xl_attach(dev) case XL_XCVR_AUTO: #ifdef XL_BACKGROUND_AUTONEG xl_autoneg_mii(sc, XL_FLAG_SCHEDDELAY, 1); + xl_stop(sc); #else - if (cold) + if (cold) { xl_autoneg_mii(sc, XL_FLAG_FORCEDELAY, 1); - else + xl_stop(sc); + } else { + xl_init(sc); xl_autoneg_mii(sc, XL_FLAG_SCHEDDELAY, 1); + } #endif media = sc->ifmedia.ifm_media; break; @@ -1799,11 +1809,15 @@ static int xl_attach(dev) case XL_XCVR_MII: #ifdef XL_BACKGROUND_AUTONEG xl_autoneg_mii(sc, XL_FLAG_SCHEDDELAY, 1); + xl_stop(sc); #else - if (cold) + if (cold) { xl_autoneg_mii(sc, XL_FLAG_FORCEDELAY, 1); - else + xl_stop(sc); + } else { + xl_init(sc); xl_autoneg_mii(sc, XL_FLAG_SCHEDDELAY, 1); + } #endif media = sc->ifmedia.ifm_media; break; @@ -2895,6 +2909,8 @@ static void xl_watchdog(ifp) if (sc->xl_autoneg) { xl_autoneg_mii(sc, XL_FLAG_DELAYTIMEO, 1); + if (!(ifp->if_flags & IFF_UP)) + xl_stop(sc); return; } @@ -2909,6 +2925,7 @@ static void xl_watchdog(ifp) xl_txeoc(sc); xl_txeof(sc); xl_rxeof(sc); + xl_reset(sc); xl_init(sc); if (ifp->if_snd.ifq_head != NULL) |