Page MenuHomeFreeBSD

D55977.id174514.diff
No OneTemporary

D55977.id174514.diff

diff --git a/sys/modules/ath10k/Makefile b/sys/modules/ath10k/Makefile
--- a/sys/modules/ath10k/Makefile
+++ b/sys/modules/ath10k/Makefile
@@ -3,11 +3,11 @@
.PATH: ${DEVATH10KDIR}
# Bus attachments.
-WITH_PCI= 1
-WITH_USB= 0 # Never finished upstream, not working.
+ATH10K_PCI= 1
+ATH10K_USB= 0 # Currently not working again, upstream kaputt.
-WITH_CONFIG_FWLOG= 1
-WITH_LEDS= 0
+ATH10K_CONFIG_FWLOG= 1
+ATH10K_LEDS= 0
KMOD= if_ath10k
@@ -17,31 +17,32 @@
SRCS+= p2p.c swap.c
# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
-.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
+.if defined(ATH10K_PCI) && ${ATH10K_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
SRCS+= pci.c
.endif
# USB parts; USB can be loaded and is unconditional on any kernel config.
-.if defined(WITH_USB) && ${WITH_USB} > 0
+.if defined(ATH10K_USB) && ${ATH10K_USB} > 0
SRCS+= usb.c
.endif
-# Other
-SRCS+= ${LINUXKPI_GENSRCS}
-SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
-
-.if defined(WITH_CONFIG_FWLOG) && ${WITH_CONFIG_FWLOG} > 0
+.if defined(ATH10K_CONFIG_FWLOG) && ${ATH10K_CONFIG_FWLOG} > 0
SRCS+= fwlog.c
-CFLAGS+= -DCONFIG_FWLOG=${WITH_CONFIG_FWLOG}
+CFLAGS+= -DCONFIG_FWLOG
.endif
-.if defined(WITH_LEDS) && ${WITH_LEDS} > 0
+.if defined(ATH10K_LEDS) && ${ATH10K_LEDS} > 0
CFLAGS+= -DCONFIG_ATH10K_LEDS
SRCS+= leds.c
.endif
-CFLAGS+= -DKBUILD_MODNAME='"ath10k"'
-CFLAGS+= -DLINUXKPI_VERSION=61900
+# Always on for now.
+CFLAGS+= -DCONFIG_ATH10K_DEBUG
+CFLAGS+= -DLINUXKPI_WANT_LINUX_ACPI
+
+# Other
+SRCS+= ${LINUXKPI_GENSRCS}
+SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
CFLAGS+= -I${DEVATH10KDIR}
CFLAGS+= -I${DEVATH10KDIR}/..
@@ -49,9 +50,7 @@
# Helpful after fresh imports.
#CFLAGS+= -ferror-limit=0
-CFLAGS+= -DCONFIG_ATH10K_DEBUG
-CFLAGS+= -DLINUXKPI_WANT_LINUX_ACPI
-
+# TODO: further options and SRCS files.
#CFLAGS+= -DCONFIG_ATH10K_AHB
#CFLAGS+= -DCONFIG_ATH10K_DEBUGFS
#CFLAGS+= -DCONFIG_ATH10K_DFS_CERTIFIED
@@ -65,4 +64,7 @@
#CFLAGS+= -DCONFIG_PM_SLEEP
#CFLAGS+= -DCONFIG_THERMAL
+CFLAGS+= -DKBUILD_MODNAME='"ath10k"'
+CFLAGS+= -DLINUXKPI_VERSION=61900
+
.include <bsd.kmod.mk>
diff --git a/sys/modules/ath11k/Makefile b/sys/modules/ath11k/Makefile
--- a/sys/modules/ath11k/Makefile
+++ b/sys/modules/ath11k/Makefile
@@ -2,6 +2,9 @@
.PATH: ${DEVATH11KDIR}
+ATH11K_PCI= 1
+ATH11K_AHB= 0
+
ATH11K_DEBUGFS= 0
ATH11K_TRACE= 0
ATH11K_THERMAL= 0
@@ -18,10 +21,15 @@
SRCS+= fw.c p2p.c
# PCI
+.if defined(ATH11K_PCI) && ${ATH11K_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
SRCS+= mhi.c pci.c
+CFLAGS+= -DCONFIG_ATH11K_PCI
+.endif
-# AHB
-#SRCS+= ahb.c
+.if defined(ATH11K_AHB) && ${ATH11K_AHB} > 0
+SRCS+= ahb.c
+CFLAGS+= -DCONFIG_ATH11K_AHB
+.endif
.if defined(ATH11K_DEBUGFS) && ${ATH11K_DEBUGFS} > 0
SRCS+= debugfs.c debugfs_htt_stats.c debugfs_sta.c
diff --git a/sys/modules/ath12k/Makefile b/sys/modules/ath12k/Makefile
--- a/sys/modules/ath12k/Makefile
+++ b/sys/modules/ath12k/Makefile
@@ -2,8 +2,10 @@
.PATH: ${DEVATH12KDIR}
-ATH12K_ACPI= 0
+ATH12K_PCI= 1
ATH12K_AHB= 0
+
+ATH12K_ACPI= 0
ATH12K_COREDUMP= 0
ATH12K_DEBUGFS= 0
ATH12K_PM= 0
@@ -16,7 +18,11 @@
SRCS+= dp.c dp_tx.c dp_rx.c dp_mon.c debug.c
SRCS+= ce.c peer.c dbring.c hw.c fw.c p2p.c
+.if defined(ATH12K_PCI) && ${ATH12K_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
SRCS+= mhi.c pci.c
+.else
+.error ath12k requires PCI support compiled in at this point
+.endif
.if defined(ATH12K_AHB) && ${ATH12K_AHB} > 0
CFLAGS+= -DCONFIG_ATH12K_AHB
diff --git a/sys/modules/athk_common/Makefile b/sys/modules/athk_common/Makefile
--- a/sys/modules/athk_common/Makefile
+++ b/sys/modules/athk_common/Makefile
@@ -4,19 +4,19 @@
KMOD= athk_common
-WITH_ATH_DEBUG= 1
-WITH_ATH_TRACEPOINTS= 0
+ATHK_COMMON_ATH_DEBUG= 1
+ATHK_COMMON_ATH_TRACEPOINTS= 0
SRCS= main.c
SRCS+= dfs_pattern_detector.c dfs_pri_detector.c
SRCS+= hw.c key.c regd.c
-.if defined(WITH_ATH_DEBUG) && ${WITH_ATH_DEBUG} > 0
+.if defined(ATHK_COMMON_ATH_DEBUG) && ${ATHK_COMMON_ATH_DEBUG} > 0
SRCS+= debug.c
CFLAGS+= -DCONFIG_ATH_DEBUG
.endif
-.if defined(WITH_ATH_TRACEPOINTS) && ${WITH_ATH_TRACEPOINTS} > 0
+.if defined(ATHK_COMMON_ATH_TRACEPOINTS) && ${ATHK_COMMON_ATH_TRACEPOINTS} > 0
SRCS+= trace.c
CFLAGS+= -DCONFIG_ATH_TRACEPOINTS
.endif
@@ -25,11 +25,12 @@
SRCS+= ${LINUXKPI_GENSRCS}
SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
-CFLAGS+= -DKBUILD_MODNAME='"athk_common"'
-
CFLAGS+= -I${DEVDIR}
CFLAGS+= ${LINUXKPI_INCLUDES}
# Helpful after fresh imports.
#CFLAGS+= -ferror-limit=0
+CFLAGS+= -DKBUILD_MODNAME='"athk_common"'
+CFLAGS+= -DLINUXKPI_VERSION=61900
+
.include <bsd.kmod.mk>
diff --git a/sys/modules/brcm80211/brcmfmac/Makefile b/sys/modules/brcm80211/brcmfmac/Makefile
--- a/sys/modules/brcm80211/brcmfmac/Makefile
+++ b/sys/modules/brcm80211/brcmfmac/Makefile
@@ -3,14 +3,16 @@
.PATH: ${DEVDIR}
# Should split this up into a core driver and 3 more
-WITH_PCI=1
-WITH_SDIO=0
-WITH_USB=0
+BRCMFMAC_PCI= 1
+BRCMFMAC_USB= 0
+BRCMFMAC_SDIO= 0
-WITH_DMI=0
-WITH_OF=0
-WITH_DEBUG=1
-WITH_TRACING=0 # ftrace probes; simple enough to change possibly; keep 0!
+BRCMFMAC_PROTO_BCDC= 0 # SDIO, USB -- do not set manually
+BRCMFMAC_DEBUG= 1
+BRCMFMAC_TRACING= 0 # ftrace probes; simple enough to change possibly; keep 0!
+BRCMFMAC_OF= 0
+BRCMFMAC_DMI= 0
+BRCMFMAC_ACPI= 0
KMOD= if_brcmfmac
@@ -21,46 +23,57 @@
SRCS+= wcc/core.c cyw/core.c bca/core.c
# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
-.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
-SRCS+= pcie.c msgbuf.c commonring.c flowring.c
-CFLAGS+= -DCONFIG_BRCMFMAC_PCIE=1
+.if defined(BRCMFMAC_PCI) && ${BRCMFMAC_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
+SRCS+= pcie.c
+CFLAGS+= -DCONFIG_BRCMFMAC_PCIE
+SRCS+= msgbuf.c commonring.c flowring.c
+CFLAGS+= -DCONFIG_BRCMFMAC_PROTO_MSGBUF
.endif
# SDIO parts; SDIO depends on an MMCCAM kernel.
-.if defined(WITH_SDIO) && ${WITH_SDIO} > 0 && ${KERN_OPTS:MMMCCAM}
+.if defined(BRCMFMAC_SDIO) && ${BRCMFMAC_SDIO} > 0 && ${KERN_OPTS:MMMCCAM}
SRCS+= sdio.c bcmsdh.c
SRCS+= sdio_if.h
SRCS+= sdiodevs.h
-CFLAGS+= -DCONFIG_BRCMFMAC_SDIO=1
+CFLAGS+= -DCONFIG_BRCMFMAC_SDIO
+BRCMFMAC_PROTO_BCDC= 1
.endif
# USB parts; USB can be loaded and is unconditional on any kernel config.
-.if defined(WITH_USB) && ${WITH_USB} > 0
+.if defined(BRCMFMAC_USB) && ${BRCMFMAC_USB} > 0
SRCS+= usb.c
-CFLAGS+= -DCONFIG_BRCMFMAC_USB=1
+CFLAGS+= -DCONFIG_BRCMFMAC_USB
+BRCMFMAC_PROTO_BCDC= 1
.endif
-.if (defined(WITH_SDIO) && ${WITH_SDIO} > 0) || \
- (defined(WITH_USB) && ${WITH_USB} > 0)
-CFLAGS+= -DCONFIG_BRCMFMAC_PROTO_BCDC=1
+.if defined(BRCMFMAC_PROTO_BCDC) && ${BRCMFMAC_PROTO_BCDC} > 0
+CFLAGS+= -DCONFIG_BRCMFMAC_PROTO_BCDC
SRCS+= bcdc.c fwsignal.c
.endif
-.if defined(WITH_DMI) && ${WITH_DMI} > 0
-SRCS+= dmi.c
+.if defined(BRCMFMAC_DEBUG) && ${BRCMFMAC_DEBUG} > 0
+CFLAGS+= -DDEBUG -DCONFIG_BRCMDBG
+SRCS+= debug.c
.endif
-.if defined(WITH_OF) && ${WITH_OF} > 0
+.if defined(BRCMFMAC_TRACING) && ${BRCMFMAC_TRACING} > 0
+SRCS+= tracepoint.c
+CFLAGS+= -DCONFIG_BRCM_TRACING
+.endif
+
+.if defined(BRCMFMAC_OF) && ${BRCMFMAC_OF} > 0
SRCS+= of.c
+CFLAGS+= -DCONFIG_OF
.endif
-.if defined(WITH_DEBUG) && ${WITH_DEBUG} > 0
-CFLAGS+= -DDEBUG=${WITH_DEBUG}
-SRCS+= debug.c
+.if defined(BRCMFMAC_DMI) && ${BRCMFMAC_DMI} > 0
+SRCS+= dmi.c
+CFLAGS+= -DCONFIG_DMI
.endif
-.if defined(WITH_TRACING) && ${WITH_TRACING} > 0
-SRCS+= tracepoint.c
+.if defined(BRCMFMAC_ACPI) && ${BRCMFMAC_ACPI} > 0
+SRCS+= acpi.c
+CFLAGS+= -DCONFIG_ACPI
.endif
# Other
@@ -68,25 +81,18 @@
SRCS+= ${LINUXKPI_GENSRCS}
SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
-CFLAGS+= -DKBUILD_MODNAME='"brcmfmac"'
-CFLAGS+= -DLINUXKPI_VERSION=61700
-
CFLAGS+= -I${DEVDIR}
CFLAGS+= -I${DEVDIR}/../include
CFLAGS+= ${LINUXKPI_INCLUDES}
-CFLAGS+= -ferror-limit=0
-
-#CFLAGS+= -DCONFIG_BRCM_TRACING=${WITH_TRACING}
-CFLAGS+= -DCONFIG_BRCMFMAC_PROTO_MSGBUF=${WITH_PCI}
-CFLAGS+= -DCONFIG_BRCMDBG=${WITH_DEBUG}
-
-#CFLAGS+= -DCONFIG_DMI=${WITH_DMI}
-#CFLAGS+= -DCONFIG_OF=${WITH_OF}
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
#CFLAGS+= -DCONFIG_PM_SLEEP=
-#CFLAGS+= -DCONFIG_ACPI=0
#CFLAGS+= -DCONFIG_PM
#CFLAGS+= -DCONFIG_IPV6=0
+CFLAGS+= -DKBUILD_MODNAME='"brcmfmac"'
+CFLAGS+= -DLINUXKPI_VERSION=61900
+
.include <bsd.kmod.mk>
diff --git a/sys/modules/brcm80211/brcmutil/Makefile b/sys/modules/brcm80211/brcmutil/Makefile
--- a/sys/modules/brcm80211/brcmutil/Makefile
+++ b/sys/modules/brcm80211/brcmutil/Makefile
@@ -2,27 +2,27 @@
.PATH: ${DEVDIR}
-WITH_DEBUG=1
+BRCMUTIL_DEBUG= 1
KMOD= brcmutil
SRCS= d11.c utils.c
+.if defined(BRCMUTIL_DEBUG) && ${BRCMUTIL_DEBUG} > 0
+CFLAGS+= -DDEBUG
+.endif
+
# Other
SRCS+= ${LINUXKPI_GENSRCS}
SRCS+= bus_if.h device_if.h pci_if.h vnode_if.h
SRCS+= opt_wlan.h opt_inet6.h opt_inet.h
-CFLAGS+= -DKBUILD_MODNAME='"brcmutil"'
-CFLAGS+= -DLINUXKPI_VERSION=61700
-
-.if defined(WITH_DEBUG) && ${WITH_DEBUG} > 0
-CFLAGS+= -DDEBUG=${WITH_DEBUG}
-.endif
-
CFLAGS+= -I${DEVDIR}
CFLAGS+= -I${DEVDIR}/../include
CFLAGS+= ${LINUXKPI_INCLUDES}
#CFLAGS+= -ferror-limit=0
+CFLAGS+= -DKBUILD_MODNAME='"brcmutil"'
+CFLAGS+= -DLINUXKPI_VERSION=61900
+
.include <bsd.kmod.mk>
diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile
--- a/sys/modules/iwlwifi/Makefile
+++ b/sys/modules/iwlwifi/Makefile
@@ -4,10 +4,10 @@
.PATH: ${DEVIWLWIFIDIR}
-WITH_CONFIG_PM= 0
-WITH_DEBUGFS= 0
+IWLWIFI_CONFIG_PM= 0
+IWLWIFI_DEBUGFS= 0
.if ${KERN_OPTS:MDEV_ACPI}
-WITH_CONFIG_ACPI= 1
+IWLWIFI_CONFIG_ACPI= 1
.endif
KMOD= if_iwlwifi
@@ -49,21 +49,21 @@
SRCS+= mld/session-protect.c mld/sta.c mld/stats.c mld/thermal.c
SRCS+= mld/time_sync.c mld/tlc.c mld/tx.c
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+.if defined(IWLWIFI_DEBUGFS) && ${IWLWIFI_DEBUGFS} > 0
SRCS+= fw/debugfs.c
SRCS+= mvm/debugfs.c mvm/debugfs-vif.c
SRCS+= mld/debugfs.c
CFLAGS+= -DCONFIG_IWLWIFI_DEBUGFS
CFLAGS+= -DCONFIG_MAC80211_DEBUGFS
.endif
-.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
+.if defined(IWLWIFI_CONFIG_PM) && ${IWLWIFI_CONFIG_PM} > 0
SRCS+= mvm/d3.c
SRCS+= mld/d3.c
CFLAGS+= -DCONFIG_PM
CFLAGS+= -DCONFIG_PM_SLEEP
.endif
-.if defined(WITH_CONFIG_ACPI) && ${WITH_CONFIG_ACPI} > 0
+.if defined(IWLWIFI_CONFIG_ACPI) && ${IWLWIFI_CONFIG_ACPI} > 0
SRCS.DEV_ACPI+= fw/acpi.c
CFLAGS+= -DCONFIG_ACPI
.endif
@@ -74,9 +74,6 @@
SRCS+= ${LINUXKPI_GENSRCS}
SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
-CFLAGS+= -DKBUILD_MODNAME='"iwlwifi"'
-CFLAGS+= -DLINUXKPI_VERSION=61700
-
CFLAGS+= -I${DEVIWLWIFIDIR}
CFLAGS+= ${LINUXKPI_INCLUDES}
CFLAGS+= -DCONFIG_IWLDVM=0
@@ -96,6 +93,9 @@
#CFLAGS+= -DCONFIG_THERMAL=1
#CFLAGS+= -DCONFIG_EFI=1
+CFLAGS+= -DKBUILD_MODNAME='"iwlwifi"'
+CFLAGS+= -DLINUXKPI_VERSION=61900
+
CWARNFLAGS.clang.drv.c+= -Wno-initializer-overrides
CWARNFLAGS.drv.c+= -Wno-override-init ${CWARNFLAGS.${COMPILER_TYPE}.${.IMPSRC:T}}
diff --git a/sys/modules/mt76/Makefile b/sys/modules/mt76/Makefile
--- a/sys/modules/mt76/Makefile
+++ b/sys/modules/mt76/Makefile
@@ -1,8 +1,14 @@
+.include <kmod.opts.mk>
+
SUBDIR= core
SUBDIR+= mt7615
+.if ${KERN_OPTS:MDEV_PCI}
SUBDIR+= mt7915
+.endif
SUBDIR+= mt7921
SUBDIR+= mt7925
+.if ${KERN_OPTS:MDEV_PCI}
SUBDIR+= mt7996
+.endif
.include <bsd.subdir.mk>
diff --git a/sys/modules/mt76/Makefile.inc b/sys/modules/mt76/Makefile.inc
--- a/sys/modules/mt76/Makefile.inc
+++ b/sys/modules/mt76/Makefile.inc
@@ -1,16 +1,21 @@
# Common information shared by all submodule builds.
COMMONDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76
+DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/${MT76_DRIVER_NAME}
-# Bus attachments.
-WITH_PCI= 1
-WITH_USB= 0
-WITH_SDIO= 0
+KMOD?= if_${MT76_DRIVER_NAME}
-# Options.
-WITH_CONFIG_PM= 0
-WITH_DEBUGFS= 0
-WITH_SOC_WED= 0
+# Bus attachment for the core part and that each driver can check
+# what the common code supports.
+MT76_PCI= 1
+MT76_SDIO= 0
+MT76_USB= 0
+
+# General options for common code so drivers can check.
+MT76_ACPI?= 0
+MT76_CONFIG_PM?= 0
+MT76_DEBUGFS?= 0
+MT76_SOC_WED?= 0
# Other
SRCS+= ${LINUXKPI_GENSRCS}
@@ -19,23 +24,26 @@
# This is true for all architectures we build for.
CFLAGS+= -DCONFIG_ARCH_DMA_ADDR_T_64BIT
-# Helpful after fresh imports.
-#CFLAGS+= -ferror-limit=0
-
-.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
-CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM}
+.if defined(MT76_CONFIG_PM) && ${MT76_CONFIG_PM} > 0
+CFLAGS+= -DCONFIG_PM
.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
-CFLAGS+= -DCONFIG_MAC80211_DEBUGFS=${WITH_DEBUGFS}
+.if defined(MT76_DEBUGFS) && ${MT76_DEBUGFS} > 0
+CFLAGS+= -DCONFIG_MAC80211_DEBUGFS
.endif
-.if defined(WITH_SOC_WED) && ${WITH_SOC_WED} > 0
-CFLAGS+= CONFIG_NET_MEDIATEK_SOC_WED
+.if defined(MT76_SOC_WED) && ${MT76_SOC_WED} > 0
+CFLAGS+= -DCONFIG_NET_MEDIATEK_SOC_WED
.endif
CFLAGS+= -I${COMMONDIR}
+.if ${MT76_DRIVER_NAME} != "mt76_core"
+CFLAGS+= -I${DEVDIR}
+.endif
CFLAGS+= ${LINUXKPI_INCLUDES}
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
+
+CFLAGS+= -DKBUILD_MODNAME='"${MT76_DRIVER_NAME}"'
CFLAGS+= -DLINUXKPI_VERSION=61900
-# end
diff --git a/sys/modules/mt76/core/Makefile b/sys/modules/mt76/core/Makefile
--- a/sys/modules/mt76/core/Makefile
+++ b/sys/modules/mt76/core/Makefile
@@ -1,25 +1,30 @@
+MT76_DRIVER_NAME= mt76_core
+
.include <kmod.opts.mk>
-.PATH: ${COMMONDIR}
+KMOD= ${MT76_DRIVER_NAME}
-KMOD= mt76_core
+.PATH: ${COMMONDIR}
# Basic stuff.
-SRCS= mac80211.c mmio.c util.c dma.c eeprom.c tx.c agg-rx.c mcu.c
+SRCS+= mac80211.c mmio.c util.c dma.c eeprom.c tx.c agg-rx.c mcu.c
SRCS+= channel.c scan.c wed.c
-#SRCS+= trace.c
-# Bus stuff.
# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
-.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
+.if defined(MT76_PCI) && ${MT76_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
SRCS+= pci.c
.endif
-.if defined(WITH_USB) && ${WITH_USB} > 0
-SRCS+= usb.c # usb_trace.c
+# SDIO parts; SDIO depends on an MMCCAM kernel.
+.if defined(MT76_SDIO) && ${MT76_SDIO} > 0 && ${KERN_OPTS:MMMCCAM}
+SRCS+= sdio.c sdio_txrx.c
.endif
-#SRCS+= sdio.c sdio_txrx.c
+# USB parts; USB can be loaded and is unconditional on any kernel config.
+.if defined(MT76_USB) && ${MT76_USB} > 0
+SRCS+= usb.c
+#SRCS+= usb_trace.c
+.endif
# Connac-Lib stuff.
SRCS+= mt76_connac_mac.c mt76_connac_mcu.c mt76_connac3_mac.c
@@ -30,22 +35,21 @@
# MT792X-LIB stuff.
SRCS+= mt792x_core.c mt792x_mac.c mt792x_dma.c
#SRCS+= mt792x_trace.c
-.if defined(WITH_ACPI) && ${WITH_ACPI} > 0
+.if defined(MT76_ACPI) && ${MT76_ACPI} > 0
SRCS+= mt792x_acpi_sar.c
.endif
-.if defined(WITH_USB) && ${WITH_USB} > 0
+.if defined(MT76_USB) && ${MT76_USB} > 0
SRCS+= mt792x_usb.c
.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+.if defined(MT76_DEBUGFS) && ${MT76_DEBUGFS} > 0
SRCS+= mt792x_debugfs.c
.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+.if defined(MT76_DEBUGFS) && ${MT76_DEBUGFS} > 0
SRCS+= debugfs.c
.endif
-CFLAGS+= -DKBUILD_MODNAME='"mt76_core"'
-CFLAGS+= -DCONFIG_MAC80211_DEBUGFS=${WITH_DEBUGFS}
+#SRCS+= trace.c
EXPORT_SYMS= YES
diff --git a/sys/modules/mt76/mt7615/Makefile b/sys/modules/mt76/mt7615/Makefile
--- a/sys/modules/mt76/mt7615/Makefile
+++ b/sys/modules/mt76/mt7615/Makefile
@@ -1,26 +1,31 @@
-DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7615
+MT76_DRIVER_NAME= mt7615
+
+.include <kmod.opts.mk>
.PATH: ${DEVDIR}
-WITH_DEBUGFS= 0
-WITH_DEV_COREDUMP= 0
+MT7615_PCI= 1
-KMOD= if_mt7615
+MT7615_DEBUGFS= 0
+MT7615_DEV_COREDUMP= 0
# Common stuff.
-SRCS= init.c main.c mac.c mcu.c eeprom.c
+SRCS+= init.c main.c mac.c mcu.c eeprom.c
# PCIe (7622_WMAC ignored)
+.if defined(MT76_PCI) && ${MT76_PCI} > 0 && ${KERN_OPTS:MDEV_PCI} && \
+ defined(MT7615_PCI) && ${MT7615_PCI} > 0
SRCS+= dma.c mmio.c pci.c pci_init.c pci_mac.c
+.endif
# USB + SDIO ignored currently.
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+.if defined(MT7615_DEBUGFS) && ${MT7615_DEBUGFS} > 0
SRCS+= debugfs.c
-CFLAGS+= -DCONFIG_MT7915_DEBUGFS=${WITH_DEBUGFS}
+CFLAGS+= -DCONFIG_MT7915_DEBUGFS
.endif
-CFLAGS+= -DKBUILD_MODNAME='"mt7615"'
-CFLAGS+= -I${DEVDIR}
+.if defined(MT7615_DEV_COREDUMP) && ${MT7615_DEV_COREDUMP} > 0
+.endif
.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/mt7915/Makefile b/sys/modules/mt76/mt7915/Makefile
--- a/sys/modules/mt76/mt7915/Makefile
+++ b/sys/modules/mt76/mt7915/Makefile
@@ -1,30 +1,37 @@
-DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7915
+MT76_DRIVER_NAME= mt7915
+
+.include <kmod.opts.mk>
.PATH: ${DEVDIR}
-WITH_DEBUGFS= 0
-WITH_DEV_COREDUMP= 1
+MT7915_PCI= 1
+
+MT7915_WMAC= 0
+MT7915_DEBUGFS= 0
+MT7915_DEV_COREDUMP= 1
-KMOD= if_mt7915
+SRCS+= init.c main.c mac.c mcu.c mmio.c eeprom.c
-# Common stuff.
-SRCS= init.c main.c mac.c mcu.c mmio.c eeprom.c
+# PCI only driver so it better be there (otherwise nothing will attach at least).
+.if defined(MT76_PCI) && ${MT76_PCI} > 0 && ${KERN_OPTS:MDEV_PCI} && \
+ defined(MT7915_PCI) && ${MT7915_PCI} > 0
SRCS+= pci.c dma.c
+.endif
# SOC+6E stuff.
-#SRCS+= soc.c
+.if defined(MT7915_WMAC) && ${MT7915_WMAC} > 0
+SRCS+= soc.c
+CFLAGS+= -DCONFIG_MT798X_WMAC
+.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+.if defined(MT7915_DEBUGFS) && ${MT7915_DEBUGFS} > 0
SRCS+= debugfs.c
-CFLAGS+= -DCONFIG_MT7915_DEBUGFS=${WITH_DEBUGFS}
+CFLAGS+= -DCONFIG_MT7915_DEBUGFS
.endif
-.if defined(WITH_DEV_COREDUMP) && ${WITH_DEV_COREDUMP} > 0
+.if defined(MT7915_DEV_COREDUMP) && ${MT7915_DEV_COREDUMP} > 0
SRCS+= coredump.c
-CFLAGS+= -DCONFIG_DEV_COREDUMP=${WITH_DEV_COREDUMP}
+CFLAGS+= -DCONFIG_DEV_COREDUMP
.endif
-CFLAGS+= -DKBUILD_MODNAME='"mt7915"'
-CFLAGS+= -I${DEVDIR}
-
.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/mt7921/Makefile b/sys/modules/mt76/mt7921/Makefile
--- a/sys/modules/mt76/mt7921/Makefile
+++ b/sys/modules/mt76/mt7921/Makefile
@@ -1,35 +1,39 @@
-.include <kmod.opts.mk>
+MT76_DRIVER_NAME= mt7921
-DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7921
+.include <kmod.opts.mk>
.PATH: ${DEVDIR}
-KMOD= if_mt7921
+MT7921_PCI= 1
+MT7921_SDIO= 0
+MT7921_USB= 0
+
+MT7921_DEBUGFS= 0
# Common stuff.
-SRCS= init.c main.c mac.c mcu.c
+SRCS+= init.c main.c mac.c mcu.c
# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
-.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
+.if defined(MT76_PCI) && ${MT76_PCI} > 0 && ${KERN_OPTS:MDEV_PCI} && \
+ defined(MT7921_PCI) && ${MT7921_PCI} > 0
SRCS+= pci.c pci_mac.c pci_mcu.c
.endif
-# USB parts; USB can be loaded and is unconditional on any kernel config.
-.if defined(WITH_USB) && ${WITH_USB} > 0
-SRCS+= usb.c
-.endif
-
# SDIO parts; SDIO depends on an MMCCAM kernel.
-.if defined(WITH_SDIO) && ${WITH_SDIO} > 0 && ${KERN_OPTS:MMMCCAM}
+.if defined(MT76_SDIO) && ${MT76_SDIO} > 0 && ${KERN_OPTS:MMMCCAM} && \
+ defined(MT7921_SDIO) && ${MT7921_SDIO} > 0
SRCS+= sdio.c sdio_mac.c sdio_mcu.c
.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
-SRCS+= debugfs.c
-CFLAGS+= -DCONFIG_MT7921_DEBUGFS=${WITH_DEBUGFS}
+# USB parts; USB can be loaded and is unconditional on any kernel config.
+.if defined(MT76_USB) && ${MT76_USB} > 0 && \
+ defined(MT7921_USB) && ${MT7921_USB} > 0
+SRCS+= usb.c
.endif
-CFLAGS+= -DKBUILD_MODNAME='"mt7921"'
-CFLAGS+= -I${DEVDIR}
+.if defined(MT7921_DEBUGFS) && ${MT7921_DEBUGFS} > 0
+SRCS+= debugfs.c
+CFLAGS+= -DCONFIG_MT7921_DEBUGFS
+.endif
.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/mt7925/Makefile b/sys/modules/mt76/mt7925/Makefile
--- a/sys/modules/mt76/mt7925/Makefile
+++ b/sys/modules/mt76/mt7925/Makefile
@@ -1,30 +1,32 @@
-.include <kmod.opts.mk>
+MT76_DRIVER_NAME= mt7925
-DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7925
+.include <kmod.opts.mk>
.PATH: ${DEVDIR}
-KMOD= if_mt7925
+MT7925_PCI= 1
+MT7925_USB= 1
+
+MT7925_DEBUGFS= 0
# Common stuff.
-SRCS= init.c main.c mac.c mcu.c regd.c
+SRCS+= init.c main.c mac.c mcu.c regd.c
# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
-.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
+.if defined(MT76_PCI) && ${MT76_PCI} > 0 && ${KERN_OPTS:MDEV_PCI} && \
+ defined(MT7925_PCI) && ${MT7925_PCI} > 0
SRCS+= pci.c pci_mac.c pci_mcu.c
.endif
# USB parts; USB can be loaded and is unconditional on any kernel config.
-.if defined(WITH_USB) && ${WITH_USB} > 0
+.if defined(MT76_USB) && ${MT76_USB} > 0 && \
+ defined(MT7925_USB) && ${MT7925_USB} > 0
SRCS+= usb.c
.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+.if defined(MT7925_DEBUGFS) && ${MT7925_DEBUGFS} > 0
SRCS+= debugfs.c
-CFLAGS+= -DCONFIG_MT7925_DEBUGFS=${WITH_DEBUGFS}
+CFLAGS+= -DCONFIG_MT7925_DEBUGFS
.endif
-CFLAGS+= -DKBUILD_MODNAME='"mt7925"'
-CFLAGS+= -I${DEVDIR}
-
.include <bsd.kmod.mk>
diff --git a/sys/modules/mt76/mt7996/Makefile b/sys/modules/mt76/mt7996/Makefile
--- a/sys/modules/mt76/mt7996/Makefile
+++ b/sys/modules/mt76/mt7996/Makefile
@@ -1,27 +1,36 @@
-DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7996
+MT76_DRIVER_NAME= mt7996
+
+.include <kmod.opts.mk>
.PATH: ${DEVDIR}
-WITH_DEBUGFS= 0
-WITH_DEV_COREDUMP= 1
+MT7996_PCI= 1
-KMOD= if_mt7996
+MT7996_DEBUGFS= 0
+MT7996_DEV_COREDUMP= 1
+MT7996_NPU= 0
# Common stuff.
-SRCS= init.c main.c mac.c mcu.c mmio.c eeprom.c
+SRCS+= init.c main.c mac.c mcu.c mmio.c eeprom.c
+# PCI only driver so it better be there (otherwise nothing will attach at least).
+.if defined(MT76_PCI) && ${MT76_PCI} > 0 && ${KERN_OPTS:MDEV_PCI} && \
+ defined(MT7996_PCI) && ${MT7996_PCI} > 0
SRCS+= pci.c dma.c
+.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
+.if defined(MT7996_DEBUGFS) && ${MT7996_DEBUGFS} > 0
SRCS+= debugfs.c
-CFLAGS+= -DCONFIG_MT7996_DEBUGFS=${WITH_DEBUGFS}
+CFLAGS+= -DCONFIG_MT7996_DEBUGFS
.endif
-.if defined(WITH_DEV_COREDUMP) && ${WITH_DEV_COREDUMP} > 0
+.if defined(MT7996_DEV_COREDUMP) && ${MT7996_DEV_COREDUMP} > 0
SRCS+= coredump.c
-CFLAGS+= -DCONFIG_DEV_COREDUMP=${WITH_DEV_COREDUMP}
+CFLAGS+= -DCONFIG_DEV_COREDUMP
.endif
-CFLAGS+= -DKBUILD_MODNAME='"mt7996"'
-CFLAGS+= -I${DEVDIR}
+.if defined(MT7996_NPU) && ${MT7996_NPU} > 0
+SRCS+= npu.c
+CFLAGS+= -DCONFIG_MT7996_NPU
+.endif
.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile
--- a/sys/modules/rtw88/Makefile
+++ b/sys/modules/rtw88/Makefile
@@ -5,14 +5,14 @@
.PATH: ${DEVRTW88DIR}
# Bus attachments.
-WITH_PCI= 1
-WITH_USB= 0
-WITH_SDIO= 0
+RTW88_PCI= 1
+RTW88_SDIO= 0
+RTW88_USB= 0
# Options.
-WITH_CONFIG_PM= 0
-WITH_DEBUGFS= 1
-WITH_LEDS= 0
+RTW88_CONFIG_PM= 0
+RTW88_DEBUGFS= 1
+RTW88_LEDS= 0
KMOD= if_rtw88
@@ -22,11 +22,6 @@
SRCS+= phy.c ps.c regd.c
SRCS+= rx.c sar.c sec.c tx.c util.c
-.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
-SRCS+= wow.c
-CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM}
-.endif
-
# Common
SRCS+= rtw8723x.c # 87x3 common
SRCS+= rtw8703b.c rtw8703b_tables.c # 11n
@@ -37,7 +32,7 @@
SRCS+= rtw8822c.c rtw8822c_table.c # 11ac
# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
-.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
+.if defined(RTW88_PCI) && ${RTW88_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
SRCS+= pci.c
SRCS+= rtw8723de.c
SRCS+= rtw8814ae.c
@@ -46,8 +41,17 @@
SRCS+= rtw8822ce.c
.endif
+# SDIO parts; SDIO depends on an MMCCAM kernel.
+.if defined(RTW88_SDIO) && ${RTW88_SDIO} > 0 && ${KERN_OPTS:MMMCCAM}
+SRCS+= rtw8723cs.c
+SRCS+= rtw8723ds.c
+SRCS+= rtw8821cs.c
+SRCS+= rtw8822bs.c
+SRCS+= rtw8822cs.c
+.endif
+
# USB parts; USB can be loaded and is unconditional on any kernel config.
-.if defined(WITH_USB) && ${WITH_USB} > 0
+.if defined(RTW88_USB) && ${RTW88_USB} > 0
SRCS+= usb.c
SRCS+= rtw8723du.c
SRCS+= rtw88xxa.c # 88xxa common
@@ -57,41 +61,35 @@
SRCS+= rtw8821cu.c
SRCS+= rtw8822bu.c
SRCS+= rtw8822cu.c
-
CFLAGS+= -DCONFIG_RTW88_USB
.endif
-# SDIO parts; SDIO depends on an MMCCAM kernel.
-.if defined(WITH_SDIO) && ${WITH_SDIO} > 0 && ${KERN_OPTS:MMMCCAM}
-SRCS+= rtw8723cs.c
-SRCS+= rtw8723ds.c
-SRCS+= rtw8821cs.c
-SRCS+= rtw8822bs.c
-SRCS+= rtw8822cs.c
+.if defined(RTW88_CONFIG_PM) && ${RTW88_CONFIG_PM} > 0
+SRCS+= wow.c
+CFLAGS+= -DCONFIG_PM=${RTW88_CONFIG_PM}
.endif
-.if defined(WITH_LEDS) && ${WITH_LEDS} > 0
-CFLAGS+= -DCONFIG_RTW88_LEDS
-SRCS+= led.c
+.if defined(RTW88_DEBUGFS) && ${RTW88_DEBUGFS} > 0
+CFLAGS+= -DCONFIG_RTW88_DEBUGFS
.endif
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
-CFLAGS+= -DCONFIG_RTW88_DEBUGFS
+.if defined(RTW88_LEDS) && ${RTW88_LEDS} > 0
+CFLAGS+= -DCONFIG_RTW88_LEDS
+SRCS+= led.c
.endif
# Other
SRCS+= opt_wlan.h opt_inet6.h opt_inet.h
SRCS+= ${LINUXKPI_GENSRCS}
+CFLAGS+= -I${DEVRTW88DIR}
CFLAGS+= ${LINUXKPI_INCLUDES}
+# Helpful after fresh imports.
+#CFLAGS+= -ferror-limit=0
-CFLAGS+= -I${DEVRTW88DIR}
CFLAGS+= -DCONFIG_RTW88_DEBUG
CFLAGS+= -DKBUILD_MODNAME='"rtw88"'
CFLAGS+= -DLINUXKPI_VERSION=61900
-# Helpful after fresh imports.
-#CFLAGS+= -ferror-limit=0
-
.include <bsd.kmod.mk>
diff --git a/sys/modules/rtw89/Makefile b/sys/modules/rtw89/Makefile
--- a/sys/modules/rtw89/Makefile
+++ b/sys/modules/rtw89/Makefile
@@ -5,15 +5,15 @@
.PATH: ${DEVRTW89DIR}
# Bus attachments.
-WITH_PCI= 1
-WITH_USB= 0
-WITH_SDIO= 0
+RTW89_PCI= 1
+RTW89_SDIO= 0
+RTW89_USB= 0
# Options.
-WITH_CONFIG_PM= 0
-WITH_DEBUGFS= 0
+RTW89_CONFIG_PM= 0
+RTW89_DEBUGFS= 0
.if ${KERN_OPTS:MDEV_ACPI}
-WITH_CONFIG_ACPI= 1
+RTW89_CONFIG_ACPI= 1
.endif
KMOD= if_rtw89
@@ -33,15 +33,8 @@
SRCS+= rtw8852c.c rtw8852c_rfk.c rtw8852c_rfk_table.c rtw8852c_table.c
SRCS+= rtw8922a.c rtw8922a_rfk.c
-.if defined(WITH_CONFIG_ACPI) && ${WITH_CONFIG_ACPI} > 0
-SRCS.DEV_ACPI+= acpi.c
-CFLAGS+= -DCONFIG_ACPI
-.endif
-# This needs to always stay on for the LinuxKPI header file.
-CFLAGS+= -DLINUXKPI_WANT_LINUX_ACPI
-
# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
-.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
+.if defined(RTW89_PCI) && ${RTW89_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
SRCS+= pci.c pci_be.c
SRCS+= rtw8851be.c
SRCS+= rtw8852ae.c
@@ -52,7 +45,7 @@
.endif
# USB parts; USB can be loaded and is unconditional on any kernel config.
-.if defined(WITH_USB) && ${WITH_USB} > 0
+.if defined(RTW89_USB) && ${RTW89_USB} > 0
SRCS+= usb.c
SRCS+= rtw8851bu.c
SRCS+= rtw8852au.c
@@ -60,28 +53,36 @@
SRCS+= rtw8852cu.c
.endif
-# CONFIG_RTW89_DEBUG (always on for now)
-SRCS+= debug.c
-
-.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
-CFLAGS+= -DCONFIG_PM=${WITH_CONFIG_PM}
+.if defined(RTW89_CONFIG_PM) && ${RTW89_CONFIG_PM} > 0
+CFLAGS+= -DCONFIG_PM=${RTW89_CONFIG_PM}
SRCS+= wow.c
.endif
+.if defined(RTW89_DEBUGFS) && ${RTW89_DEBUGFS} > 0
+CFLAGS+= -DCONFIG_RTW89_DEBUGFS
+.endif
+
+.if defined(RTW89_CONFIG_ACPI) && ${RTW89_CONFIG_ACPI} > 0
+SRCS.DEV_ACPI+= acpi.c
+CFLAGS+= -DCONFIG_ACPI
+.endif
+# This needs to always stay on for the LinuxKPI header file.
+CFLAGS+= -DLINUXKPI_WANT_LINUX_ACPI
+
+# CONFIG_RTW89_DEBUG (always on for now)
+SRCS+= debug.c
+CFLAGS+= -DCONFIG_RTW89_DEBUGMSG
+
# Other
SRCS+= ${LINUXKPI_GENSRCS}
SRCS+= opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
-CFLAGS+= -DKBUILD_MODNAME='"rtw89"'
-CFLAGS+= -DLINUXKPI_VERSION=61900
-
CFLAGS+= -I${DEVRTW89DIR}
CFLAGS+= ${LINUXKPI_INCLUDES}
-CFLAGS+= -DCONFIG_RTW89_DEBUGMSG
-.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
-CFLAGS+= -DCONFIG_RTW89_DEBUGFS
-.endif
-
+# Helpful after fresh imports.
#CFLAGS+= -ferror-limit=0 -fmacro-backtrace-limit=0
+CFLAGS+= -DKBUILD_MODNAME='"rtw89"'
+CFLAGS+= -DLINUXKPI_VERSION=61900
+
.include <bsd.kmod.mk>

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 20, 3:40 AM (10 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31818242
Default Alt Text
D55977.id174514.diff (27 KB)

Event Timeline