diff --git a/core/hdd/src/wlan_hdd_ftm.c b/core/hdd/src/wlan_hdd_ftm.c index 54b90366af87..da03cf0548ca 100644 --- a/core/hdd/src/wlan_hdd_ftm.c +++ b/core/hdd/src/wlan_hdd_ftm.c @@ -48,6 +48,7 @@ #include "i_cds_packet.h" #include "cds_reg_service.h" #include "wlan_hdd_main.h" +#include "wlan_hdd_lpass.h" #include "qwlan_version.h" #include "wma_types.h" #include "cfg_api.h" @@ -56,7 +57,6 @@ #include "bmi.h" #include "ol_fw.h" #include "wlan_hdd_cfg80211.h" -#include "wlan_hdd_main.h" #include "hif.h" #endif @@ -114,18 +114,6 @@ static uint32_t wlan_ftm_postmsg(uint8_t *cmd_ptr, uint16_t cmd_len) return QDF_STATUS_SUCCESS; } -#ifdef WLAN_FEATURE_LPSS -static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, - hdd_context_t *hdd_ctx) -{ - cds_cfg->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; -} -#else -static inline void hdd_is_lpass_supported(struct cds_config_info *cds_cfg, - hdd_context_t *hdd_ctx) -{ } -#endif - /** * hdd_update_cds_config_ftm() - API to update cds configuration parameters * for FTM mode. @@ -138,17 +126,16 @@ int hdd_update_cds_config_ftm(hdd_context_t *hdd_ctx) { struct cds_config_info *cds_cfg; - cds_cfg = qdf_mem_malloc(sizeof(struct cds_config_info)); + cds_cfg = qdf_mem_malloc(sizeof(*cds_cfg)); if (!cds_cfg) { hdd_err("failed to allocate cds config"); return -ENOMEM; } - qdf_mem_zero(cds_cfg, sizeof(struct cds_config_info)); cds_cfg->driver_type = eDRIVER_TYPE_MFG; cds_cfg->powersave_offload_enabled = hdd_ctx->config->enablePowersaveOffload; - hdd_is_lpass_supported(cds_cfg, hdd_ctx); + hdd_lpass_populate_cds_config(cds_cfg, hdd_ctx); /* UMA is supported in hardware for performing the * frame translation 802.11 <-> 802.3 */ diff --git a/core/hdd/src/wlan_hdd_lpass.c b/core/hdd/src/wlan_hdd_lpass.c index 79bae7dfb649..75d8c88f8422 100644 --- a/core/hdd/src/wlan_hdd_lpass.c +++ b/core/hdd/src/wlan_hdd_lpass.c @@ -261,6 +261,22 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx) wlan_hdd_send_status_pkg(adapter, NULL, 1, 0); } +/** + * hdd_lpass_populate_cds_config() - Populate LPASS configuration + * @cds_config: CDS configuration to populate with lpass info + * @hdd_ctx: HDD global context which contains lpass information + * + * This function seeds the CDS configuration structure with + * lpass-specific information gleaned from the HDD context. + * + * Return: none + */ +void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, + struct hdd_context_s *hdd_ctx) +{ + cds_config->is_lpass_enabled = hdd_ctx->config->enable_lpass_support; +} + /** * hdd_lpass_notify_connect() - Notify LPASS of interface connect * @adapter: The adapter that connected diff --git a/core/hdd/src/wlan_hdd_lpass.h b/core/hdd/src/wlan_hdd_lpass.h index 043f305945fa..72e47988baa5 100644 --- a/core/hdd/src/wlan_hdd_lpass.h +++ b/core/hdd/src/wlan_hdd_lpass.h @@ -28,10 +28,24 @@ #if !defined(WLAN_HDD_LPASS_H) #define WLAN_HDD_LPASS_H +struct cds_config_info; struct hdd_context_s; struct hdd_adapter_s; #ifdef WLAN_FEATURE_LPSS +/** + * hdd_lpass_populate_cds_config() - Populate LPASS configuration + * @cds_config: CDS configuration to populate with lpass info + * @hdd_ctx: HDD global context which contains lpass information + * + * This function seeds the CDS configuration structure with + * lpass-specific information gleaned from the HDD context. + * + * Return: none + */ +void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, + struct hdd_context_s *hdd_ctx); + /** * hdd_lpass_notify_connect() - Notify LPASS of interface connect * @adapter: The adapter that connected @@ -87,6 +101,11 @@ void hdd_lpass_notify_start(struct hdd_context_s *hdd_ctx); */ void hdd_lpass_notify_stop(struct hdd_context_s *hdd_ctx); #else +static inline +void hdd_lpass_populate_cds_config(struct cds_config_info *cds_config, + struct hdd_context_s *hdd_ctx) +{ +} static inline void hdd_lpass_notify_connect(struct hdd_adapter_s *adapter) { } diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 78084a780c6a..41ae952854e6 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -6745,7 +6745,7 @@ int hdd_update_cds_config(hdd_context_t *hdd_ctx) hdd_ra_populate_cds_config(cds_cfg, hdd_ctx); hdd_txrx_populate_cds_config(cds_cfg, hdd_ctx); hdd_nan_populate_cds_config(cds_cfg, hdd_ctx); - + hdd_lpass_populate_cds_config(cds_cfg, hdd_ctx); cds_init_ini_config(cds_cfg); return 0; }