Module Name: src
Committed By: msaitoh
Date: Mon Apr 22 08:30:32 UTC 2019
Modified Files:
src/sys/arch/macppc/dev: if_bm.c if_gm.c
Log Message:
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().
To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/macppc/dev/if_bm.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/macppc/dev/if_gm.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/arch/macppc/dev/if_bm.c
diff -u src/sys/arch/macppc/dev/if_bm.c:1.57 src/sys/arch/macppc/dev/if_bm.c:1.58
--- src/sys/arch/macppc/dev/if_bm.c:1.57 Tue Feb 5 06:17:01 2019
+++ src/sys/arch/macppc/dev/if_bm.c Mon Apr 22 08:30:31 2019
@@ -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 @@ bmac_ioctl(struct ifnet *ifp, unsigned l
#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 @@ bmac_ioctl(struct ifnet *ifp, unsigned l
error = 0;
}
break;
- default:
- error = ether_ioctl(ifp, cmd, data);
- break;
}
splx(s);
Index: src/sys/arch/macppc/dev/if_gm.c
diff -u src/sys/arch/macppc/dev/if_gm.c:1.52 src/sys/arch/macppc/dev/if_gm.c:1.53
--- src/sys/arch/macppc/dev/if_gm.c:1.52 Tue Feb 5 06:17:01 2019
+++ src/sys/arch/macppc/dev/if_gm.c Mon Apr 22 08:30:31 2019
@@ -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 @@ gmac_ioctl(struct ifnet *ifp, unsigned l
#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 @@ gmac_ioctl(struct ifnet *ifp, unsigned l
error = 0;
}
break;
- default:
- error = ether_ioctl(ifp, cmd, data);
- break;
}
splx(s);