Module Name: src
Committed By: jakllsch
Date: Tue Nov 3 22:06:30 UTC 2009
Modified Files:
src/sys/dev/ic: hme.c
Log Message:
Use hme_init() to provide a non-NULL ifp->if_init.
To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/ic/hme.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/hme.c
diff -u src/sys/dev/ic/hme.c:1.83 src/sys/dev/ic/hme.c:1.84
--- src/sys/dev/ic/hme.c:1.83 Sat Sep 19 04:55:45 2009
+++ src/sys/dev/ic/hme.c Tue Nov 3 22:06:30 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: hme.c,v 1.83 2009/09/19 04:55:45 tsutsui Exp $ */
+/* $NetBSD: hme.c,v 1.84 2009/11/03 22:06:30 jakllsch Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.83 2009/09/19 04:55:45 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.84 2009/11/03 22:06:30 jakllsch Exp $");
/* #define HMEDEBUG */
@@ -92,7 +92,7 @@
static void hme_tick(void *);
static void hme_watchdog(struct ifnet *);
static bool hme_shutdown(device_t, int);
-static int hme_init(struct hme_softc *);
+static int hme_init(struct ifnet *);
static void hme_meminit(struct hme_softc *);
static void hme_mifinit(struct hme_softc *);
static void hme_reset(struct hme_softc *);
@@ -239,6 +239,7 @@
ifp->if_start = hme_start;
ifp->if_stop = hme_stop;
ifp->if_ioctl = hme_ioctl;
+ ifp->if_init = hme_init;
ifp->if_watchdog = hme_watchdog;
ifp->if_flags =
IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS | IFF_MULTICAST;
@@ -353,7 +354,7 @@
int s;
s = splnet();
- (void)hme_init(sc);
+ (void)hme_init(&sc->sc_ethercom.ec_if);
splx(s);
}
@@ -478,9 +479,9 @@
* and transmit/receive descriptor rings.
*/
int
-hme_init(struct hme_softc *sc)
+hme_init(struct ifnet *ifp)
{
- struct ifnet *ifp = &sc->sc_ethercom.ec_if;
+ struct hme_softc *sc = ifp->if_softc;
bus_space_tag_t t = sc->sc_bustag;
bus_space_handle_t seb = sc->sc_seb;
bus_space_handle_t etx = sc->sc_etx;
@@ -1449,14 +1450,14 @@
hme_setladrf(sc);
else {
ifp->if_flags |= IFF_UP;
- error = hme_init(sc);
+ error = hme_init(ifp);
}
arp_ifinit(ifp, ifa);
break;
#endif
default:
ifp->if_flags |= IFF_UP;
- error = hme_init(sc);
+ error = hme_init(ifp);
break;
}
break;
@@ -1486,7 +1487,7 @@
* If interface is marked up and it is stopped, then
* start it.
*/
- error = hme_init(sc);
+ error = hme_init(ifp);
break;
case IFF_UP|IFF_RUNNING:
/*
@@ -1500,7 +1501,7 @@
== (sc->sc_if_flags & (~RESETIGN)))
hme_setladrf(sc);
else
- error = hme_init(sc);
+ error = hme_init(ifp);
}
#undef RESETIGN
break;
@@ -1509,7 +1510,7 @@
}
if (sc->sc_ec_capenable != sc->sc_ethercom.ec_capenable)
- error = hme_init(sc);
+ error = hme_init(ifp);
break;