diff --git a/sys/modules/bwn/Makefile b/sys/modules/bwn/Makefile index 37c7b35d..962aa268 100644 --- a/sys/modules/bwn/Makefile +++ b/sys/modules/bwn/Makefile @@ -24,15 +24,33 @@ SRCS+= bhndb_bus_if.h \ # Other SRCS+= device_if.h bus_if.h gpio_if.h pci_if.h opt_bwn.h opt_wlan.h -# The following need the BWN_GPL_PHY kenrel option to opt-in -# to the GPL'd 802.11n PHY support for this driver. +# BWN_GPL_PHY: enable GPLv2 802.11n PHY support (required for N-PHY chips like BCM43224). +# Without this, bwn(4) attaches but bwn_phy_n_attach() fails with: +# "BWN_GPL_PHY not in kernel config; no PHY-N support". +# NOTE: We define it here (not via the kernel config) because this is a +# standalone module build; bsd.kmod.mk only honours SRCS. when is +# present in KERN_OPTS, which it is not for out-of-tree module builds. +opt_bwn.h: + @echo "#define BWN_GPL_PHY 1" > ${.TARGET} + +# The following are the GPL'd 802.11n PHY support files for this driver. +# They MUST be added unconditionally to SRCS (not via SRCS.BWN_GPL_PHY), +# because a standalone module build does not populate KERN_OPTS with +# BWN_GPL_PHY, so the SRCS. mechanism would skip them entirely. .PATH: ${SRCTOP}/sys/gnu/dev/bwn/phy_n -SRCS.BWN_GPL_PHY+= if_bwn_radio_2055.c -SRCS.BWN_GPL_PHY+= if_bwn_radio_2056.c -SRCS.BWN_GPL_PHY+= if_bwn_radio_2057.c -SRCS.BWN_GPL_PHY+= if_bwn_phy_n_sprom.c -SRCS.BWN_GPL_PHY+= if_bwn_phy_n_tables.c -SRCS.BWN_GPL_PHY+= if_bwn_phy_n_ppr.c -SRCS.BWN_GPL_PHY+= if_bwn_phy_n_core.c +SRCS+= if_bwn_radio_2055.c +SRCS+= if_bwn_radio_2056.c +SRCS+= if_bwn_radio_2057.c +SRCS+= if_bwn_phy_n_sprom.c +SRCS+= if_bwn_phy_n_tables.c +SRCS+= if_bwn_phy_n_ppr.c +SRCS+= if_bwn_phy_n_core.c .include + +# Temporary debug build +CFLAGS+= -DBWN_DEBUG +CFLAGS+= -DBWN_DEBUG + +# Temporary debug build +CFLAGS+= -DBWN_DEBUG