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