1e5b75505Sopenharmony_ci##### CLEAR VARS
2e5b75505Sopenharmony_ci
3e5b75505Sopenharmony_ciDRV_CFLAGS =
4e5b75505Sopenharmony_ciDRV_WPA_CFLAGS =
5e5b75505Sopenharmony_ciDRV_AP_CFLAGS =
6e5b75505Sopenharmony_ciDRV_OBJS =
7e5b75505Sopenharmony_ciDRV_WPA_OBJS =
8e5b75505Sopenharmony_ciDRV_AP_OBJS =
9e5b75505Sopenharmony_ciDRV_LIBS =
10e5b75505Sopenharmony_ciDRV_WPA_LIBS =
11e5b75505Sopenharmony_ciDRV_AP_LIBS =
12e5b75505Sopenharmony_ci
13e5b75505Sopenharmony_ci##### COMMON DRIVERS
14e5b75505Sopenharmony_ci
15e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_WIRED
16e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_WIRED
17e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_wired.o
18e5b75505Sopenharmony_ciNEED_DRV_WIRED_COMMON=1
19e5b75505Sopenharmony_ciendif
20e5b75505Sopenharmony_ci
21e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_MACSEC_LINUX
22e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_LINUX
23e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_macsec_linux.o
24e5b75505Sopenharmony_ciNEED_DRV_WIRED_COMMON=1
25e5b75505Sopenharmony_ciNEED_LIBNL=y
26e5b75505Sopenharmony_ciCONFIG_LIBNL3_ROUTE=y
27e5b75505Sopenharmony_ciendif
28e5b75505Sopenharmony_ci
29e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_NL80211_BRCM
30e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_NL80211_BRCM
31e5b75505Sopenharmony_ciendif
32e5b75505Sopenharmony_ci
33e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_MACSEC_QCA
34e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_QCA
35e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_macsec_qca.o
36e5b75505Sopenharmony_ciNEED_DRV_WIRED_COMMON=1
37e5b75505Sopenharmony_ciendif
38e5b75505Sopenharmony_ci
39e5b75505Sopenharmony_ciifdef NEED_DRV_WIRED_COMMON
40e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_wired_common.o
41e5b75505Sopenharmony_ciendif
42e5b75505Sopenharmony_ci
43e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_NL80211
44e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_NL80211
45e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_nl80211.o
46e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_nl80211_capa.o
47e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_nl80211_event.o
48e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_nl80211_monitor.o
49e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_nl80211_scan.o
50e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_NL80211_QCA
51e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_NL80211_QCA
52e5b75505Sopenharmony_ciendif
53e5b75505Sopenharmony_ciNEED_SME=y
54e5b75505Sopenharmony_ciNEED_AP_MLME=y
55e5b75505Sopenharmony_ciNEED_NETLINK=y
56e5b75505Sopenharmony_ciNEED_LINUX_IOCTL=y
57e5b75505Sopenharmony_ciNEED_RFKILL=y
58e5b75505Sopenharmony_ciNEED_RADIOTAP=y
59e5b75505Sopenharmony_ciNEED_LIBNL=y
60e5b75505Sopenharmony_ciendif
61e5b75505Sopenharmony_ci
62e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_BSD
63e5b75505Sopenharmony_ciifndef CONFIG_L2_PACKET
64e5b75505Sopenharmony_ciCONFIG_L2_PACKET=freebsd
65e5b75505Sopenharmony_ciendif
66e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_BSD
67e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_bsd.o
68e5b75505Sopenharmony_ciCONFIG_L2_FREEBSD=y
69e5b75505Sopenharmony_ciCONFIG_DNET_PCAP=y
70e5b75505Sopenharmony_ciendif
71e5b75505Sopenharmony_ci
72e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_OPENBSD
73e5b75505Sopenharmony_ciifndef CONFIG_L2_PACKET
74e5b75505Sopenharmony_ciCONFIG_L2_PACKET=freebsd
75e5b75505Sopenharmony_ciendif
76e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_OPENBSD
77e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_openbsd.o
78e5b75505Sopenharmony_ciendif
79e5b75505Sopenharmony_ci
80e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_NONE
81e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_NONE
82e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/driver_none.o
83e5b75505Sopenharmony_ciendif
84e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_HDF
85e5b75505Sopenharmony_ciDRV_CFLAGS += -DCONFIG_DRIVER_HDF
86e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/wpa_hal_event.o
87e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/wpa_hal.o
88e5b75505Sopenharmony_ciendif
89e5b75505Sopenharmony_ci
90e5b75505Sopenharmony_ci
91e5b75505Sopenharmony_ci##### PURE AP DRIVERS
92e5b75505Sopenharmony_ci
93e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_HOSTAP
94e5b75505Sopenharmony_ciDRV_AP_CFLAGS += -DCONFIG_DRIVER_HOSTAP
95e5b75505Sopenharmony_ciDRV_AP_OBJS += ../src/drivers/driver_hostap.o
96e5b75505Sopenharmony_ciCONFIG_WIRELESS_EXTENSION=y
97e5b75505Sopenharmony_ciNEED_AP_MLME=y
98e5b75505Sopenharmony_ciNEED_NETLINK=y
99e5b75505Sopenharmony_ciNEED_LINUX_IOCTL=y
100e5b75505Sopenharmony_ciendif
101e5b75505Sopenharmony_ci
102e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_ATHEROS
103e5b75505Sopenharmony_ciDRV_AP_CFLAGS += -DCONFIG_DRIVER_ATHEROS
104e5b75505Sopenharmony_ciDRV_AP_OBJS += ../src/drivers/driver_atheros.o
105e5b75505Sopenharmony_ciCONFIG_L2_PACKET=linux
106e5b75505Sopenharmony_ciNEED_NETLINK=y
107e5b75505Sopenharmony_ciNEED_LINUX_IOCTL=y
108e5b75505Sopenharmony_ciifdef ATH_GCM_SUPPORT
109e5b75505Sopenharmony_ciCFLAGS += -DATH_GCM_SUPPORT
110e5b75505Sopenharmony_ciendif
111e5b75505Sopenharmony_ciendif
112e5b75505Sopenharmony_ci
113e5b75505Sopenharmony_ci##### PURE CLIENT DRIVERS
114e5b75505Sopenharmony_ci
115e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_WEXT
116e5b75505Sopenharmony_ciDRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT
117e5b75505Sopenharmony_ciCONFIG_WIRELESS_EXTENSION=y
118e5b75505Sopenharmony_ciNEED_NETLINK=y
119e5b75505Sopenharmony_ciNEED_LINUX_IOCTL=y
120e5b75505Sopenharmony_ciNEED_RFKILL=y
121e5b75505Sopenharmony_ciendif
122e5b75505Sopenharmony_ci
123e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_NDIS
124e5b75505Sopenharmony_ciDRV_WPA_CFLAGS += -DCONFIG_DRIVER_NDIS
125e5b75505Sopenharmony_ciDRV_WPA_OBJS += ../src/drivers/driver_ndis.o
126e5b75505Sopenharmony_ciifdef CONFIG_NDIS_EVENTS_INTEGRATED
127e5b75505Sopenharmony_ciDRV_WPA_OBJS += ../src/drivers/driver_ndis_.o
128e5b75505Sopenharmony_ciendif
129e5b75505Sopenharmony_ciifndef CONFIG_L2_PACKET
130e5b75505Sopenharmony_ciCONFIG_L2_PACKET=pcap
131e5b75505Sopenharmony_ciendif
132e5b75505Sopenharmony_ciCONFIG_WINPCAP=y
133e5b75505Sopenharmony_ciifdef CONFIG_USE_NDISUIO
134e5b75505Sopenharmony_ciDRV_WPA_CFLAGS += -DCONFIG_USE_NDISUIO
135e5b75505Sopenharmony_ciendif
136e5b75505Sopenharmony_ciendif
137e5b75505Sopenharmony_ci
138e5b75505Sopenharmony_ciifdef CONFIG_DRIVER_ROBOSWITCH
139e5b75505Sopenharmony_ciDRV_WPA_CFLAGS += -DCONFIG_DRIVER_ROBOSWITCH
140e5b75505Sopenharmony_ciDRV_WPA_OBJS += ../src/drivers/driver_roboswitch.o
141e5b75505Sopenharmony_ciendif
142e5b75505Sopenharmony_ci
143e5b75505Sopenharmony_ciifdef CONFIG_WIRELESS_EXTENSION
144e5b75505Sopenharmony_ciDRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION
145e5b75505Sopenharmony_ciDRV_WPA_OBJS += ../src/drivers/driver_wext.o
146e5b75505Sopenharmony_ciNEED_RFKILL=y
147e5b75505Sopenharmony_ciendif
148e5b75505Sopenharmony_ci
149e5b75505Sopenharmony_ciifdef NEED_NETLINK
150e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/netlink.o
151e5b75505Sopenharmony_ciendif
152e5b75505Sopenharmony_ci
153e5b75505Sopenharmony_ciifdef NEED_RFKILL
154e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/rfkill.o
155e5b75505Sopenharmony_ciendif
156e5b75505Sopenharmony_ci
157e5b75505Sopenharmony_ciifdef NEED_RADIOTAP
158e5b75505Sopenharmony_ciDRV_OBJS += ../src/utils/radiotap.o
159e5b75505Sopenharmony_ciendif
160e5b75505Sopenharmony_ci
161e5b75505Sopenharmony_ciifdef CONFIG_FULL_DYNAMIC_VLAN
162e5b75505Sopenharmony_ciNEED_LINUX_IOCTL=y
163e5b75505Sopenharmony_ciifdef CONFIG_VLAN_NETLINK
164e5b75505Sopenharmony_ciNEED_LIBNL=y
165e5b75505Sopenharmony_ciCONFIG_LIBNL3_ROUTE=y
166e5b75505Sopenharmony_ciendif
167e5b75505Sopenharmony_ciendif
168e5b75505Sopenharmony_ci
169e5b75505Sopenharmony_ciifdef NEED_LINUX_IOCTL
170e5b75505Sopenharmony_ciDRV_OBJS += ../src/drivers/linux_ioctl.o
171e5b75505Sopenharmony_ciendif
172e5b75505Sopenharmony_ci
173e5b75505Sopenharmony_ciifdef NEED_LIBNL
174e5b75505Sopenharmony_ciifndef CONFIG_LIBNL32
175e5b75505Sopenharmony_ciifndef CONFIG_LIBNL20
176e5b75505Sopenharmony_ciifndef CONFIG_LIBNL_TINY
177e5b75505Sopenharmony_ciPKG_CONFIG ?= pkg-config
178e5b75505Sopenharmony_ciHAVE_LIBNL3 := $(shell $(PKG_CONFIG) --exists libnl-3.0; echo $$?)
179e5b75505Sopenharmony_ciifeq ($(HAVE_LIBNL3),0)
180e5b75505Sopenharmony_ciCONFIG_LIBNL32=y
181e5b75505Sopenharmony_ciendif
182e5b75505Sopenharmony_ciendif
183e5b75505Sopenharmony_ciendif
184e5b75505Sopenharmony_ciendif
185e5b75505Sopenharmony_ci
186e5b75505Sopenharmony_ciifdef CONFIG_LIBNL32
187e5b75505Sopenharmony_ci  DRV_LIBS += -lnl-3
188e5b75505Sopenharmony_ci  DRV_LIBS += -lnl-genl-3
189e5b75505Sopenharmony_ci  ifdef LIBNL_INC
190e5b75505Sopenharmony_ci    DRV_CFLAGS += -I$(LIBNL_INC)
191e5b75505Sopenharmony_ci  else
192e5b75505Sopenharmony_ci    PKG_CONFIG ?= pkg-config
193e5b75505Sopenharmony_ci    DRV_CFLAGS += $(shell $(PKG_CONFIG) --cflags libnl-3.0)
194e5b75505Sopenharmony_ci  endif
195e5b75505Sopenharmony_ci  ifdef CONFIG_LIBNL3_ROUTE
196e5b75505Sopenharmony_ci    DRV_LIBS += -lnl-route-3
197e5b75505Sopenharmony_ci    DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE
198e5b75505Sopenharmony_ci  endif
199e5b75505Sopenharmony_cielse
200e5b75505Sopenharmony_ci  ifdef CONFIG_LIBNL_TINY
201e5b75505Sopenharmony_ci    DRV_LIBS += -lnl-tiny
202e5b75505Sopenharmony_ci  else
203e5b75505Sopenharmony_ci    ifndef CONFIG_OSX
204e5b75505Sopenharmony_ci      DRV_LIBS += -lnl
205e5b75505Sopenharmony_ci      DRV_LIBS += -lnl-genl
206e5b75505Sopenharmony_ci    endif
207e5b75505Sopenharmony_ci  endif
208e5b75505Sopenharmony_ciendif
209e5b75505Sopenharmony_ciendif
210e5b75505Sopenharmony_ci
211e5b75505Sopenharmony_ci##### COMMON VARS
212e5b75505Sopenharmony_ciDRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS)
213e5b75505Sopenharmony_ciDRV_WPA_CFLAGS += $(DRV_CFLAGS)
214e5b75505Sopenharmony_ciDRV_AP_CFLAGS += $(DRV_CFLAGS)
215e5b75505Sopenharmony_ci
216e5b75505Sopenharmony_ciDRV_BOTH_LIBS := $(DRV_LIBS) $(DRV_WPA_LIBS) $(DRV_AP_LIBS)
217e5b75505Sopenharmony_ciDRV_WPA_LIBS += $(DRV_LIBS)
218e5b75505Sopenharmony_ciDRV_AP_LIBS += $(DRV_LIBS)
219e5b75505Sopenharmony_ci
220e5b75505Sopenharmony_ciDRV_BOTH_OBJS := $(DRV_OBJS) $(DRV_WPA_OBJS) $(DRV_AP_OBJS)
221e5b75505Sopenharmony_ciDRV_WPA_OBJS += $(DRV_OBJS)
222e5b75505Sopenharmony_ciDRV_AP_OBJS += $(DRV_OBJS)
223e5b75505Sopenharmony_ci
224e5b75505Sopenharmony_ciDRV_BOTH_LDFLAGS := $(DRV_LDFLAGS) $(DRV_WPA_LDFLAGS) $(DRV_AP_LDFLAGS)
225e5b75505Sopenharmony_ciDRV_WPA_LDFLAGS += $(DRV_LDFLAGS)
226e5b75505Sopenharmony_ciDRV_AP_LDFLAGS += $(DRV_LDFLAGS)
227