git: 9ef382e06546 - stable/13 - MFC: mii: include missing sources in loadable module

From: Eugene Grosbein <eugen_at_FreeBSD.org>
Date: Sat, 16 Apr 2022 19:19:04 UTC
The branch stable/13 has been updated by eugen:

URL: https://cgit.FreeBSD.org/src/commit/?id=9ef382e06546dd2234319bf2625a3f89e60764a3

commit 9ef382e06546dd2234319bf2625a3f89e60764a3
Author:     Milan Obuch <bsd@dino.sk>
AuthorDate: 2022-04-02 18:28:33 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2022-04-16 19:18:14 +0000

    MFC: mii: include missing sources in loadable module
    
    As of today, using 'kldload miibus' is not equivalent to using 'device
    miibus' in a kernel config. Newly introduced PHY drivers (DP83822,
    DP83867, VSCPHY) and source files/PHY driver for FDT-enabled kernels
    are missing. Without including them, kernel modules using any function
    from dev/mii/mii_fdt.c refuse to load. Additionally, miivar.h directly
    includes opt_platform.h.
    
    Add the missing sources to the module build, with the FDT-only files
    gated behind an OPT_FDT check. Maintain the alphabetical listing of
    SRCS, but move the required header files to a separate line to improve
    readability.
    
    Reviewed by:    mhorne, mindal@semihalf.com
    Differential Revision:  https://reviews.freebsd.org/D34256
    
    (cherry picked from commit 517ea731d4e803450537e9369d6a16aa4081acd7)
---
 sys/modules/mii/Makefile | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/sys/modules/mii/Makefile b/sys/modules/mii/Makefile
index 348c9b7b2845..f53419974130 100644
--- a/sys/modules/mii/Makefile
+++ b/sys/modules/mii/Makefile
@@ -3,15 +3,21 @@
 .PATH: ${SRCTOP}/sys/dev/mii
 
 KMOD=	miibus
-SRCS=	acphy.c amphy.c atphy.c axphy.c bmtphy.c brgphy.c bus_if.h
-SRCS+=	ciphy.c device_if.h
+SRCS=	acphy.c amphy.c atphy.c axphy.c bmtphy.c brgphy.c
+SRCS+=	ciphy.c dp83822phy.c dp83867phy.c
 SRCS+=	e1000phy.c gentbi.c icsphy.c ip1000phy.c jmphy.c lxtphy.c
-SRCS+=	miibus_if.c miibus_if.h mii.c miidevs.h mii_bitbang.c mii_physubr.c
-SRCS+=	nsgphy.c nsphy.c nsphyter.c pci_if.h pnaphy.c qsphy.c
+SRCS+=	miibus_if.c mii.c mii_bitbang.c mii_physubr.c
+SRCS+=	nsgphy.c nsphy.c nsphyter.c pnaphy.c qsphy.c
 SRCS+=	rdcphy.c rgephy.c rlphy.c smcphy.c
 SRCS+=	smscphy.c tdkphy.c truephy.c
 SRCS+=	ukphy.c ukphy_subr.c
-SRCS+=	xmphy.c
+SRCS+=	vscphy.c xmphy.c
+SRCS+=	bus_if.h device_if.h miibus_if.h miidevs.h opt_platform.h pci_if.h
+
+.if !empty(OPT_FDT)
+SRCS+=	micphy.c mii_fdt.c
+SRCS+=	ofw_bus_if.h
+.endif
 
 EXPORT_SYMS=	YES