From 909b90d2d48169868f39a2c1d6e671ab1123d2aa Mon Sep 17 00:00:00 2001 From: thorpej Date: Fri, 5 Feb 1999 01:10:30 +0000 Subject: [PATCH] Rename VR_MIICMD_DATAIN and VR_MIICMD_DATAOUT to actually match what the data sheet says. (The names and their usage were exactly reversed in the code.) --- sys/dev/pci/if_vr.c | 14 +++++++------- sys/dev/pci/if_vrreg.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 33c0fcf6cb51..907ca31d3b0a 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vr.c,v 1.8 1999/02/02 00:32:21 thorpej Exp $ */ +/* $NetBSD: if_vr.c,v 1.9 1999/02/05 01:10:30 thorpej Exp $ */ /* * Copyright (c) 1997, 1998 @@ -311,7 +311,7 @@ static void vr_mii_sync(sc) { register int i; - SIO_SET(VR_MIICMD_DIR|VR_MIICMD_DATAIN); + SIO_SET(VR_MIICMD_DIR|VR_MIICMD_DATAOUT); for (i = 0; i < 32; i++) { SIO_SET(VR_MIICMD_CLK); @@ -337,9 +337,9 @@ static void vr_mii_send(sc, bits, cnt) for (i = (0x1 << (cnt - 1)); i; i >>= 1) { if (bits & i) { - SIO_SET(VR_MIICMD_DATAIN); + SIO_SET(VR_MIICMD_DATAOUT); } else { - SIO_CLR(VR_MIICMD_DATAIN); + SIO_CLR(VR_MIICMD_DATAOUT); } DELAY(1); SIO_CLR(VR_MIICMD_CLK); @@ -387,7 +387,7 @@ static int vr_mii_readreg(sc, frame) vr_mii_send(sc, frame->mii_regaddr, 5); /* Idle bit */ - SIO_CLR((VR_MIICMD_CLK|VR_MIICMD_DATAIN)); + SIO_CLR((VR_MIICMD_CLK|VR_MIICMD_DATAOUT)); DELAY(1); SIO_SET(VR_MIICMD_CLK); DELAY(1); @@ -400,7 +400,7 @@ static int vr_mii_readreg(sc, frame) DELAY(1); SIO_SET(VR_MIICMD_CLK); DELAY(1); - ack = CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT; + ack = CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAIN; /* * Now try reading data bits. If the ack failed, we still @@ -420,7 +420,7 @@ static int vr_mii_readreg(sc, frame) SIO_CLR(VR_MIICMD_CLK); DELAY(1); if (!ack) { - if (CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAOUT) + if (CSR_READ_4(sc, VR_MIICMD) & VR_MIICMD_DATAIN) frame->mii_data |= i; DELAY(1); } diff --git a/sys/dev/pci/if_vrreg.h b/sys/dev/pci/if_vrreg.h index 3e6ddf0db81a..92a570d0a82b 100644 --- a/sys/dev/pci/if_vrreg.h +++ b/sys/dev/pci/if_vrreg.h @@ -1,4 +1,4 @@ -/* $NetBSD: if_vrreg.h,v 1.7 1999/02/02 00:32:21 thorpej Exp $ */ +/* $NetBSD: if_vrreg.h,v 1.8 1999/02/05 01:10:30 thorpej Exp $ */ /* * Copyright (c) 1997, 1998 @@ -199,8 +199,8 @@ * MII command register bits. */ #define VR_MIICMD_CLK 0x01 -#define VR_MIICMD_DATAOUT 0x02 -#define VR_MIICMD_DATAIN 0x04 +#define VR_MIICMD_DATAIN 0x02 +#define VR_MIICMD_DATAOUT 0x04 #define VR_MIICMD_DIR 0x08 #define VR_MIICMD_DIRECTPGM 0x10 #define VR_MIICMD_WRITE_ENB 0x20