EXTRA_CFLAGS = -Idrivers/net/wireless/rt2860v2/include

obj-$(CONFIG_RT2860V2_AP) += rt2860v2_ap.o

rt2860v2_ap-objs += ../rt2860v2/common/md5.obj
rt2860v2_ap-objs += ../rt2860v2/common/mlme.obj
rt2860v2_ap-objs += ../rt2860v2/common/rtmp_wep.obj
rt2860v2_ap-objs += ../rt2860v2/common/action.obj
rt2860v2_ap-objs += ../rt2860v2/common/ba_action.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_data.obj
rt2860v2_ap-objs += ../rt2860v2/common/rtmp_init.obj
rt2860v2_ap-objs += ../rt2860v2/common/rtmp_tkip.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_sync.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_sanity.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_info.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_wpa.obj
rt2860v2_ap-objs += ../rt2860v2/common/2860_rtmp_init.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_data_2860.obj
rt2860v2_ap-objs += ../rt2860v2/common/dfs.obj
rt2860v2_ap-objs += ../rt2860v2/common/dfs_mcu.obj
rt2860v2_ap-objs += ../rt2860v2/common/spectrum.obj


rt2860v2_ap-objs += ../rt2860v2/ap/ap.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_assoc.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_auth.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_authrsp.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_connect.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_mlme.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_sanity.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_sync.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_wpa.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_data.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_uapsd.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_autoChSel.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_mbss.obj
rt2860v2_ap-objs += ../rt2860v2/ap/ap_qload.obj


rt2860v2_ap-objs += ../rt2860v2/os/linux/rt_linux.obj
rt2860v2_ap-objs += ../rt2860v2/os/linux/rt_profile.obj
rt2860v2_ap-objs += ../rt2860v2/os/linux/rt_main_dev.obj
rt2860v2_ap-objs += ../rt2860v2/os/linux/ap_ioctl.obj
rt2860v2_ap-objs += ../rt2860v2/os/linux/rt_2860_rbus.obj
rt2860v2_ap-objs += ../rt2860v2/os/linux/rt_eeprom.obj
rt2860v2_ap-objs += ../rt2860v2/os/linux/2860_main_dev.obj
rt2860v2_ap-objs += ../rt2860v2/os/linux/rt_ate.obj


ifeq ($(CONFIG_RT2860V2_AP_LED),y)
rt2860v2_ap-objs += ../rt2860v2/common/led.obj
endif

ifeq ($(CONFIG_RT2860V2_AP_WSC),y)
rt2860v2_ap-objs += ../rt2860v2/common/wsc.obj
rt2860v2_ap-objs += ../rt2860v2/common/wsc_tlv.obj
rt2860v2_ap-objs += ../rt2860v2/common/sha2.obj
rt2860v2_ap-objs += ../rt2860v2/common/hmac.obj
rt2860v2_ap-objs += ../rt2860v2/common/dh_key.obj
rt2860v2_ap-objs += ../rt2860v2/common/evp_enc.obj
endif


ifeq ($(CONFIG_RT2860V2_AP_WDS),y)
rt2860v2_ap-objs += ../rt2860v2/ap/ap_wds.obj
endif

ifeq ($(CONFIG_RT2860V2_AP_MBSS),y)
rt2860v2_ap-objs += ../rt2860v2/ap/ap_mbss.obj
endif

ifeq ($(CONFIG_RT2860V2_AP_APCLI),y)
rt2860v2_ap-objs += ../rt2860v2/ap/ap_apcli.obj
rt2860v2_ap-objs += ../rt2860v2/ap/apcli_assoc.obj
rt2860v2_ap-objs += ../rt2860v2/ap/apcli_auth.obj
rt2860v2_ap-objs += ../rt2860v2/ap/apcli_ctrl.obj
rt2860v2_ap-objs += ../rt2860v2/ap/apcli_sync.obj
rt2860v2_ap-objs += ../rt2860v2/common/mlme_ex.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_mat.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_mat_iparp.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_mat_pppoe.obj
rt2860v2_ap-objs += ../rt2860v2/common/cmm_mat_ipv6.obj
endif

ifeq ($(CONFIG_RT2860V2_AP_IGMP_SNOOP),y)
rt2860v2_ap-objs += ../rt2860v2/common/igmp_snoop.obj
endif

ifeq ($(CONFIG_RT2860V2_AP_NETIF_BLOCK),y)
rt2860v2_ap-objs += ../rt2860v2/common/netif_block.obj
endif

ifeq ($(CONFIG_RT2860V2_AP_DLS),y)
rt2860v2_ap-objs += ../rt2860v2/ap/ap_dls.obj
endif

ifeq ($(CONFIG_RT2860V2_AP_IDS),y)
rt2860v2_ap-objs += ../rt2860v2/ap/ap_ids.obj
endif



###################
#  CFLAGS
##################
EXTRA_CFLAGS += -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT  -DLINUX \
               -Wall -Wstrict-prototypes -Wno-trigraphs

EXTRA_CFLAGS += -DCONFIG_AP_SUPPORT -DUAPSD_AP_SUPPORT -DDBG -DRT2860 # -DDFS_DEBUG -DIAPP_SUPPORT
EXTRA_CFLAGS += -DRALINK_ATE -DRALINK_28xx_QA -DCONFIG_RT2880_ATE_CMD_NEW

ifeq ($(CONFIG_RT2860V2_AP_DLS),y)
EXTRA_CFLAGS += -DQOS_DLS_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_IDS),y)
EXTRA_CFLAGS += -DIDS_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_DFS),y)
EXTRA_CFLAGS += -DDFS_SUPPORT
EXTRA_CFLAGS += -DNEW_DFS
endif

ifeq ($(CONFIG_RT2860V2_AP_CARRIER),y)
EXTRA_CFLAGS += -DCARRIER_DETECTION_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_LED),y)
EXTRA_CFLAGS += -DAP_LED
endif


ifeq ($(CONFIG_RT2860V2_AP_WSC),y)
EXTRA_CFLAGS += -DWSC_AP_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_LLTD),y)
EXTRA_CFLAGS += -DLLTD_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_WDS),y)
EXTRA_CFLAGS += -DWDS_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_MBSS),y)
EXTRA_CFLAGS += -DMBSS_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_APCLI),y)
EXTRA_CFLAGS += -DAPCLI_SUPPORT
EXTRA_CFLAGS += -DMAT_SUPPORT
EXTRA_CFLAGS += -DMLME_EX

endif

ifeq ($(CONFIG_RT2860V2_AP_IGMP_SNOOP),y)
EXTRA_CFLAGS += -DIGMP_SNOOP_SUPPORT
endif

ifeq ($(CONFIG_RT2860V2_AP_NETIF_BLOCK),y)
EXTRA_CFLAGS += -DBLOCK_NET_IF
endif




ifeq ($(CONFIG_RT2860V2_AP_MEMORY_OPTIMIZATION),y)
EXTRA_CFLAGS   += -DMEMORY_OPTIMIZATION
else
EXTRA_CFLAGS   += -DDBG
endif
