summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2000-06-03 02:55:05 +0000
committerJason Wright <jason@cvs.openbsd.org>2000-06-03 02:55:05 +0000
commit92f28b9442b1f8219e83e2fef99b2a22772b0084 (patch)
tree82d40bd8ad0cbe4a14dafdea479d59a67b9e7597 /sys
parentcbe1e8e012250e9d881ecfb81519b31abf2ecc1b (diff)
remove fxp_ether_ioctl(), and move it's processing to fxp_ioctl().
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/fxp.c93
1 files changed, 36 insertions, 57 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index b16eeed02b0..07e920e523c 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.5 2000/04/27 00:29:51 chris Exp $ */
+/* $OpenBSD: fxp.c,v 1.6 2000/06/03 02:55:04 jason Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -252,10 +252,6 @@ void fxp_attach __P((struct device *, struct device *, void *));
void fxp_shutdown __P((void *));
void fxp_power __P((int, void *));
-/* Compensate for lack of a generic ether_ioctl() */
-int fxp_ether_ioctl __P((struct ifnet *, u_long, caddr_t));
-#define ether_ioctl fxp_ether_ioctl
-
struct cfdriver fxp_cd = {
NULL, "fxp", DV_IFNET
};
@@ -298,55 +294,6 @@ fxp_power(why, arg)
splx(s);
}
-int
-fxp_ether_ioctl(ifp, cmd, data)
- struct ifnet *ifp;
- u_long cmd;
- caddr_t data;
-{
- struct ifaddr *ifa = (struct ifaddr *) data;
- struct fxp_softc *sc = ifp->if_softc;
-
- switch (cmd) {
- case SIOCSIFADDR:
- ifp->if_flags |= IFF_UP;
-
- switch (ifa->ifa_addr->sa_family) {
-#ifdef INET
- case AF_INET:
- fxp_init(sc);
- arp_ifinit(&sc->arpcom, ifa);
- break;
-#endif
-#ifdef NS
- case AF_NS:
- {
- register struct ns_addr *ina = &IA_SNS(ifa)->sns_addr;
-
- if (ns_nullhost(*ina))
- ina->x_host = *(union ns_host *)
- LLADDR(ifp->if_sadl);
- else
- bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),
- ifp->if_addrlen);
- /* Set new address. */
- fxp_init(sc);
- break;
- }
-#endif
- default:
- fxp_init(sc);
- break;
- }
- break;
-
- default:
- return (EINVAL);
- }
-
- return (0);
-}
-
/*************************************************************
* End of operating system-specific autoconfiguration glue
*************************************************************/
@@ -1407,15 +1354,47 @@ fxp_ioctl(ifp, command, data)
{
struct fxp_softc *sc = ifp->if_softc;
struct ifreq *ifr = (struct ifreq *)data;
+ struct ifaddr *ifa = (struct ifaddr *)data;
int s, error = 0;
s = splimp();
- switch (command) {
+ if ((error = ether_ioctl(ifp, &sc->arpcom, command, data)) > 0) {
+ splx(s);
+ return (error);
+ }
+ switch (command) {
case SIOCSIFADDR:
- case SIOCGIFADDR:
- error = ether_ioctl(ifp, command, data);
+ ifp->if_flags |= IFF_UP;
+
+ switch (ifa->ifa_addr->sa_family) {
+#ifdef INET
+ case AF_INET:
+ fxp_init(sc);
+ arp_ifinit(&sc->arpcom, ifa);
+ break;
+#endif
+#ifdef NS
+ case AF_NS:
+ {
+ register struct ns_addr *ina = &IA_SNS(ifa)->sns_addr;
+
+ if (ns_nullhost(*ina))
+ ina->x_host = *(union ns_host *)
+ LLADDR(ifp->if_sadl);
+ else
+ bcopy(ina->x_host.c_host, LLADDR(ifp->if_sadl),
+ ifp->if_addrlen);
+ /* Set new address. */
+ fxp_init(sc);
+ break;
+ }
+#endif
+ default:
+ fxp_init(sc);
+ break;
+ }
break;
case SIOCSIFMTU: