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