Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys In drivers which use MII(4) and have hook SIOC[GS]IFMEDI...



details:   https://anonhg.NetBSD.org/src/rev/4713cf87e8a0
branches:  trunk
changeset: 450671:4713cf87e8a0
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Apr 22 07:51:16 2019 +0000

description:
In drivers which use MII(4) and have hook SIOC[GS]IFMEDIA which just pass to
ifmedia_ioctl(), the hook is not required because ether_ioctl has it
(if_ethersubr.c rev. 1.160). These drivers don't return ENETRESET in
ifmedia_ioctl(), so no functional change.

diffstat:

 sys/arch/arm/sunxi/sun4i_emac.c |   9 ++-------
 sys/dev/ic/elink3.c             |  12 +++---------
 sys/dev/ic/i82557.c             |  10 ++--------
 sys/dev/pci/if_pcn.c            |  11 ++---------
 4 files changed, 9 insertions(+), 33 deletions(-)

diffs (151 lines):

diff -r ff5e32b932b0 -r 4713cf87e8a0 sys/arch/arm/sunxi/sun4i_emac.c
--- a/sys/arch/arm/sunxi/sun4i_emac.c   Mon Apr 22 06:35:39 2019 +0000
+++ b/sys/arch/arm/sunxi/sun4i_emac.c   Mon Apr 22 07:51:16 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sun4i_emac.c,v 1.6 2019/01/22 03:42:25 msaitoh Exp $ */
+/* $NetBSD: sun4i_emac.c,v 1.7 2019/04/22 07:51:16 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2013-2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.6 2019/01/22 03:42:25 msaitoh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.7 2019/04/22 07:51:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -710,14 +710,9 @@
 sun4i_emac_ifioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
        struct sun4i_emac_softc * const sc = ifp->if_softc;
-       struct ifreq *ifr = (struct ifreq *)data;
        int error;
 
        switch (cmd) {
-       case SIOCGIFMEDIA: 
-       case SIOCSIFMEDIA:     
-               error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
-               break;
        default:
                if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
                        break;
diff -r ff5e32b932b0 -r 4713cf87e8a0 sys/dev/ic/elink3.c
--- a/sys/dev/ic/elink3.c       Mon Apr 22 06:35:39 2019 +0000
+++ b/sys/dev/ic/elink3.c       Mon Apr 22 07:51:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: elink3.c,v 1.146 2019/02/05 06:17:02 msaitoh Exp $     */
+/*     $NetBSD: elink3.c,v 1.147 2019/04/22 07:51:16 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.146 2019/02/05 06:17:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: elink3.c,v 1.147 2019/04/22 07:51:16 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -430,6 +430,7 @@
        sc->sc_mii.mii_readreg = ep_mii_readreg;
        sc->sc_mii.mii_writereg = ep_mii_writereg;
        sc->sc_mii.mii_statchg = ep_statchg;
+       sc->sc_ethercom.ec_mii = &sc->sc_mii;
        ifmedia_init(&sc->sc_mii.mii_media, IFM_IMASK, ep_media_change,
            ep_media_status);
 
@@ -1663,18 +1664,11 @@
 epioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
        struct ep_softc *sc = ifp->if_softc;
-       struct ifreq *ifr = (struct ifreq *)data;
        int s, error = 0;
 
        s = splnet();
 
        switch (cmd) {
-
-       case SIOCSIFMEDIA:
-       case SIOCGIFMEDIA:
-               error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
-               break;
-
        case SIOCADDMULTI:
        case SIOCDELMULTI:
                if (sc->enabled == 0) {
diff -r ff5e32b932b0 -r 4713cf87e8a0 sys/dev/ic/i82557.c
--- a/sys/dev/ic/i82557.c       Mon Apr 22 06:35:39 2019 +0000
+++ b/sys/dev/ic/i82557.c       Mon Apr 22 07:51:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i82557.c,v 1.150 2019/01/22 03:42:26 msaitoh Exp $     */
+/*     $NetBSD: i82557.c,v 1.151 2019/04/22 07:51:16 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.150 2019/01/22 03:42:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.151 2019/04/22 07:51:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2155,17 +2155,11 @@
 fxp_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
        struct fxp_softc *sc = ifp->if_softc;
-       struct ifreq *ifr = (struct ifreq *)data;
        int s, error;
 
        s = splnet();
 
        switch (cmd) {
-       case SIOCSIFMEDIA:
-       case SIOCGIFMEDIA:
-               error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
-               break;
-
        default:
                if ((error = ether_ioctl(ifp, cmd, data)) != ENETRESET)
                        break;
diff -r ff5e32b932b0 -r 4713cf87e8a0 sys/dev/pci/if_pcn.c
--- a/sys/dev/pci/if_pcn.c      Mon Apr 22 06:35:39 2019 +0000
+++ b/sys/dev/pci/if_pcn.c      Mon Apr 22 07:51:16 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_pcn.c,v 1.67 2019/01/22 03:42:27 msaitoh Exp $      */
+/*     $NetBSD: if_pcn.c,v 1.68 2019/04/22 07:51:16 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.67 2019/01/22 03:42:27 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pcn.c,v 1.68 2019/04/22 07:51:16 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1181,18 +1181,11 @@
 static int
 pcn_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
-       struct pcn_softc *sc = ifp->if_softc;
-       struct ifreq *ifr = (struct ifreq *) data;
        int s, error;
 
        s = splnet();
 
        switch (cmd) {
-       case SIOCSIFMEDIA:
-       case SIOCGIFMEDIA:
-               error = ifmedia_ioctl(ifp, ifr, &sc->sc_mii.mii_media, cmd);
-               break;
-
        default:
                error = ether_ioctl(ifp, cmd, data);
                if (error == ENETRESET) {



Home | Main Index | Thread Index | Old Index