Эх сурвалжийг харах

qcacld-3.0: Relocate IE whitelist cfg items

Relocate IE whitelist config items to FW offload component.

Change-Id: Idcb665f4d6069c0723b0a8ae17e54d8cbe71239d
CRs-Fixed: 2316597
Dundi Raviteja 6 жил өмнө
parent
commit
2e01f751e0

+ 26 - 0
fw_offload/core/inc/wlan_fw_offload_main.h

@@ -83,14 +83,40 @@ struct wlan_fwol_thermal_temp {
 	uint16_t thermal_temp_max_level3;
 };
 
+/**
+ * struct wlan_fwol_ie_whitelist - Probe request IE whitelist config items
+ * ie_whitelist: IE whitelist flag
+ * ie_bitmap_0: IE bitmap 0
+ * ie_bitmap_1: IE bitmap 1
+ * ie_bitmap_2: IE bitmap 2
+ * ie_bitmap_3: IE bitmap 3
+ * ie_bitmap_4: IE bitmap 4
+ * ie_bitmap_5: IE bitmap 5
+ * ie_bitmap_6: IE bitmap 6
+ * ie_bitmap_7: IE bitmap 7
+ */
+struct wlan_fwol_ie_whitelist {
+	bool ie_whitelist;
+	uint32_t ie_bitmap_0;
+	uint32_t ie_bitmap_1;
+	uint32_t ie_bitmap_2;
+	uint32_t ie_bitmap_3;
+	uint32_t ie_bitmap_4;
+	uint32_t ie_bitmap_5;
+	uint32_t ie_bitmap_6;
+	uint32_t ie_bitmap_7;
+};
+
 /**
  * struct wlan_fwol_cfg - fwol config items
  * coex_config: coex config items
  * thermal_temp_cfg: Thermal temperature related config items
+ * ie_whitelist_cfg: IE Whitelist related config items
  */
 struct wlan_fwol_cfg {
 	struct wlan_fwol_coex_config coex_config;
 	struct wlan_fwol_thermal_temp thermal_temp_cfg;
+	struct wlan_fwol_ie_whitelist ie_whitelist_cfg;
 };
 
 /**

+ 22 - 6
fw_offload/core/src/wlan_fw_offload_main.c

@@ -29,8 +29,8 @@ struct wlan_fwol_psoc_obj *fwol_get_psoc_obj(struct wlan_objmgr_psoc *psoc)
 }
 
 static void
-fwol_update_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc,
-			       struct wlan_fwol_coex_config *coex_config)
+fwol_init_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc,
+			     struct wlan_fwol_coex_config *coex_config)
 {
 	coex_config->btc_mode = cfg_get(psoc, CFG_BTC_MODE);
 	coex_config->antenna_isolation = cfg_get(psoc, CFG_ANTENNA_ISOLATION);
@@ -55,8 +55,8 @@ fwol_update_coex_config_in_cfg(struct wlan_objmgr_psoc *psoc,
 }
 
 static void
-fwol_update_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc,
-				struct wlan_fwol_thermal_temp *thermal_temp)
+fwol_init_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc,
+			      struct wlan_fwol_thermal_temp *thermal_temp)
 {
 	thermal_temp->thermal_temp_min_level0 =
 				cfg_get(psoc, CFG_THERMAL_TEMP_MIN_LEVEL0);
@@ -76,6 +76,21 @@ fwol_update_thermal_temp_in_cfg(struct wlan_objmgr_psoc *psoc,
 				cfg_get(psoc, CFG_THERMAL_TEMP_MAX_LEVEL3);
 }
 
+static void
+fwol_init_ie_whiltelist_in_cfg(struct wlan_objmgr_psoc *psoc,
+			       struct wlan_fwol_ie_whitelist *whitelist)
+{
+	whitelist->ie_whitelist = cfg_get(psoc, CFG_PROBE_REQ_IE_WHITELIST);
+	whitelist->ie_bitmap_0 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP0);
+	whitelist->ie_bitmap_1 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP1);
+	whitelist->ie_bitmap_2 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP2);
+	whitelist->ie_bitmap_3 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP3);
+	whitelist->ie_bitmap_4 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP4);
+	whitelist->ie_bitmap_5 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP5);
+	whitelist->ie_bitmap_6 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP6);
+	whitelist->ie_bitmap_7 = cfg_get(psoc, CFG_PROBE_REQ_IE_BIT_MAP7);
+}
+
 QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
@@ -90,8 +105,9 @@ QDF_STATUS fwol_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
 
 	fwol_cfg = &fwol_obj->cfg;
 
-	fwol_update_coex_config_in_cfg(psoc, &fwol_cfg->coex_config);
-	fwol_update_thermal_temp_in_cfg(psoc, &fwol_cfg->thermal_temp_cfg);
+	fwol_init_coex_config_in_cfg(psoc, &fwol_cfg->coex_config);
+	fwol_init_thermal_temp_in_cfg(psoc, &fwol_cfg->thermal_temp_cfg);
+	fwol_init_ie_whiltelist_in_cfg(psoc, &fwol_cfg->ie_whitelist_cfg);
 
 	return status;
 }

+ 2 - 0
fw_offload/dispatcher/inc/cfg_fwol.h

@@ -25,9 +25,11 @@
 
 #include "cfg_coex.h"
 #include "cfg_thermal_temp.h"
+#include "cfg_ie_whitelist.h"
 
 #define CFG_FWOL_ALL \
 	CFG_COEX_ALL \
+	CFG_IE_WHITELIST \
 	CFG_THERMAL_TEMP_ALL
 
 #endif /* __CFG_FWOL_H */

