diff --git a/Kbuild b/Kbuild index 57da02ddd447..50ee1ce8ee73 100644 --- a/Kbuild +++ b/Kbuild @@ -57,7 +57,6 @@ HDD_OBJS := $(HDD_SRC_DIR)/wlan_hdd_assoc.o \ $(HDD_SRC_DIR)/wlan_hdd_request_manager.o \ $(HDD_SRC_DIR)/wlan_hdd_scan.o \ $(HDD_SRC_DIR)/wlan_hdd_softap_tx_rx.o \ - $(HDD_SRC_DIR)/wlan_hdd_spectralscan.o \ $(HDD_SRC_DIR)/wlan_hdd_stats.o \ $(HDD_SRC_DIR)/wlan_hdd_sysfs.o \ $(HDD_SRC_DIR)/wlan_hdd_trace.o \ @@ -71,6 +70,10 @@ HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_debugfs.o HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_debugfs_llstat.o endif +ifeq ($(CONFIG_WLAN_CONV_SPECTRAL_ENABLE),y) +HDD_OBJS += $(HDD_SRC_DIR)/wlan_hdd_spectralscan.o +endif + ifeq ($(CONFIG_WLAN_FEATURE_DSRC), y) HDD_OBJS+= $(HDD_SRC_DIR)/wlan_hdd_ocb.o endif @@ -513,6 +516,7 @@ UMAC_TARGET_SPECTRAL_INC := -I$(WLAN_COMMON_INC)/target_if/spectral UMAC_SPECTRAL_INC := -I$(WLAN_COMMON_INC)/$(UMAC_SPECTRAL_DISP_INC_DIR) \ -I$(WLAN_COMMON_INC)/$(UMAC_SPECTRAL_CORE_INC_DIR) \ -I$(WLAN_COMMON_INC)/target_if/direct_buf_rx/inc +ifeq ($(CONFIG_WLAN_CONV_SPECTRAL_ENABLE),y) UMAC_SPECTRAL_OBJS := $(UMAC_SPECTRAL_CORE_DIR)/spectral_offload.o \ $(UMAC_SPECTRAL_CORE_DIR)/spectral_common.o \ $(UMAC_SPECTRAL_DISP_DIR)/wlan_spectral_ucfg_api.o \ @@ -524,7 +528,7 @@ UMAC_SPECTRAL_OBJS := $(UMAC_SPECTRAL_CORE_DIR)/spectral_offload.o \ $(WLAN_COMMON_ROOT)/target_if/spectral/target_if_spectral_phyerr.o \ $(WLAN_COMMON_ROOT)/target_if/spectral/target_if_spectral.o \ $(WLAN_COMMON_ROOT)/target_if/spectral/target_if_spectral_sim.o - +endif ############# UMAC_GREEN_AP ############ UMAC_GREEN_AP_DIR := umac/green_ap UMAC_GREEN_AP_DISP_INC_DIR := $(UMAC_GREEN_AP_DIR)/dispatcher/inc @@ -1438,6 +1442,7 @@ OBJS += $(UMAC_DISP_OBJS) OBJS += $(UMAC_SCAN_OBJS) OBJS += $(UMAC_COMMON_OBJS) OBJS += $(WCFG_OBJS) + OBJS += $(UMAC_SPECTRAL_OBJS) ifeq ($(CONFIG_QCACLD_FEATURE_GREEN_AP), y) @@ -1481,7 +1486,6 @@ cppflags-$(CONFIG_SUPPORT_11AX) += -DSUPPORT_11AX cppflags-$(CONFIG_HDD_INIT_WITH_RTNL_LOCK) += -DCONFIG_HDD_INIT_WITH_RTNL_LOCK cppflags-$(CONFIG_CONVERGED_TDLS_ENABLE) += -DCONVERGED_TDLS_ENABLE cppflags-$(CONFIG_WLAN_CONV_SPECTRAL_ENABLE) += -DWLAN_CONV_SPECTRAL_ENABLE -cppflags-$(CONFIG_WLAN_SPECTRAL_ENABLE) += -DWLAN_SPECTRAL_ENABLE cppflags-$(CONFIG_WMI_CMD_STRINGS) += -DWMI_CMD_STRINGS cppflags-$(CONFIG_WLAN_DISABLE_EXPORT_SYMBOL) += -DWLAN_DISABLE_EXPORT_SYMBOL diff --git a/core/hdd/inc/wlan_hdd_spectralscan.h b/core/hdd/inc/wlan_hdd_spectralscan.h index 9abbbc1f2700..63fa1eec2536 100644 --- a/core/hdd/inc/wlan_hdd_spectralscan.h +++ b/core/hdd/inc/wlan_hdd_spectralscan.h @@ -26,6 +26,7 @@ #if !defined(WLAN_HDD_SPECTRALSCAN_H) #define WLAN_HDD_SPECTRALSCAN_H +#ifdef WLAN_CONV_SPECTRAL_ENABLE /* * enum spectral_scan_msg_type - spectral scan registration * @SPECTRAL_SCAN_REGISTER_REQ: spectral scan app register request @@ -185,7 +186,11 @@ int wlan_hdd_cfg80211_spectral_scan_get_status(struct wiphy *wiphy, struct wireless_dev *wdev, const void *data, int data_len); +#else +#define FEATURE_SPECTRAL_SCAN_VENDOR_COMMANDS +#endif +#if defined(CNSS_GENL) && defined(WLAN_CONV_SPECTRAL_ENABLE) /** * spectral_scan_activate_service() - Activate spectral scan message handler * @@ -195,5 +200,10 @@ int wlan_hdd_cfg80211_spectral_scan_get_status(struct wiphy *wiphy, * Return - 0 for success, non zero for failure */ int spectral_scan_activate_service(void); - +#else +static inline int spectral_scan_activate_service(void) +{ + return 0; +} +#endif #endif diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 6bb6e2bacc6f..09256a1db78d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -136,7 +136,6 @@ #endif #include "wlan_reg_ucfg_api.h" #include "wlan_ocb_ucfg_api.h" - #include #ifdef MODULE #define WLAN_MODULE_NAME module_name(THIS_MODULE) @@ -6638,7 +6637,7 @@ static int hdd_init_netlink_services(struct hdd_context *hdd_ctx) ret = spectral_scan_activate_service(); if (ret) { - hdd_alert("spectral_scan_activate_service failed: %d", ret); + hdd_err("spectral service initialization failed: %d", ret); goto err_close_cesium; } diff --git a/core/hdd/src/wlan_hdd_spectralscan.c b/core/hdd/src/wlan_hdd_spectralscan.c index f044d176fb1d..0dbd7d6c5fe1 100644 --- a/core/hdd/src/wlan_hdd_spectralscan.c +++ b/core/hdd/src/wlan_hdd_spectralscan.c @@ -359,7 +359,7 @@ int wlan_hdd_cfg80211_spectral_scan_get_status(struct wiphy *wiphy, return ret; } -#ifdef CNSS_GENL +#if defined(CNSS_GENL) && defined(WLAN_CONV_SPECTRAL_ENABLE) static void send_spectral_scan_reg_rsp_msg(struct hdd_context *hdd_ctx) { struct sk_buff *skb; @@ -479,9 +479,4 @@ int spectral_scan_activate_service(void) spectral_scan_msg_handler, NULL); return 0; } -#else -int spectral_scan_activate_service(void) -{ - return 0; -} #endif diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index 60e9b909daad..caf5403de257 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -1205,6 +1205,25 @@ QDF_STATUS sme_get_valid_channels(uint8_t *chan_list, uint32_t *list_len) return status; } +#ifdef WLAN_CONV_SPECTRAL_ENABLE +static QDF_STATUS sme_register_spectral_cb(tpAniSirGlobal mac_ctx) +{ + struct spectral_legacy_cbacks spectral_cb; + QDF_STATUS status; + + spectral_cb.vdev_get_chan_freq = sme_get_oper_chan_freq; + spectral_cb.vdev_get_ch_width = sme_get_oper_ch_width; + spectral_cb.vdev_get_sec20chan_freq_mhz = sme_get_sec20chan_freq_mhz; + status = spectral_register_legacy_cb(mac_ctx->psoc, &spectral_cb); + + return status; +} +#else +static QDF_STATUS sme_register_spectral_cb(tpAniSirGlobal mac_ctx) +{ + return QDF_STATUS_SUCCESS; +} +#endif /* * sme_start() - Put all SME modules at ready state. * The function starts each module in SME, PMC, CSR, etc. . Upon @@ -1220,7 +1239,6 @@ QDF_STATUS sme_start(tHalHandle hHal) QDF_STATUS status = QDF_STATUS_E_FAILURE; tpAniSirGlobal pMac = PMAC_STRUCT(hHal); struct policy_mgr_sme_cbacks sme_cbacks; - struct spectral_legacy_cbacks spectral_cb; do { status = csr_start(pMac); @@ -1246,10 +1264,7 @@ QDF_STATUS sme_start(tHalHandle hHal) status); break; } - spectral_cb.vdev_get_chan_freq = sme_get_oper_chan_freq; - spectral_cb.vdev_get_ch_width = sme_get_oper_ch_width; - spectral_cb.vdev_get_sec20chan_freq_mhz = sme_get_sec20chan_freq_mhz; - spectral_register_legacy_cb(pMac->psoc, &spectral_cb); + sme_register_spectral_cb(pMac); pMac->sme.state = SME_STATE_START; /* START RRM */ diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index e87e68d94800..548472ed1ab1 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2567,6 +2567,8 @@ static int wma_flush_complete_evt_handler(void *handle, WLAN_LOG_INDICATOR_FIRMWARE, reason_code); return QDF_STATUS_E_FAILURE; } + +#ifdef WLAN_CONV_SPECTRAL_ENABLE /** * wma_extract_single_phyerr_spectral() - extract single phy error from event * @handle: wma handle @@ -2783,7 +2785,8 @@ static QDF_STATUS wma_extract_single_phyerr_spectral(void *handle, * Return: QDF_STATUS */ static QDF_STATUS spectral_phyerr_event_handler(void *handle, - uint8_t *data, uint32_t datalen) + uint8_t *data, + uint32_t datalen) { tp_wma_handle wma = (tp_wma_handle) handle; QDF_STATUS status = QDF_STATUS_SUCCESS; @@ -2844,6 +2847,13 @@ static QDF_STATUS spectral_phyerr_event_handler(void *handle, return status; } +#else +static QDF_STATUS spectral_phyerr_event_handler(void *handle, + uint8_t *data, uint32_t datalen) +{ + return QDF_STATUS_SUCCESS; +} +#endif /** * dfs_phyerr_event_handler() - dfs phyerr event handler @@ -4113,6 +4123,22 @@ static void wma_send_time_stamp_sync_cmd(void *data) WMA_LOGE("Failed to start the firmware time sync timer"); } +#ifdef WLAN_CONV_SPECTRAL_ENABLE +static void wma_register_spectral_cmds(tp_wma_handle wma_handle) +{ + struct wmi_spectral_cmd_ops cmd_ops; + + cmd_ops.wmi_spectral_configure_cmd_send = + wmi_unified_vdev_spectral_configure_cmd_send; + cmd_ops.wmi_spectral_enable_cmd_send = + wmi_unified_vdev_spectral_enable_cmd_send; + wlan_register_wmi_spectral_cmd_ops(wma_handle->pdev, &cmd_ops); +} +#else +static void wma_register_spectral_cmds(tp_wma_handle wma_handle) +{ +} +#endif /** * wma_start() - wma start function. * Initialize event handlers and timers. @@ -4124,7 +4150,6 @@ QDF_STATUS wma_start(void) QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; tp_wma_handle wma_handle; int status; - struct wmi_spectral_cmd_ops cmd_ops; struct wmi_unified *wmi_handle; WMA_LOGD("%s: Enter", __func__); @@ -4372,12 +4397,7 @@ QDF_STATUS wma_start(void) qdf_status = QDF_STATUS_E_FAILURE; goto end; } - - cmd_ops.wmi_spectral_configure_cmd_send = - wmi_unified_vdev_spectral_configure_cmd_send; - cmd_ops.wmi_spectral_enable_cmd_send = - wmi_unified_vdev_spectral_enable_cmd_send; - wlan_register_wmi_spectral_cmd_ops(wma_handle->pdev, &cmd_ops); + wma_register_spectral_cmds(wma_handle); end: WMA_LOGD("%s: Exit", __func__);