Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mips/adm5120/dev Do SIOC[GS]IFMEDIA like others. No...
details: https://anonhg.NetBSD.org/src/rev/60d1a242e611
branches: trunk
changeset: 465821:60d1a242e611
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu Dec 05 03:15:20 2019 +0000
description:
Do SIOC[GS]IFMEDIA like others. Not tested.
diffstat:
sys/arch/mips/adm5120/dev/if_admsw.c | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diffs (54 lines):
diff -r c8a1ee4ef238 -r 60d1a242e611 sys/arch/mips/adm5120/dev/if_admsw.c
--- a/sys/arch/mips/adm5120/dev/if_admsw.c Thu Dec 05 03:11:40 2019 +0000
+++ b/sys/arch/mips/adm5120/dev/if_admsw.c Thu Dec 05 03:15:20 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_admsw.c,v 1.25 2019/12/04 05:19:10 msaitoh Exp $ */
+/* $NetBSD: if_admsw.c,v 1.26 2019/12/05 03:15:20 msaitoh Exp $ */
/*-
* Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.25 2019/12/04 05:19:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_admsw.c,v 1.26 2019/12/05 03:15:20 msaitoh Exp $");
#include <sys/param.h>
@@ -454,6 +454,7 @@
admsw_reset(sc);
for (i = 0; i < SW_DEVS; i++) {
+ sc->sc_ethercom[i].ec_ifmedia = &sc->sc_ifmedia[i];
ifmedia_init(&sc->sc_ifmedia[i], 0, admsw_mediachange, admsw_mediastatus);
ifmedia_add(&sc->sc_ifmedia[i], IFM_ETHER|IFM_10_T, 0, NULL);
ifmedia_add(&sc->sc_ifmedia[i], IFM_ETHER|IFM_10_T|IFM_FDX, 0, NULL);
@@ -740,6 +741,10 @@
struct ifdrv *ifd;
int s, error, port;
+ port = (struct ethercom *)ifp - sc->sc_ethercom; /* XXX */
+ if (port >= SW_DEVS)
+ return EOPNOTSUPP;
+
s = splnet();
switch (cmd) {
@@ -747,16 +752,6 @@
if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET)
error = 0;
break;
- case SIOCSIFMEDIA:
- case SIOCGIFMEDIA:
- port = (struct ethercom *)ifp - sc->sc_ethercom; /* XXX */
- if (port >= SW_DEVS)
- error = EOPNOTSUPP;
- else
- error = ifmedia_ioctl(ifp, (struct ifreq *)data,
- &sc->sc_ifmedia[port], cmd);
- break;
-
case SIOCGDRVSPEC:
case SIOCSDRVSPEC:
ifd = (struct ifdrv *) data;
Home |
Main Index |
Thread Index |
Old Index