+ 288 - 0
fw_offload/dispatcher/inc/cfg_ie_whitelist.h

@@ -0,0 +1,288 @@
+/*
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains centralized definitions of converged configuration.
+ */
+
+#ifndef __CFG_IE_WHITELIST_H
+#define __CFG_IE_WHITELIST_H
+
+/*
+ * <ini>
+ * g_enable_probereq_whitelist_ies - Enable IE white listing
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used to enable/disable probe request IE white listing feature.
+ * Values 0 and 1 are used to disable and enable respectively, by default this
+ * feature is disabled.
+ *
+ * Related: None
+ *
+ * Supported Feature: Probe request IE whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_WHITELIST CFG_INI_BOOL( \
+			"g_enable_probereq_whitelist_ies", \
+			0, \
+			"Enable IE whitelisting")
+
+/*
+ * For IE white listing in Probe Req, following ini parameters from
+ * g_probe_req_ie_bitmap_0 to g_probe_req_ie_bitmap_7 are used. User needs to
+ * input this values in hexa decimal format, when bit is set in bitmap,
+ * corresponding IE needs to be included in probe request.
+ *
+ * Example:
+ * ========
+ * If IE 221 needs to be in the probe request, set the corresponding bit
+ * as follows:
+ * a= IE/32 = 221/32 = 6 = g_probe_req_ie_bitmap_6
+ * b = IE modulo 32 = 29,
+ * means set the bth bit in g_probe_req_ie_bitmap_a,
+ * therefore set 29th bit in g_probe_req_ie_bitmap_6,
+ * as a result, g_probe_req_ie_bitmap_6=20000000
+ *
+ * Note: For IE 221, its mandatory to set the gProbeReqOUIs.
+ */
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_0 - Used to set the bitmap of IEs from 0 to 31
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 0 to 31 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP0 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_0", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 0")
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_1 - Used to set the bitmap of IEs from 32 to 63
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 32 to 63 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP1 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_1", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 1")
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_2 - Used to set the bitmap of IEs from 64 to 95
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 64 to 95 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP2 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_2", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 2")
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_3 - Used to set the bitmap of IEs from 96 to 127
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 96 to 127 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP3 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_3", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 3")
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_4 - Used to set the bitmap of IEs from 128 to 159
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 128 to 159 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP4 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_4", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 4")
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_5 - Used to set the bitmap of IEs from 160 to 191
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 160 to 191 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP5 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_5", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 5")
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_6 - Used to set the bitmap of IEs from 192 to 223
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 192 to 223 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP6 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_6", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 6")
+
+/*
+ * <ini>
+ * g_probe_req_ie_bitmap_7 - Used to set the bitmap of IEs from 224 to 255
+ * @Min: 0x00000000
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x00000000
+ *
+ * This ini is used to include the IEs from 224 to 255 in probe request,
+ * when corresponding bit is set.
+ *
+ * Related: Need to enable g_enable_probereq_whitelist_ies.
+ *
+ * Supported Feature: Probe request ie whitelisting
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_PROBE_REQ_IE_BIT_MAP7 CFG_INI_UINT( \
+			"g_probe_req_ie_bitmap_7", \
+			0x00000000, \
+			0xFFFFFFFF, \
+			0x00000000, \
+			CFG_VALUE_OR_DEFAULT, \
+			"IE Bitmap 7")
+
+#define CFG_IE_WHITELIST \
+	CFG(CFG_PROBE_REQ_IE_WHITELIST) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP0) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP1) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP2) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP3) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP4) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP5) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP6) \
+	CFG(CFG_PROBE_REQ_IE_BIT_MAP7)
+
+#endif

+ 39 - 0
fw_offload/dispatcher/inc/wlan_fwol_ucfg_api.h

@@ -89,4 +89,43 @@ QDF_STATUS
 ucfg_fwol_get_thermal_temp(struct wlan_objmgr_psoc *psoc,
 			   struct wlan_fwol_thermal_temp *thermal_temp);
 
+/**
+ * ucfg_fwol_get_ie_whitelist() - Get IE whitelist param value
+ * @psoc: Pointer to psoc object
+ * @ie_whitelist: Pointer to return the IE whitelist param value
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_fwol_get_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool *ie_whitelist);
+
+/**
+ * ucfg_fwol_set_ie_whitelist() - Set IE whitelist param value
+ * @psoc: Pointer to psoc object
+ * @ie_whitelist: Value to set IE whitelist param
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_fwol_set_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool ie_whitelist);
+
+/**
+ * ucfg_validate_ie_bitmaps() - Validate all IE whitelist bitmap param values
+ * @psoc: Pointer to psoc object
+ *
+ * Return: True if all bitmap values are valid, else false
+ */
+bool ucfg_validate_ie_bitmaps(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_fwol_get_all_whitelist_params() - Get all IE whitelist param values
+ * @psoc: Pointer to psoc object
+ * @whitelist: Pointer to struct wlan_fwol_ie_whitelist
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+ucfg_fwol_get_all_whitelist_params(struct wlan_objmgr_psoc *psoc,
+				   struct wlan_fwol_ie_whitelist *whitelist);
+
 #endif /* _WLAN_FWOL_UCFG_API_H_ */

+ 71 - 0
fw_offload/dispatcher/src/wlan_fwol_ucfg_api.c

@@ -182,3 +182,74 @@ ucfg_fwol_get_thermal_temp(struct wlan_objmgr_psoc *psoc,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+QDF_STATUS
+ucfg_fwol_get_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool *ie_whitelist)
+{
+	struct wlan_fwol_psoc_obj *fwol_obj;
+
+	fwol_obj = fwol_get_psoc_obj(psoc);
+	if (!fwol_obj) {
+		fwol_err("Failed to get fwol obj");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*ie_whitelist = fwol_obj->cfg.ie_whitelist_cfg.ie_whitelist;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+ucfg_fwol_set_ie_whitelist(struct wlan_objmgr_psoc *psoc, bool ie_whitelist)
+{
+	struct wlan_fwol_psoc_obj *fwol_obj;
+
+	fwol_obj = fwol_get_psoc_obj(psoc);
+	if (!fwol_obj) {
+		fwol_err("Failed to get fwol obj");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	fwol_obj->cfg.ie_whitelist_cfg.ie_whitelist = ie_whitelist;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+bool ucfg_validate_ie_bitmaps(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_fwol_psoc_obj *fwol_obj;
+	struct wlan_fwol_ie_whitelist whitelist = {0};
+
+	fwol_obj = fwol_get_psoc_obj(psoc);
+	if (!fwol_obj) {
+		fwol_err("Failed to get fwol obj");
+		return false;
+	}
+
+	whitelist = fwol_obj->cfg.ie_whitelist_cfg;
+
+	if (whitelist.ie_bitmap_0 && whitelist.ie_bitmap_1 &&
+	    whitelist.ie_bitmap_2 && whitelist.ie_bitmap_3 &&
+	    whitelist.ie_bitmap_4 && whitelist.ie_bitmap_5 &&
+	    whitelist.ie_bitmap_6 && whitelist.ie_bitmap_7)
+		return true;
+
+	return false;
+}
+
+QDF_STATUS
+ucfg_fwol_get_all_whitelist_params(struct wlan_objmgr_psoc *psoc,
+				   struct wlan_fwol_ie_whitelist *whitelist)
+{
+	struct wlan_fwol_psoc_obj *fwol_obj;
+
+	fwol_obj = fwol_get_psoc_obj(psoc);
+	if (!fwol_obj) {
+		fwol_err("Failed to get fwol obj");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	*whitelist = fwol_obj->cfg.ie_whitelist_cfg;
+
+	return QDF_STATUS_SUCCESS;
+}