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