summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_stge.c
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-09-11 18:04:03 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-09-11 18:04:03 +0000
commit41251d99f1d46ce908d36ca9d0fa2434f3ca0a4d (patch)
tree5b4737a6e7559eae8940082db0e6a64ae16ca070 /sys/dev/pci/if_stge.c
parent5f2b641bd1b241c22edb6c493f472a4bb446a463 (diff)
Don't use a global variable to indicate that we are
stge1023. Use an sc member. From christos NetBSD
Diffstat (limited to 'sys/dev/pci/if_stge.c')
-rw-r--r--sys/dev/pci/if_stge.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c
index 3f16c321022..3500cb7ed23 100644
--- a/sys/dev/pci/if_stge.c
+++ b/sys/dev/pci/if_stge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_stge.c,v 1.20 2005/07/28 00:16:29 brad Exp $ */
+/* $OpenBSD: if_stge.c,v 1.21 2005/09/11 18:04:02 brad Exp $ */
/* $NetBSD: if_stge.c,v 1.27 2005/05/16 21:35:32 bouyer Exp $ */
/*-
@@ -187,7 +187,8 @@ struct stge_softc {
struct mbuf **sc_rxtailp;
int sc_txthresh; /* Tx threshold */
- int sc_usefiber; /* if we're fiber */
+ uint32_t sc_usefiber:1; /* if we're fiber */
+ uint32_t sc_stge1023:1; /* are we a 1023 */
uint32_t sc_DMACtrl; /* prototype DMACtrl register */
uint32_t sc_MACCtrl; /* prototype MacCtrl register */
uint16_t sc_IntEnable; /* prototype IntEnable register */
@@ -273,7 +274,6 @@ int stge_match(struct device *, void *, void *);
void stge_attach(struct device *, struct device *, void *);
int stge_copy_small = 0;
-int stge_1023_bug = 0; /* XXX: ST1023 works only in promisc mode */
struct cfattach stge_ca = {
sizeof(struct stge_softc), stge_match, stge_attach,
@@ -505,6 +505,7 @@ stge_attach(struct device *parent, struct device *self, void *aux)
sc->sc_sh, STGE_StationAddress2) & 0xff;
sc->sc_arpcom.ac_enaddr[5] = bus_space_read_2(sc->sc_st,
sc->sc_sh, STGE_StationAddress2) >> 8;
+ sc->sc_stge1023 = 0;
} else {
uint16_t myaddr[ETHER_ADDR_LEN / 2];
for (i = 0; i <ETHER_ADDR_LEN / 2; i++) {
@@ -514,7 +515,7 @@ stge_attach(struct device *parent, struct device *self, void *aux)
}
(void)memcpy(sc->sc_arpcom.ac_enaddr, myaddr,
sizeof(sc->sc_arpcom.ac_enaddr));
- stge_1023_bug = 1;
+ sc->sc_stge1023 = 1;
}
printf(", address %s\n", ether_sprintf(sc->sc_arpcom.ac_enaddr));
@@ -1714,7 +1715,7 @@ stge_set_filter(struct stge_softc *sc)
sc->sc_ReceiveMode |= RM_ReceiveBroadcast;
/* XXX: ST1023 only works in promiscuous mode */
- if (stge_1023_bug)
+ if (sc->sc_stge1023)
ifp->if_flags |= IFF_PROMISC;
if (ifp->if_flags & IFF_PROMISC) {