From: jmatthew Date: Thu, 6 Jul 2023 08:32:37 +0000 (+0000) Subject: Register a mapping of dwge interfaces to ofw nodes/phandles. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=16e9c1f4f446ca167f5d8072859007fe4f2bab8a;p=openbsd Register a mapping of dwge interfaces to ofw nodes/phandles. ok kettenis@ --- diff --git a/sys/dev/fdt/if_dwge.c b/sys/dev/fdt/if_dwge.c index 7d3d0e06e8a..ccd298eafc4 100644 --- a/sys/dev/fdt/if_dwge.c +++ b/sys/dev/fdt/if_dwge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_dwge.c,v 1.17 2023/07/05 18:48:49 jmatthew Exp $ */ +/* $OpenBSD: if_dwge.c,v 1.18 2023/07/06 08:32:37 jmatthew Exp $ */ /* * Copyright (c) 2008, 2019 Mark Kettenis * Copyright (c) 2017 Patrick Wildt @@ -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, struct device *self, void *aux) 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