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