blob: d9e634e8a029189e39f75fcd89694ca10470b511 [file] [log] [blame]
# /*
# * Misc utility routines for accessing chip-specific features
# * of the SiliconBackplane-based Broadcom chips.
# *
# * Copyright 1999-2016, Broadcom Corporation
# * All rights reserved,
# *
# * Redistribution and use in source and binary forms, with or without modification,
# * are permitted provided that the following conditions are met:
# * 1. Redistributions of source code must retain the above copyright notice,
# * this list of conditions and the following disclaimer.
# * 2. Redistributions in binary form must reproduce the above copyright notice,
# * this list of conditions and the following disclaimer in the documentation
# * and/or other materials provided with the distribution.
# *
# * This software is provided by the copyright holder "as is" and any express or
# * implied warranties, including, but not limited to, the implied warranties of
# * merchantability and fitness for a particular purpose are disclaimed. In no event
# * shall copyright holder be liable for any direct, indirect, incidental, special,
# * exemplary, or consequential damages (including, but not limited to, procurement
# * of substitute goods or services; loss of use, data, or profits; or business
# * interruption) however caused and on any theory of liability, whether in
# * contract, strict liability, or tort (including negligence or otherwise) arising
# * in any way out of the use of this software, even if advised of the possibility
# * of such damage
# *
# *
# * <<Broadcom-WL-IPTag/Open:>>
# */
# bcmdhd
# 1. WL_IFACE_COMB_NUM_CHANNELS must be added if Android version is 4.4 with Kernel version 3.0~3.4,
# otherwise please remove it.
# if not confiure pci mode, we use sdio mode as default
ifeq ($(CONFIG_BCMDHD_PCIE),)
$(info bcm SDIO driver configured)
CONFIG_BCMDHD_SDIO := y
CONFIG_DHD_USE_STATIC_BUF := y
endif
ifneq ($(CONFIG_BCMDHD_GWIFI_SUPPORT),)
$(info Broadcom GWIFI support enabled)
endif
CONFIG_BCMDHD_PROPTXSTATUS := y
DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER -DSDTEST \
-DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DBCMFILEIMAGE \
-DDHDTHREAD -DDHD_DEBUG -DSHOW_EVENTS -DBCMDBG -DGET_OTP_MAC_ENABLE \
-DWIFI_ACT_FRAME -DSUPPORT_PM2_ONLY \
-DKEEP_ALIVE -DPKT_FILTER_SUPPORT -DPNO_SUPPORT -DDHDTCPACK_SUPPRESS \
-DDHD_DONOT_FORWARD_BCMEVENT_AS_NETWORK_PKT -DRXFRAME_THREAD \
-DBCMSDIOH_TXGLOM_EXT \
-DENABLE_INSMOD_NO_FW_LOAD \
-DWL_THERMAL_PROT_EVENT \
-I$(src) -I$(src)/include
DHDOFILES = aiutils.o siutils.o sbutils.o bcmutils.o bcmwifi_channels.o \
dhd_linux.o dhd_linux_platdev.o dhd_linux_sched.o dhd_pno.o \
dhd_common.o dhd_ip.o dhd_linux_wq.o dhd_custom_gpio.o \
bcmevent.o hndpmu.o linux_osl.o wldev_common.o wl_android.o \
hnd_pktq.o hnd_pktpool.o dhd_config.o
ifneq ($(CONFIG_BCMDHD_SDIO),)
DHDCFLAGS += \
-DBCMSDIO -DMMC_SDIO_ABORT -DBCMLXSDMMC -DUSE_SDIOFIFO_IOVAR \
-DBDC -DDHD_USE_IDLECOUNT -DBCMSDIOH_TXGLOM \
-DCUSTOM_SDIO_F2_BLKSIZE=128
DHDCFLAGS += -DDHD_FIRSTREAD=256 -DMAX_HDR_READ=256
DHDOFILES += bcmsdh.o bcmsdh_linux.o bcmsdh_sdmmc.o bcmsdh_sdmmc_linux.o \
dhd_sdio.o dhd_cdc.o dhd_wlfc.o
ifeq ($(CONFIG_BCMDHD_OOB),y)
DHDCFLAGS += -DOOB_INTR_ONLY -DCUSTOMER_OOB -DHW_OOB
ifeq ($(CONFIG_BCMDHD_DISABLE_WOWLAN),y)
DHDCFLAGS += -DDISABLE_WOWLAN
endif
else
DHDCFLAGS += -DSDIO_ISR_THREAD
endif
endif
ifeq ($(CONFIG_BCMDHD_PROPTXSTATUS),y)
ifneq ($(CONFIG_BCMDHD_SDIO),)
ifneq ($(CONFIG_BCMDHD_GWIFI_SUPPORT),y)
DHDCFLAGS += -DPROP_TXSTATUS
endif
endif
endif
ifneq ($(CONFIG_BCMDHD_PCIE),)
DHDCFLAGS += \
-DPCIE_FULL_DONGLE -DBCMPCIE -DCUSTOM_DPC_PRIO_SETTING=-1
DHDCFLAGS += -DDHD_PCIE_BAR1_WIN_BASE_FIX=0x200000
DHDCFLAGS += -DDHD_USE_MSI
DHDOFILES += dhd_pcie.o dhd_pcie_linux.o pcie_core.o dhd_flowring.o \
dhd_msgbuf.o
endif
obj-$(CONFIG_BCMDHD) += dhd.o
dhd-objs += $(DHDOFILES)
#ifeq ($(CONFIG_MACH_PLATFORM),y)
DHDOFILES += dhd_gpio.o
DHDCFLAGS += -DCUSTOMER_HW -DDHD_OF_SUPPORT
DHDCFLAGS += -DCUSTOMER_HW_AMLOGIC
#DHDCFLAGS += -DBCMWAPI_WPI -DBCMWAPI_WAI
#endif
DHDCFLAGS += -DDHD_SK_PACING_SHIFT=8
DHDCFLAGS += -DBCMFW_ROAM_ENABLE -DDISABLE_BUILTIN_ROAM
ifeq ($(CONFIG_BCMDHD_AG),y)
DHDCFLAGS += -DBAND_AG
endif
ifeq ($(CONFIG_DHD_USE_STATIC_BUF),y)
# add dhd_static_buf to kernel image build
#obj-y += dhd_static_buf.o
DHDCFLAGS += -DCONFIG_DHD_USE_STATIC_BUF
DHDCFLAGS += -DSTATIC_WL_PRIV_STRUCT -DENHANCED_STATIC_BUF
endif
ifneq ($(CONFIG_WIRELESS_EXT),)
DHDOFILES += wl_iw.o wl_escan.o
DHDCFLAGS += -DSOFTAP -DWL_WIRELESS_EXT -DUSE_IW -DWL_ESCAN
endif
ifneq ($(CONFIG_CFG80211),)
DHDOFILES += wl_cfgp2p.o wl_linux_mon.o wl_cfg_btcoex.o wl_cfgvendor.o
DHDOFILES += dhd_cfg80211.o dhd_cfg_vendor.o
DHDCFLAGS += -DWL_CFG80211 -DWLP2P -DWL_CFG80211_STA_EVENT -DWL_ENABLE_P2P_IF
DHDCFLAGS += -DWL_IFACE_COMB_NUM_CHANNELS
DHDCFLAGS += -DCUSTOM_ROAM_TRIGGER_SETTING=-65
DHDCFLAGS += -DCUSTOM_ROAM_DELTA_SETTING=15
DHDCFLAGS += -DCUSTOM_KEEP_ALIVE_SETTING=28000
DHDCFLAGS += -DCUSTOM_PNO_EVENT_LOCK_xTIME=7
DHDCFLAGS += -DWL_SUPPORT_AUTO_CHANNEL
DHDCFLAGS += -DWL_SUPPORT_BACKPORTED_KPATCHES
DHDCFLAGS += -DESCAN_RESULT_PATCH
DHDCFLAGS += -DVSDB -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST
DHDCFLAGS += -DWLTDLS -DMIRACAST_AMPDU_SIZE=8
DHDCFLAGS += -DWL_VIRTUAL_APSTA
DHDCFLAGS += -DWL_VENDOR_EXT_SUPPORT
DHDCFLAGS += -DWIFI_STATS_SUPPORT
DHDCFLAGS += -DSUPPORT_WDEV_CFG80211_VENDOR_EVENT_ALLOC
DHDCFLAGS += -DWL_CCODE_RELOAD
DHDCFLAGS += -DALLOW_CHSW_EVT
DHDCFLAGS += -DMFP
# GWIFI
ifeq ($(CONFIG_BCMDHD_GWIFI_SUPPORT),y)
DHDOFILES += wl_cfg80211.o
DHDCFLAGS += -DGWIFI_SUPPORT
DHDCFLAGS += -DWL_SUPPORT_ACS
DHDCFLAGS += -DDISABLE_P2P
DHDCFLAGS += -DWLMBCN
# PROB REQ SENDUP
DHDCFLAGS += -DPROBREQ_SENDUP
# DWDS
DHDCFLAGS += -DWLDWDS -DFOURADDR_AUTO_BRG
# QOS
DHDCFLAGS += -DWL_QOS_CTRL
# RTT
DHDCFLAGS += -DRTT_SUPPORT -DRTT_DEBUG
DHDOFILES += dhd_rtt.o bcmxtlv.o
# CSI
DHDCFLAGS += -DCSI_SUPPORT
DHDOFILES += dhd_csi.o
else
ifeq ($(CONFIG_BCMDHD_PROPTXSTATUS),y)
ifneq ($(CONFIG_CFG80211),)
DHDCFLAGS += -DPROP_TXSTATUS_VSDB
endif
endif
DHDCFLAGS += -DWL_CFG80211_V1
DHDOFILES += wl_cfg80211_v1.o
endif
endif
# WPA3
DHDCFLAGS += -DWL_SAE
EXTRA_CFLAGS = $(DHDCFLAGS)
ifeq ($(CONFIG_BCMDHD),m)
DHDCFLAGS += -DMULTIPLE_SUPPLICANT
EXTRA_LDFLAGS += --strip-debug
else
DHDCFLAGS += -DBUILD_IN_KERNEL
endif
ARCH ?= arm64
CROSS_COMPILE ?= ../prebuilt/toolchain/aarch64/bin/aarch64-cros-linux-gnu-
KDIR ?= ../../kernel
dhd:
$(MAKE) -C $(KDIR) M=$(PWD) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) ARCH=$(ARCH) clean
$(RM) Module.markers
$(RM) modules.order