xref: /freebsd/sys/modules/rtw89/Makefile (revision 81abe47cd5cd0e15813fc53b18a6cd744ceefa9e)
1.include <kmod.opts.mk>
2
3DEVRTW89DIR=	${SRCTOP}/sys/contrib/dev/rtw89
4
5.PATH: ${DEVRTW89DIR}
6
7# Bus attachments.
8RTW89_PCI=		1
9RTW89_SDIO=		0
10RTW89_USB=		0
11
12# Options.
13RTW89_CONFIG_PM=	0
14RTW89_DEBUGFS=		0
15.if ${KERN_OPTS:MDEV_ACPI}
16RTW89_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# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
37.if defined(RTW89_PCI) && ${RTW89_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
38SRCS+=	pci.c pci_be.c
39SRCS+=	rtw8851be.c
40SRCS+=	rtw8852ae.c
41SRCS+=	rtw8852be.c
42SRCS+=	rtw8852bte.c
43SRCS+=	rtw8852ce.c
44SRCS+=	rtw8922ae.c
45.endif
46
47# USB parts; USB can be loaded and is unconditional on any kernel config.
48.if defined(RTW89_USB) && ${RTW89_USB} > 0
49SRCS+=	usb.c
50SRCS+=	rtw8851bu.c
51SRCS+=	rtw8852au.c
52SRCS+=	rtw8852bu.c
53SRCS+=	rtw8852cu.c
54.endif
55
56.if defined(RTW89_CONFIG_PM) && ${RTW89_CONFIG_PM} > 0
57CFLAGS+=	-DCONFIG_PM=${RTW89_CONFIG_PM}
58SRCS+=	wow.c
59.endif
60
61.if defined(RTW89_DEBUGFS) && ${RTW89_DEBUGFS} > 0
62CFLAGS+=	-DCONFIG_RTW89_DEBUGFS
63.endif
64
65.if defined(RTW89_CONFIG_ACPI) && ${RTW89_CONFIG_ACPI} > 0
66SRCS.DEV_ACPI+=	acpi.c
67CFLAGS+=	-DCONFIG_ACPI
68.endif
69# This needs to always stay on for the LinuxKPI header file.
70CFLAGS+=	-DLINUXKPI_WANT_LINUX_ACPI
71
72# CONFIG_RTW89_DEBUG (always on for now)
73SRCS+=	debug.c
74CFLAGS+=	-DCONFIG_RTW89_DEBUGMSG
75
76# Other
77SRCS+=	${LINUXKPI_GENSRCS}
78SRCS+=	opt_wlan.h opt_inet6.h opt_inet.h opt_acpi.h
79
80CFLAGS+=	-I${DEVRTW89DIR}
81CFLAGS+=	${LINUXKPI_INCLUDES}
82# Helpful after fresh imports.
83#CFLAGS+=	-ferror-limit=0 -fmacro-backtrace-limit=0
84
85CFLAGS+=	-DKBUILD_MODNAME='"rtw89"'
86CFLAGS+=	-DLINUXKPI_VERSION=70000
87
88.include <bsd.kmod.mk>
89