mii_phy_flowstatus(): short-circuit processing if both sides advertise

symmetric pause capability.  From HITOSHI Osada.
This commit is contained in:
thorpej 2004-04-11 15:47:33 +00:00
parent ad35f1d6fa
commit a85c2a8f12
1 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mii_physubr.c,v 1.41 2004/04/11 15:42:48 thorpej Exp $ */
/* $NetBSD: mii_physubr.c,v 1.42 2004/04/11 15:47:33 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.41 2004/04/11 15:42:48 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.42 2004/04/11 15:47:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/device.h>
@ -623,6 +623,9 @@ mii_phy_flowstatus(struct mii_softc *sc)
anar = PHY_READ(sc, MII_ANAR);
anlpar = PHY_READ(sc, MII_ANLPAR);
if ((anar & ANAR_X_PAUSE_SYM) & (anlpar & ANLPAR_X_PAUSE_SYM))
return (IFM_FLOW|IFM_ETH_TXPAUSE|IFM_ETH_RXPAUSE);
if ((anar & ANAR_X_PAUSE_SYM) == 0) {
if ((anar & ANAR_X_PAUSE_ASYM) &&
((anlpar &