diff --git a/Kbuild b/Kbuild index 5b586e548d90..a5b6364c491a 100644 --- a/Kbuild +++ b/Kbuild @@ -806,6 +806,14 @@ BMI_OBJS := $(BMI_DIR)/src/bmi.o \ $(BMI_DIR)/src/ol_fw_common.o BMI_OBJS += $(BMI_DIR)/src/bmi_1.o +########## TARGET_IF ####### +TARGET_IF_DIR := $(WLAN_COMMON_ROOT)/target_if + +TARGET_IF_INC := -I$(WLAN_COMMON_INC)/target_if/core/inc \ + -I$(WLAN_COMMON_INC)/target_if/core/src + +TARGET_IF_OBJ := $(TARGET_IF_DIR)/core/src/target_if_main.o + ########### WMI ########### WMI_ROOT_DIR := wmi @@ -1124,7 +1132,8 @@ INCS := $(HDD_INC) \ $(SYS_INC) \ $(QDF_INC) \ $(CDS_INC) \ - $(DFS_INC) + $(DFS_INC) \ + $(TARGET_IF_INC) INCS += $(WMA_INC) \ $(UAPI_INC) \ @@ -1191,7 +1200,8 @@ OBJS += $(WMA_OBJS) \ OBJS += $(HIF_OBJS) \ $(BMI_OBJS) \ - $(HTT_OBJS) + $(HTT_OBJS) \ + $(TARGET_IF_OBJ) ifeq ($(CONFIG_LITHIUM), y) OBJS += $(HAL_OBJS) diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 726a440cec85..c52000a4ee74 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -81,6 +81,7 @@ #include "wma_nan_datapath.h" #include "wlan_lmac_if_def.h" #include "wlan_lmac_if_api.h" +#include "target_if.h" #define WMA_LOG_COMPLETION_TIMER 10000 /* 10 seconds */ @@ -1855,6 +1856,27 @@ static void wma_target_if_close(tp_wma_handle wma_handle) wlan_lmac_if_close(psoc); } +/** + * wma_get_psoc_from_scn_handle() - API to get psoc from scn handle + * @scn_handle: opaque wma handle + * + * API to get psoc from scn handle + * + * Return: None + */ +static struct wlan_objmgr_psoc *wma_get_psoc_from_scn_handle(void *scn_handle) +{ + tp_wma_handle wma_handle; + + if (!scn_handle) { + WMA_LOGE("invalid scn handle"); + return NULL; + } + wma_handle = (tp_wma_handle)scn_handle; + + return wma_handle->psoc; +} + /** * wma_open() - Allocate wma context and initialize it. * @psoc: Psoc pointer @@ -2318,6 +2340,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, void *cds_context, WMA_RX_SERIALIZER_CTX); wma_ndp_register_all_event_handlers(wma_handle); wma_target_if_open(wma_handle); + target_if_open(wma_get_psoc_from_scn_handle); wma_register_debug_callback(); @@ -3535,6 +3558,7 @@ QDF_STATUS wma_close(void *cds_ctx) /* Decrease psoc ref count once APIs are available in object manager */ wma_handle->psoc = NULL; + target_if_close(); wma_target_if_close(wma_handle); WMA_LOGD("%s: Exit", __func__);