################################################################################
#
# RTL88X2BU_CV
#
################################################################################

RTL88X2BU_CV_VERSION = v5.13.1-27-g3090e5abf.20210903_COEX20210316-18317b7b
RTL88X2BU_CV_SOURCE = rtl88x2BU_WiFi_linux_$(RTL88X2BU_CV_VERSION).tar.gz
RTL88X2BU_CV_SITE = $(BR2_EXTERNAL_CVBOARD_PATH)/package/rtl88x2bu_CV
RTL88X2BU_CV_SITE_METHOD = local

RTL88X2BU_CV_LICENSE = GPL-2.0
RTL88X2BU_CV_LICENSE_FILES = LICENSE

define RTL88X2BU_CV_EXTRACT_CMDS
    tar --strip-components=1 -xzf $(RTL88X2BU_CV_SITE)/$(RTL88X2BU_CV_SOURCE) -C $(BUILD_DIR)/rtl88x2bu_CV-$(RTL88X2BU_CV_VERSION)
endef

RTL88X2BU_CV_EXTRA_CFLAGS = \
        -DCONFIG_$(call qstrip,$(BR2_ENDIAN))_ENDIAN -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT

RTL88X2BU_CV_MODULE_MAKE_OPTS = \
        CONFIG_PLATFORM_I386_PC=n \
        CONFIG_RTL8822BU=m \
        CONFIG_RTW_DEBUG=n \
        KVER=$(LINUX_VERSION_PROBED) \
        USER_EXTRA_CFLAGS+="$(RTL88X2BU_CV_EXTRA_CFLAGS)"

RTL88X2BU_CV_POST_RSYNC_HOOKS = RTL88X2BU_CV_EXTRACT_CMDS

$(eval $(kernel-module))
$(eval $(generic-package))
