xref: /src/sys/modules/rtw88/Makefile (revision 9e175561196066a09c1a89202fd60e0433b87868)
1.include <kmod.opts.mk>
2
3DEVRTW88DIR=	${SRCTOP}/sys/contrib/dev/rtw88
4
5.PATH: ${DEVRTW88DIR}
6
7# Bus attachments.
8WITH_PCI=	1
9WITH_USB=	0
10WITH_SDIO=	0
11
12# Options.
13WITH_CONFIG_PM=	0
14WITH_DEBUGFS=	1
15WITH_LEDS=	0
16
17KMOD=	if_rtw88
18
19# Core parts.
20SRCS=	main.c
21SRCS+=	bf.c coex.c debug.c efuse.c fw.c mac.c mac80211.c
22SRCS+=	phy.c ps.c regd.c
23SRCS+=	rx.c sar.c sec.c tx.c util.c
24
25.if defined(WITH_CONFIG_PM) && ${WITH_CONFIG_PM} > 0
26SRCS+=	wow.c
27CFLAGS+=	-DCONFIG_PM=${WITH_CONFIG_PM}
28.endif
29
30# Common
31SRCS+=	rtw8723x.c				# 87x3 common
32SRCS+=	rtw8703b.c rtw8703b_tables.c		# 11n
33SRCS+=	rtw8723d.c rtw8723d_table.c		# 11n
34SRCS+=	rtw8814a.c rtw8814a_table.c		# 11ac
35SRCS+=	rtw8821c.c rtw8821c_table.c		# 11ac
36SRCS+=	rtw8822b.c rtw8822b_table.c		# 11ac
37SRCS+=	rtw8822c.c rtw8822c_table.c		# 11ac
38
39# PCI parts; PCI needs to be compiled into the kernel and cannot be loaded.
40.if defined(WITH_PCI) && ${WITH_PCI} > 0 && ${KERN_OPTS:MDEV_PCI}
41SRCS+=	pci.c
42SRCS+=	rtw8723de.c
43SRCS+=	rtw8814ae.c
44SRCS+=	rtw8821ce.c
45SRCS+=	rtw8822be.c
46SRCS+=	rtw8822ce.c
47.endif
48
49# USB parts; USB can be loaded and is unconditional on any kernel config.
50.if defined(WITH_USB) && ${WITH_USB} > 0
51SRCS+=	usb.c
52SRCS+=	rtw8723du.c
53SRCS+=	rtw88xxa.c					# 88xxa common
54SRCS+=	rtw8812a.c rtw8812a_table.c rtw8812au.c
55SRCS+=	rtw8814au.c
56SRCS+=	rtw8821a.c rtw8821a_table.c rtw8821au.c
57SRCS+=	rtw8821cu.c
58SRCS+=	rtw8822bu.c
59SRCS+=	rtw8822cu.c
60
61CFLAGS+=	-DCONFIG_RTW88_USB
62.endif
63
64# SDIO parts; SDIO depends on an MMCCAM kernel.
65.if defined(WITH_SDIO) && ${WITH_SDIO} > 0 && ${KERN_OPTS:MMMCCAM}
66SRCS+=	rtw8723cs.c
67SRCS+=	rtw8723ds.c
68SRCS+=	rtw8821cs.c
69SRCS+=	rtw8822bs.c
70SRCS+=	rtw8822cs.c
71.endif
72
73.if defined(WITH_LEDS) && ${WITH_LEDS} > 0
74CFLAGS+=	-DCONFIG_RTW88_LEDS
75SRCS+=		led.c
76.endif
77
78.if defined(WITH_DEBUGFS) && ${WITH_DEBUGFS} > 0
79CFLAGS+=	-DCONFIG_RTW88_DEBUGFS
80.endif
81
82# Other
83SRCS+=		opt_wlan.h opt_inet6.h opt_inet.h
84SRCS+=		${LINUXKPI_GENSRCS}
85
86CFLAGS+=	${LINUXKPI_INCLUDES}
87
88CFLAGS+=	-I${DEVRTW88DIR}
89CFLAGS+=	-DCONFIG_RTW88_DEBUG
90
91CFLAGS+=	-DKBUILD_MODNAME='"rtw88"'
92CFLAGS+=	-DLINUXKPI_VERSION=61900
93
94# Helpful after fresh imports.
95#CFLAGS+=	-ferror-limit=0
96
97.include <bsd.kmod.mk>
98