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