Module Name: src Committed By: msaitoh Date: Mon Apr 22 09:00:12 UTC 2019
Modified Files: src/sys/dev/ic: smc91cxx.c Log Message: This driver does ether_ioctl() on SIOC{ADD,DEL}MULTI, SIOC{G,S}IFMEDIA and default case in the switch statement. Integrate them to one ether_ioctl(). This driver don't return ENETRESET in ifmedia_ioctl(), so no functional change. To generate a diff of this commit: cvs rdiff -u -r1.99 -r1.100 src/sys/dev/ic/smc91cxx.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/smc91cxx.c diff -u src/sys/dev/ic/smc91cxx.c:1.99 src/sys/dev/ic/smc91cxx.c:1.100 --- src/sys/dev/ic/smc91cxx.c:1.99 Tue Feb 5 06:17:02 2019 +++ src/sys/dev/ic/smc91cxx.c Mon Apr 22 09:00:12 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: smc91cxx.c,v 1.99 2019/02/05 06:17:02 msaitoh Exp $ */ +/* $NetBSD: smc91cxx.c,v 1.100 2019/04/22 09:00:12 msaitoh Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.99 2019/02/05 06:17:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smc91cxx.c,v 1.100 2019/04/22 09:00:12 msaitoh Exp $"); #include "opt_inet.h" @@ -316,6 +316,7 @@ smc91cxx_attach(struct smc91cxx_softc *s sc->sc_mii.mii_readreg = smc91cxx_mii_readreg; sc->sc_mii.mii_writereg = smc91cxx_mii_writereg; sc->sc_mii.mii_statchg = smc91cxx_statchg; + sc->sc_ec.ec_mii = &sc->sc_mii; ifmedia_init(ifm, IFM_IMASK, smc91cxx_mediachange, smc91cxx_mediastatus); @@ -1259,7 +1260,6 @@ smc91cxx_ioctl(struct ifnet *ifp, u_long { struct smc91cxx_softc *sc = ifp->if_softc; struct ifaddr *ifa = (struct ifaddr *)data; - struct ifreq *ifr = (struct ifreq *)data; int s, error = 0; s = splnet(); @@ -1324,6 +1324,8 @@ smc91cxx_ioctl(struct ifnet *ifp, u_long break; } + /* FALLTHROUGH */ + default: if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) { /* * Multicast list has changed; set the hardware @@ -1334,15 +1336,6 @@ smc91cxx_ioctl(struct ifnet *ifp, u_long error = 0; } break; - - case SIOCGIFMEDIA: - case SIOCSIFMEDIA: - error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd); - break; - - default: - error = ether_ioctl(ifp, cmd, data); - break; } splx(s);