Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev These drivers do ether_ioctl() on SIOC{A...



details:   https://anonhg.NetBSD.org/src/rev/65a11cc6d368
branches:  trunk
changeset: 456083:65a11cc6d368
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Apr 22 08:30:31 2019 +0000

description:
These drivers do ether_ioctl() on SIOC{ADD,DEL}MULTI, SIOC{G,S}IFMEDIA and
default case in the switch statement. Only the default case didn't check the
return value with ENETRESET. Integrate them to one ether_ioctl() with
ENETRESET test. This change might improve SIOCSIFMTU or some other ioctl()s
which return ENETRESET by calling if_init().

diffstat:

 sys/arch/macppc/dev/if_bm.c |  12 +++---------
 sys/arch/macppc/dev/if_gm.c |  12 +++---------
 2 files changed, 6 insertions(+), 18 deletions(-)

diffs (80 lines):

diff -r 28a3dfb1a7a8 -r 65a11cc6d368 sys/arch/macppc/dev/if_bm.c
--- a/sys/arch/macppc/dev/if_bm.c       Mon Apr 22 08:09:59 2019 +0000
+++ b/sys/arch/macppc/dev/if_bm.c       Mon Apr 22 08:30:31 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bm.c,v 1.57 2019/02/05 06:17:01 msaitoh Exp $       */
+/*     $NetBSD: if_bm.c,v 1.58 2019/04/22 08:30:31 msaitoh Exp $       */
 
 /*-
  * Copyright (C) 1998, 1999, 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.57 2019/02/05 06:17:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bm.c,v 1.58 2019/04/22 08:30:31 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -749,10 +749,7 @@
 #endif
                break;
 
-       case SIOCADDMULTI:
-       case SIOCDELMULTI:
-       case SIOCGIFMEDIA:
-       case SIOCSIFMEDIA:
+       default:
                if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
                        /*
                         * Multicast list has changed; set the hardware filter
@@ -765,9 +762,6 @@
                        error = 0;
                }
                break;
-       default:
-               error = ether_ioctl(ifp, cmd, data);
-               break;
        }
 
        splx(s);
diff -r 28a3dfb1a7a8 -r 65a11cc6d368 sys/arch/macppc/dev/if_gm.c
--- a/sys/arch/macppc/dev/if_gm.c       Mon Apr 22 08:09:59 2019 +0000
+++ b/sys/arch/macppc/dev/if_gm.c       Mon Apr 22 08:30:31 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gm.c,v 1.52 2019/02/05 06:17:01 msaitoh Exp $       */
+/*     $NetBSD: if_gm.c,v 1.53 2019/04/22 08:30:31 msaitoh Exp $       */
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.52 2019/02/05 06:17:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gm.c,v 1.53 2019/04/22 08:30:31 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -801,10 +801,7 @@
 #endif
                break;
 
-       case SIOCADDMULTI:
-       case SIOCDELMULTI:
-       case SIOCGIFMEDIA:
-       case SIOCSIFMEDIA:
+       default:
                if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
                        /*
                         * Multicast list has changed; set the hardware filter
@@ -817,9 +814,6 @@
                        error = 0;
                }
                break;
-       default:
-               error = ether_ioctl(ifp, cmd, data);
-               break;
        }
 
        splx(s);



Home | Main Index | Thread Index | Old Index