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