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