it 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+= fweh.c fwil.c fwvid.c p2p.c pno.c proto.c vendor.c xtlv.c 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+= bus_if.h device_if.h pci_if.h vnode_if.h 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 diff --git a/sys/modules/brcm80211/brcmutil/Makefile b/sys/modules/brcm80211/brcmutil/Makefile index 3fc01f4894fd..7ef89be18bf9 100644 --- a/sys/modules/brcm80211/brcmutil/Makefile +++ b/sys/modules/brcm80211/brcmutil/Makefile @@ -2,27 +2,27 @@ DEVDIR= ${SRCTOP}/sys/contrib/dev/broadcom/brcm80211/brcmutil .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 diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile index b5441744d77a..399e35b79d61 100644 --- a/sys/modules/iwlwifi/Makefile +++ b/sys/modules/iwlwifi/Makefile @@ -4,10 +4,10 @@ DEVIWLWIFIDIR= ${SRCTOP}/sys/contrib/dev/iwlwifi .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/regulatory.c mld/roc.c mld/rx.c mld/scan.c 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 @@ CFLAGS+= -DLINUXKPI_WANT_LINUX_ACPI 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_IWLWIFI_DEVICE_TRACING=1 #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 index 5abae4c5ad7c..726f7759e9be 100644 --- a/sys/modules/mt76/Makefile +++ b/sys/modules/mt76/Makefile @@ -1,8 +1,14 @@ +.include + 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 diff --git a/sys/modules/mt76/Makefile.inc b/sys/modules/mt76/Makefile.inc index 41b18651e985..b44dcd2e2e82 100644 --- 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 @@ SRCS+= opt_wlan.h opt_inet6.h opt_inet.h # 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 index f2aec9dfcf4c..e4e65d8e3c24 100644 --- a/sys/modules/mt76/core/Makefile +++ b/sys/modules/mt76/core/Makefile @@ -1,25 +1,30 @@ +MT76_DRIVER_NAME= mt76_core + .include -.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 @@ SRCS+= mt76_connac_mac.c mt76_connac_mcu.c mt76_connac3_mac.c # 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 index 6d7cb945a32d..6eb650a8439a 100644 --- 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 .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 diff --git a/sys/modules/mt76/mt7915/Makefile b/sys/modules/mt76/mt7915/Makefile index 049c919949f6..580fde3b7aa7 100644 --- 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 .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 diff --git a/sys/modules/mt76/mt7921/Makefile b/sys/modules/mt76/mt7921/Makefile index 1b53df04357c..b6dbe88204a3 100644 --- a/sys/modules/mt76/mt7921/Makefile +++ b/sys/modules/mt76/mt7921/Makefile @@ -1,35 +1,39 @@ -.include +MT76_DRIVER_NAME= mt7921 -DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7921 +.include .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 diff --git a/sys/modules/mt76/mt7925/Makefile b/sys/modules/mt76/mt7925/Makefile index ee79f09dba1c..c8477eadd7f5 100644 --- a/sys/modules/mt76/mt7925/Makefile +++ b/sys/modules/mt76/mt7925/Makefile @@ -1,30 +1,32 @@ -.include +MT76_DRIVER_NAME= mt7925 -DEVDIR= ${SRCTOP}/sys/contrib/dev/mediatek/mt76/mt7925 +.include .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 diff --git a/sys/modules/mt76/mt7996/Makefile b/sys/modules/mt76/mt7996/Makefile index a43721b6079e..97de923c84ab 100644 --- 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 .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 diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile index 2347093db1a5..04000dd66e95 100644 --- a/sys/modules/rtw88/Makefile +++ b/sys/modules/rtw88/Makefile @@ -5,14 +5,14 @@ DEVRTW88DIR= ${SRCTOP}/sys/contrib/dev/rtw88 .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+= bf.c coex.c debug.c efuse.c fw.c mac.c mac80211.c 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+= rtw8822b.c rtw8822b_table.c # 11ac 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+= rtw8822be.c 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+= rtw8821a.c rtw8821a_table.c rtw8821au.c 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 *** 133 LINES SKIPPED ***