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