Like dwqe(4), dwge(4) should also register its instances for lookup by ofw node
or phandle.
ok?
Index: if_dwge.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/if_dwge.c,v
retrieving revision 1.17
diff -u -p -r1.17 if_dwge.c
--- if_dwge.c 5 Jul 2023 18:48:49 -0000 1.17
+++ if_dwge.c 5 Jul 2023 19:04:18 -0000
@@ -267,6 +267,8 @@ struct dwge_softc {
bus_dma_tag_t sc_dmat;
void *sc_ih;
+ struct if_device sc_ifd;
+
struct arpcom sc_ac;
#define sc_lladdr sc_ac.ac_enaddr
struct mii_data sc_mii;
@@ -634,6 +636,10 @@ dwge_attach(struct device *parent, struc
dwge_intr, sc, sc->sc_dev.dv_xname);
if (sc->sc_ih == NULL)
printf("%s: can't establish interrupt\n", sc->sc_dev.dv_xname);
+
+ sc->sc_ifd.if_node = faa->fa_node;
+ sc->sc_ifd.if_ifp = ifp;
+ if_register(&sc->sc_ifd);
}
void