summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2001-10-18 15:09:15 +0000
committerthorpej <thorpej@NetBSD.org>2001-10-18 15:09:15 +0000
commit62577b1c53dbd3f52cfeb68659d073f2eeb462e1 (patch)
tree3ed0685ff87f782608ded84a4e698d406bab4aee /sys/dev/ic
parent4f34915dce6136daf9cf339542ee8b8dde5d3bca (diff)
Remove more cruft left over from copying bits of other drivers.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/gem.c40
-rw-r--r--sys/dev/ic/gemvar.h14
2 files changed, 14 insertions, 40 deletions
diff --git a/sys/dev/ic/gem.c b/sys/dev/ic/gem.c
index 7001c4a36a9..a461391c604 100644
--- a/sys/dev/ic/gem.c
+++ b/sys/dev/ic/gem.c
@@ -1,4 +1,4 @@
-/* $NetBSD: gem.c,v 1.5 2001/10/18 06:28:17 thorpej Exp $ */
+/* $NetBSD: gem.c,v 1.6 2001/10/18 15:09:15 thorpej Exp $ */
/*
*
@@ -108,8 +108,6 @@ int gem_rint __P((struct gem_softc *));
int gem_tint __P((struct gem_softc *));
void gem_power __P((int, void *));
-static int ether_cmp __P((u_char *, u_char *));
-
/* Default buffer copy routines */
void gem_copytobuf_contig __P((struct gem_softc *, void *, int, int));
void gem_copyfrombuf_contig __P((struct gem_softc *, void *, int, int));
@@ -125,13 +123,14 @@ void gem_zerobuf_contig __P((struct gem_softc *, int, int));
/*
- * gem_config:
+ * gem_attach:
*
* Attach a Gem interface to the system.
*/
void
-gem_config(sc)
+gem_attach(sc, enaddr)
struct gem_softc *sc;
+ const uint8_t *enaddr;
{
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
struct mii_data *mii = &sc->sc_mii;
@@ -224,7 +223,7 @@ gem_config(sc)
/* Announce ourselves. */
printf("%s: Ethernet address %s\n", sc->sc_dev.dv_xname,
- ether_sprintf(sc->sc_enaddr));
+ ether_sprintf(enaddr));
/* Initialize ifnet structure. */
strcpy(ifp->if_xname, sc->sc_dev.dv_xname);
@@ -314,7 +313,7 @@ gem_config(sc)
/* Attach the interface. */
if_attach(ifp);
- ether_ifattach(ifp, sc->sc_enaddr);
+ ether_ifattach(ifp, enaddr);
sc->sc_sh = shutdownhook_establish(gem_shutdown, sc);
if (sc->sc_sh == NULL)
@@ -823,22 +822,6 @@ gem_init(struct ifnet *ifp)
return (0);
}
-/*
- * Compare two Ether/802 addresses for equality, inlined and unrolled for
- * speed.
- */
-static __inline__ int
-ether_cmp(a, b)
- u_char *a, *b;
-{
-
- if (a[5] != b[5] || a[4] != b[4] || a[3] != b[3] ||
- a[2] != b[2] || a[1] != b[1] || a[0] != b[0])
- return (0);
- return (1);
-}
-
-
void
gem_init_regs(struct gem_softc *sc)
{
@@ -865,7 +848,8 @@ gem_init_regs(struct gem_softc *sc)
/* Dunno.... */
bus_space_write_4(t, h, GEM_MAC_CONTROL_TYPE, 0x8088);
bus_space_write_4(t, h, GEM_MAC_RANDOM_SEED,
- ((sc->sc_enaddr[5]<<8)|sc->sc_enaddr[4])&0x3ff);
+ ((LLADDR(ifp->if_sadl)[5]<<8)|
+ LLADDR(ifp->if_sadl)[4])&0x3ff);
/* Secondary MAC addr set to 0:0:0:0:0:0 */
bus_space_write_4(t, h, GEM_MAC_ADDR3, 0);
bus_space_write_4(t, h, GEM_MAC_ADDR4, 0);
@@ -910,11 +894,11 @@ gem_init_regs(struct gem_softc *sc)
* Set the station address.
*/
bus_space_write_4(t, h, GEM_MAC_ADDR0,
- (sc->sc_enaddr[4]<<8) | sc->sc_enaddr[5]);
+ (LLADDR(ifp->if_sadl)[4]<<8) | LLADDR(ifp->if_sadl)[5]);
bus_space_write_4(t, h, GEM_MAC_ADDR1,
- (sc->sc_enaddr[2]<<8) | sc->sc_enaddr[3]);
+ (LLADDR(ifp->if_sadl)[2]<<8) | LLADDR(ifp->if_sadl)[3]);
bus_space_write_4(t, h, GEM_MAC_ADDR2,
- (sc->sc_enaddr[0]<<8) | sc->sc_enaddr[1]);
+ (LLADDR(ifp->if_sadl)[0]<<8) | LLADDR(ifp->if_sadl)[1]);
}
@@ -1807,7 +1791,7 @@ gem_setladrf(sc)
ETHER_FIRST_MULTI(step, ec, enm);
while (enm != NULL) {
- if (ether_cmp(enm->enm_addrlo, enm->enm_addrhi)) {
+ if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
/*
* We must listen to a range of multicast addresses.
* For now, just accept all multicasts, rather than
diff --git a/sys/dev/ic/gemvar.h b/sys/dev/ic/gemvar.h
index bf6f0f095ac..93b002e90b9 100644
--- a/sys/dev/ic/gemvar.h
+++ b/sys/dev/ic/gemvar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: gemvar.h,v 1.3 2001/10/18 06:28:17 thorpej Exp $ */
+/* $NetBSD: gemvar.h,v 1.4 2001/10/18 15:09:15 thorpej Exp $ */
/*
*
@@ -202,7 +202,6 @@ struct gem_softc {
int sc_inited;
int sc_debug;
void *sc_sh; /* shutdownhook cookie */
- u_int8_t sc_enaddr[ETHER_ADDR_LEN]; /* MAC address */
/* Special hardware hooks */
void (*sc_hwreset) __P((struct gem_softc *));
@@ -283,22 +282,13 @@ do { \
} while (0)
#ifdef _KERNEL
-void gem_attach __P((struct gem_softc *, const u_int8_t *));
-int gem_activate __P((struct device *, enum devact));
-int gem_detach __P((struct gem_softc *));
+void gem_attach __P((struct gem_softc *, const uint8_t *));
int gem_intr __P((void *));
-int gem_read_srom __P((struct gem_softc *));
-int gem_srom_crcok __P((const u_int8_t *));
-int gem_isv_srom __P((const u_int8_t *));
-int gem_isv_srom_enaddr __P((struct gem_softc *, u_int8_t *));
-int gem_parse_old_srom __P((struct gem_softc *, u_int8_t *));
int gem_mediachange __P((struct ifnet *));
void gem_mediastatus __P((struct ifnet *, struct ifmediareq *));
-void gem_config __P((struct gem_softc *));
void gem_reset __P((struct gem_softc *));
-int gem_intr __P((void *));
#endif /* _KERNEL */