summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_rge.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2020-03-27 15:15:25 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2020-03-27 15:15:25 +0000
commit0cdf31a62ced79c2ef32a1348e1afb7def50a41e (patch)
tree5825b20747231c5b66a32f48fe4df7120a635cb6 /sys/dev/pci/if_rge.c
parent989cc7b940c55979ba90d296ad592d2ec381bace (diff)
Use correct bit mask to promptly exit rge_set_phy_power() and
rge_exit_oob() timeout loops. Spotted by CID 1491296 and 1491309. Fix & ok kevlo@
Diffstat (limited to 'sys/dev/pci/if_rge.c')
-rw-r--r--sys/dev/pci/if_rge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/if_rge.c b/sys/dev/pci/if_rge.c
index a7affec72d1..5b3fff4f0ea 100644
--- a/sys/dev/pci/if_rge.c
+++ b/sys/dev/pci/if_rge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rge.c,v 1.2 2020/01/02 09:00:45 kevlo Exp $ */
+/* $OpenBSD: if_rge.c,v 1.3 2020/03/27 15:15:24 krw Exp $ */
/*
* Copyright (c) 2019 Kevin Lo <kevlo@openbsd.org>
@@ -1383,7 +1383,7 @@ rge_set_phy_power(struct rge_softc *sc, int on)
rge_write_phy(sc, 0, MII_BMCR, BMCR_AUTOEN);
for (i = 0; i < RGE_TIMEOUT; i++) {
- if ((rge_read_phy_ocp(sc, 0xa420) & 0x0080) == 3)
+ if ((rge_read_phy_ocp(sc, 0xa420) & 0x0007) == 3)
break;
DELAY(1000);
}
@@ -1824,7 +1824,7 @@ rge_exit_oob(struct rge_softc *sc)
if (rge_read_mac_ocp(sc, 0xd42c) & 0x0100) {
for (i = 0; i < RGE_TIMEOUT; i++) {
- if ((rge_read_phy_ocp(sc, 0xa420) & 0x0080) == 2)
+ if ((rge_read_phy_ocp(sc, 0xa420) & 0x0007) == 2)
break;
DELAY(1000);
}