Parcourir la source

qcacmn: Add support to update user defined scan params

Add support to update the user defined scan params values.

Change-Id: I8a971b0fa0d119f58e3143ca6be9c5ea4ee47f52
CRs-Fixed: 1095299
Abhishek Singh il y a 8 ans
Parent
commit
2f1324678d

+ 24 - 0
umac/scan/dispatcher/inc/wlan_scan_public_structs.h

@@ -824,6 +824,30 @@ enum scan_cb_type {
  */
 struct pno_scan_req_params;
 
+/**
+ * struct scan_user_cfg - user configuration required for for scan
+ * @active_dwell: default active dwell time
+ * @passive_dwell:default passive dwell time
+ * @conc_active_dwell: default concurrent active dwell time
+ * @conc_passive_dwell: default concurrent passive dwell time
+ * @conc_max_rest_time: default concurrent max rest time
+ * @conc_min_rest_time: default concurrent min rest time
+ * @conc_idle_time: default concurrent idle time
+ * @scan_cache_aging_time: default scan cache aging time
+ * @scan_dwell_time_mode: Adaptive dweltime mode
+ */
+struct scan_user_cfg {
+	uint32_t active_dwell;
+	uint32_t passive_dwell;
+	uint32_t conc_active_dwell;
+	uint32_t conc_passive_dwell;
+	uint32_t conc_max_rest_time;
+	uint32_t conc_min_rest_time;
+	uint32_t conc_idle_time;
+	uint32_t scan_cache_aging_time;
+	enum scan_dwelltime_adaptive_mode scan_dwell_time_mode;
+};
+
 /**
  * update_beacon_cb() - cb to inform/update beacon
  * @psoc: psoc pointer

+ 10 - 0
umac/scan/dispatcher/inc/wlan_scan_ucfg_api.h

@@ -305,6 +305,16 @@ ucfg_scan_get_pdev_status(struct wlan_objmgr_pdev *pdev);
 QDF_STATUS ucfg_scan_register_bcn_cb(struct wlan_objmgr_psoc *psoc,
 	update_beacon_cb cb, enum scan_cb_type type);
 
+/*
+ * ucfg_scan_update_user_config() - Update scan cache user config
+ * @psoc: psoc
+ * @scan_cfg: scan user config
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc,
+	struct scan_user_cfg *scan_cfg);
+
 /*
  * ucfg_scan_init() - Scan module initialization API
  *

+ 30 - 0
umac/scan/dispatcher/src/wlan_scan_ucfg_api.c

@@ -685,6 +685,36 @@ ucfg_scan_register_unregister_bcn_cb(struct wlan_objmgr_psoc *psoc,
 			enable ? "Registering" : "Deregistering");
 }
 
+QDF_STATUS ucfg_scan_update_user_config(struct wlan_objmgr_psoc *psoc,
+	struct scan_user_cfg *scan_cfg)
+{
+	struct wlan_scan_obj *scan_obj;
+	struct scan_default_params *scan_def;
+
+	if (!psoc) {
+		scm_err("null psoc");
+		return QDF_STATUS_E_FAILURE;
+	}
+	scan_obj = wlan_psoc_get_scan_obj(psoc);
+	if (scan_obj == NULL) {
+		scm_err("Failed to get scan object");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	scan_def = &scan_obj->scan_def;
+	scan_def->active_dwell = scan_cfg->active_dwell;
+	scan_def->passive_dwell = scan_cfg->passive_dwell;
+	scan_def->conc_active_dwell = scan_cfg->conc_active_dwell;
+	scan_def->conc_passive_dwell = scan_cfg->conc_passive_dwell;
+	scan_def->conc_max_rest_time = scan_cfg->conc_max_rest_time;
+	scan_def->conc_min_rest_time = scan_cfg->conc_min_rest_time;
+	scan_def->conc_idle_time = scan_cfg->conc_idle_time;
+	scan_def->scan_cache_aging_time = scan_cfg->scan_cache_aging_time;
+	scan_def->adaptive_dwell_time_mode = scan_cfg->scan_dwell_time_mode;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS
 ucfg_scan_psoc_open(struct wlan_objmgr_psoc *psoc)
 {