summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnson <jjohnson@codeaurora.org>2016-09-23 17:18:11 -0700
committerqcabuildsw <qcabuildsw@localhost>2016-10-03 16:48:47 -0700
commit9078bdcb27cf34d98c4028e36e7e23dab22ffc45 (patch)
tree6222543b4916443bc3c738004c5de5be69ec6981
parent7139669405bdf794479cf199ad95c37d74bfc8d0 (diff)
qcacld-3.0: Refactor HDD LPASS "populate CDS config" logic
Previously "qcacld-3.0: Refactor WLAN_FEATURE_LPSS" refactored some of the HDD LPASS logic. Continue that process by refactoring the "populate CDS config" logic such that the actual implementation is in the lpass feature file. Change-Id: I3dada0d446a994862f70392f8ebf5911bda583da CRs-Fixed: 1070700
-rw-r--r--core/hdd/src/wlan_hdd_ftm.c19
-rw-r--r--core/hdd/src/wlan_hdd_lpass.c16
-rw-r--r--core/hdd/src/wlan_hdd_lpass.h19
-rw-r--r--core/hdd/src/wlan_hdd_main.c2
4 files changed, 39 insertions, 17 deletions
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
@@ -262,6 +262,22 @@ static void wlan_hdd_send_all_scan_intf_info(struct hdd_context_s *hdd_ctx)
}
/**
+ * 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,11 +28,25 @@
#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;
}