Module Name:src
Committed By: martin
Date: Mon Mar 25 15:37:25 UTC 2024
Modified Files:
src/sys/dev/qbus [netbsd-8]: if_qe.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #1951):
sys/dev/qbus/if_qe.c: revision 1.82
vax/qe(4): supply an ipf->if_init() so that if_init() doesn't crash.
convert the existing qeinit() to one compatible with if_init.
should fix PR#58068.
To generate a diff of this commit:
cvs rdiff -u -r1.77.2.1 -r1.77.2.2 src/sys/dev/qbus/if_qe.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/qbus/if_qe.c
diff -u src/sys/dev/qbus/if_qe.c:1.77.2.1 src/sys/dev/qbus/if_qe.c:1.77.2.2
--- src/sys/dev/qbus/if_qe.c:1.77.2.1 Thu Jul 26 23:55:30 2018
+++ src/sys/dev/qbus/if_qe.c Mon Mar 25 15:37:25 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: if_qe.c,v 1.77.2.1 2018/07/26 23:55:30 snj Exp $ */
+/* $NetBSD: if_qe.c,v 1.77.2.2 2024/03/25 15:37:25 martin Exp $ */
/*
* Copyright (c) 1999 Ludd, University of Lule}, Sweden. All rights reserved.
*
@@ -32,7 +32,7 @@
*/
#include
-__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.77.2.1 2018/07/26 23:55:30 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_qe.c,v 1.77.2.2 2024/03/25 15:37:25 martin Exp $");
#include "opt_inet.h"
@@ -97,7 +97,7 @@ struct qe_softc {
static int qematch(device_t, cfdata_t, void *);
static void qeattach(device_t, device_t, void *);
-static void qeinit(struct qe_softc *);
+static int qeinit(struct ifnet *);
static void qestart(struct ifnet *);
static void qeintr(void *);
static int qeioctl(struct ifnet *, u_long, void *);
@@ -341,6 +341,7 @@ qeattach(device_t parent, device_t self,
ifp->if_softc = sc;
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
ifp->if_start = qestart;
+ ifp->if_init = qeinit;
ifp->if_ioctl = qeioctl;
ifp->if_watchdog = qetimeout;
IFQ_SET_READY(>if_snd);
@@ -381,10 +382,10 @@ qeattach(device_t parent, device_t self,
/*
* Initialization of interface.
*/
-void
-qeinit(struct qe_softc *sc)
+int
+qeinit(struct ifnet *ifp)
{
- struct ifnet *ifp = (struct ifnet *)>sc_if;
+ struct qe_softc *sc = ifp->if_softc;
struct qe_cdata *qc = sc->sc_qedata;
int i;
@@ -411,7 +412,6 @@ qeinit(struct qe_softc *sc)
qc->qc_xmit[i].qe_status1 = qc->qc_xmit[i].qe_flag = QE_NOTYET;
}
-
/*
* Init receive descriptors.
*/
@@ -436,6 +436,7 @@ qeinit(struct qe_softc *sc)
*/
qe_setup(sc);
+ return 0;
}
/*
@@ -651,7 +652,7 @@ qeioctl(struct ifnet *ifp, u_long cmd, v
switch(ifa->ifa_addr->sa_family) {
#ifdef INET
case AF_INET:
- qeinit(sc);
+ qeinit(ifp);
arp_ifinit(ifp, ifa);
break;
#endif
@@ -677,7 +678,7 @@ qeioctl(struct ifnet *ifp, u_long cmd, v
* If interface it marked up and it is stopped, then
* start it.
*/
- qeinit(sc);
+ qeinit(ifp);
break;
case IFF_UP|IFF_RUNNING:
/*
@@ -865,5 +866,5 @@ qetimeout(struct ifnet *ifp)
* Do a reset of interface, to get it going again.
* Will it work by just restart the transmit logic?
*/
- qeinit(sc);
+ qeinit(ifp);
}