Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Factor out arc_storelladdr(), and use that instead of ar...
details: https://anonhg.NetBSD.org/src/rev/74d52a717016
branches: trunk
changeset: 475852:74d52a717016
user: is <is%NetBSD.org@localhost>
date: Fri Aug 27 19:23:19 1999 +0000
description:
Factor out arc_storelladdr(), and use that instead of arc_ifattach() in
the bah_reset() function.
This makes the last change work without deconnecting all the other interfaces
from the interface list.
diffstat:
sys/dev/ic/smc90cx6.c | 4 ++--
sys/net/if_arc.h | 3 ++-
sys/net/if_arcsubr.c | 28 ++++++++++++++++++++--------
3 files changed, 24 insertions(+), 11 deletions(-)
diffs (90 lines):
diff -r ef443571fe7a -r 74d52a717016 sys/dev/ic/smc90cx6.c
--- a/sys/dev/ic/smc90cx6.c Fri Aug 27 19:21:32 1999 +0000
+++ b/sys/dev/ic/smc90cx6.c Fri Aug 27 19:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smc90cx6.c,v 1.31 1999/08/26 20:44:50 is Exp $ */
+/* $NetBSD: smc90cx6.c,v 1.32 1999/08/27 19:23:19 is Exp $ */
/*-
* Copyright (c) 1994, 1995, 1998 The NetBSD Foundation, Inc.
@@ -281,7 +281,7 @@
#endif
/* tell the routing level about the (possibly changed) link address */
- arc_ifattach(ifp, linkaddress);
+ arc_storelladdr(ifp, linkaddress);
/* POR is NMI, but we need it below: */
sc->sc_intmask = BAH_RECON|BAH_POR;
diff -r ef443571fe7a -r 74d52a717016 sys/net/if_arc.h
--- a/sys/net/if_arc.h Fri Aug 27 19:21:32 1999 +0000
+++ b/sys/net/if_arc.h Fri Aug 27 19:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_arc.h,v 1.10 1999/05/20 18:07:27 thorpej Exp $ */
+/* $NetBSD: if_arc.h,v 1.11 1999/08/27 19:23:19 is Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -120,6 +120,7 @@
u_int8_t arcbroadcastaddr;
void arc_ifattach __P((struct ifnet *, u_int8_t));
+void arc_storelladdr __P((struct ifnet *, u_int8_t));
char *arc_sprintf __P((u_int8_t *));
int arc_isphds __P((int));
#endif
diff -r ef443571fe7a -r 74d52a717016 sys/net/if_arcsubr.c
--- a/sys/net/if_arcsubr.c Fri Aug 27 19:21:32 1999 +0000
+++ b/sys/net/if_arcsubr.c Fri Aug 27 19:23:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_arcsubr.c,v 1.23 1999/08/26 20:44:50 is Exp $ */
+/* $NetBSD: if_arcsubr.c,v 1.24 1999/08/27 19:23:19 is Exp $ */
/*
* Copyright (c) 1994, 1995 Ignatios Souvatzis
@@ -619,6 +619,23 @@
}
/*
+ * Register (new) link level address.
+ */
+void
+arc_storelladdr(ifp, lla)
+ struct ifnet *ifp;
+ u_int8_t lla;
+{
+ register struct sockaddr_dl *sdl;
+ if ((sdl = ifp->if_sadl) &&
+ sdl->sdl_family == AF_LINK) {
+ sdl->sdl_type = IFT_ARCNET;
+ sdl->sdl_alen = ifp->if_addrlen;
+ *(LLADDR(sdl)) = lla;
+ }
+}
+
+/*
* Perform common duties while attaching to interface list
*/
void
@@ -626,7 +643,6 @@
register struct ifnet *ifp;
u_int8_t lla;
{
- register struct sockaddr_dl *sdl;
register struct arccom *ac;
ifp->if_type = IFT_ARCNET;
@@ -650,11 +666,7 @@
ifp->if_xname, ifp->if_xname);
}
if_attach(ifp);
- if ((sdl = ifp->if_sadl) &&
- sdl->sdl_family == AF_LINK) {
- sdl->sdl_type = IFT_ARCNET;
- sdl->sdl_alen = ifp->if_addrlen;
- *(LLADDR(sdl)) = lla;
- }
+ arc_storelladdr(ifp, lla);
+
ifp->if_broadcastaddr = &arcbroadcastaddr;
}
Home |
Main Index |
Thread Index |
Old Index