xref: /src/sys/modules/rtw89/Makefile (revision f19cb3c72b001f5ca2204888bfab50e2f388547d)
1.include <kmod.opts.mk>
2
3DEVRTW89DIR=	${SRCTOP}/sys/contrib/dev/rtw89
4
5.PATH: ${DEVRTW89DIR}
6
7# Bus attachments.
8WITH_PCI=	1
9WITH_USB=	0
10WITH_SDIO=	0
11
12# Options.
13WITH_CONFIG_PM=	0
14WITH_DEBUGFS=	0
15.if ${KERN_OPTS:MDEV_ACPI}
16WITH_CONFIG_ACPI=	1
17.endif
18
19KMOD=	if_rtw89
20
21# Core parts.
22SRCS=	core.c
23SRCS+=	chan.c mac80211.c mac.c mac_be.c phy.c phy_be.c fw.c
24SRCS+=	cam.c efuse.c efuse_be.c regd.c sar.c coex.c ps.c ser.c
25SRCS+=	util.c
26
27# Common
28SRCS+=	rtw8851b.c rtw8851b_rfk.c rtw8851b_rfk_table.c rtw8851b_table.c
29SRCS+=	rtw8852a.c rtw8852a_rfk.c rtw8852a_rfk_table.c rtw8852a_table.c
30SRCS+=	rtw8852b_common.c
31SRCS+=	rtw8852b.c rtw8852b_rfk.c rtw8852b_rfk_table.c rtw8852b_table.c
32SRCS+=	rtw8852bt.c rtw8852bt_rfk.c rtw8852bt_rfk_table.c
33SRCS+=	rtw8852c.c rtw8852c_rfk.c rtw8852c_rfk_table.c rtw8852c_table.c
34SRCS+=	rtw8922a.c rtw8922a_rfk.c
35
36.if defined(WITH_CONFIG_ACPI) && ${WITH_CONFIG_ACPI} > 0
37SRCS.DEV_ACPI+=	acpi.c
38CFLAGS+=	-DCONFIG_ACPI
39.endif
40# This needs to always stay on for the LinuxKPI header file.
41CFLAGS+=	-DLINUXKPI_WANT_LINUX_ACPI
42
43# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
44.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
45SRCS+=	pci.c pci_be.c
46SRCS+=	rtw8851be.c
47SRCS+=	rtw8852ae.c
48SRCS+=	rtw8852be.c
49SRCS+=	rtw8852bte.c
50SRCS+=	rtw8852ce.c
51SRCS+=	rtw8922ae.c
52.endif
53
54# USB parts; USB can be loaded and is unconditional on any kernel config.
55.if defined(WITH_USB) && ${WITH_USB} > 0
56SRCS+=	usb.c
57SRCS+=	rtw8851bu.c
58SRCS+=	rtw8852au.c
59SRCS+=	rtw8852bu.c
60SRCS+=	rtw8852cu.c
61.endif
62
63# CONFIG_RTW89_DEBUG (always on for now)
64SRCS+=	debug.c
65
66.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
67CFLAGS+=	-DCONFIG_PM=${WITH_CONFIG_PM}
68SRCS+=	wow.c
69.endif
70
71# Other
72SRCS+=	${LINUXKPI_GENSRCS}
73SRCS+=	opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
74
75CFLAGS+=	-DKBUILD_MODNAME='"rtw89"'
76CFLAGS+=	-DLINUXKPI_VERSION=61900
77
78CFLAGS+=	-I${DEVRTW89DIR}
79CFLAGS+=	${LINUXKPI_INCLUDES}
80CFLAGS+=	-DCONFIG_RTW89_DEBUGMSG
81.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
82CFLAGS+=	-DCONFIG_RTW89_DEBUGFS
83.endif
84
85#CFLAGS+=	-ferror-limit=0 -fmacro-backtrace-limit=0
86
87.include <bsd.kmod.mk>
88