Browse Source

qcacmn: enable/disable PPEDS per WLAN soc

Enable or Disable PPEDS for specific
WLAN Soc.

usage:
add "ppeds_wifi_soc_cfg=0x02"
in /ini/global_i.ini to enable
PPEDS only for second WLAN SoC.

Change-Id: I65f138cf37298feac70e76b95c22507e58394618
CRs-Fixed: 3408439
Nitin Shetty 2 years ago
parent
commit
0be3bb02d9
2 changed files with 36 additions and 1 deletions
  1. 13 1
      wlan_cfg/cfg_dp.h
  2. 23 0
      wlan_cfg/wlan_cfg.c

+ 13 - 1
wlan_cfg/cfg_dp.h

@@ -509,6 +509,10 @@
 #define WLAN_CFG_DP_NAPI_SCALE_FACTOR_MIN 0
 #define WLAN_CFG_DP_NAPI_SCALE_FACTOR_MAX 4
 
+#define CFG_DP_PPEDS_WIFI_SOC_CFG_NONE 0
+#define CFG_DP_PPEDS_WIFI_SOC_CFG_ALL 0xFF
+#define CFG_DP_PPEDS_WIFI_SOC_CFG_DEFAULT 0xFF
+
 #ifdef CONFIG_SAWF_STATS
 #define WLAN_CFG_SAWF_STATS 0x0
 #define WLAN_CFG_SAWF_STATS_MIN 0x0
@@ -1742,13 +1746,21 @@
 		WLAN_CFG_PPE2TCL_RING_SIZE, \
 		CFG_VALUE_OR_DEFAULT, "DP PPE2TCL rings")
 
+#define CFG_DP_PPEDS_WIFI_SOC_CFG \
+		CFG_INI_UINT("ppeds_wifi_soc_cfg", \
+		CFG_DP_PPEDS_WIFI_SOC_CFG_NONE, \
+		CFG_DP_PPEDS_WIFI_SOC_CFG_ALL, \
+		CFG_DP_PPEDS_WIFI_SOC_CFG_DEFAULT, \
+		CFG_VALUE_OR_DEFAULT, "PPEDS enable per WiFi SoC")
+
 #define CFG_DP_PPEDS_CONFIG \
 		CFG(CFG_DP_PPEDS_TX_CMP_NAPI_BUDGET) \
 		CFG(CFG_DP_PPEDS_TX_DESC_HOTLIST_LEN) \
 		CFG(CFG_DP_PPEDS_TX_DESC) \
 		CFG(CFG_DP_PPEDS_ENABLE) \
 		CFG(CFG_DP_REO2PPE_RING) \
-		CFG(CFG_DP_PPE2TCL_RING)
+		CFG(CFG_DP_PPE2TCL_RING) \
+		CFG(CFG_DP_PPEDS_WIFI_SOC_CFG)
 #else
 #define CFG_DP_PPEDS_CONFIG
 #define WLAN_CFG_NUM_PPEDS_TX_DESC_MAX 0

+ 23 - 0
wlan_cfg/wlan_cfg.c

@@ -2664,7 +2664,30 @@ static void
 wlan_soc_ppe_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
 			struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx)
 {
+	uint32_t ppeds_cfg;
+	uint8_t psoc_id;
+
+	/*
+	 * The CFG_DP_PPEDS_WIFI_SOC_CFG provides WLAN SoC level PPEDS
+	 * enable/disable support. The bit map position corresponds to
+	 * WLAN SoC position in config/wireless file. With this we can
+	 * configure PPEDS for multiple WLAN SoC having same device ID.
+	 */
+	psoc_id = wlan_psoc_get_id((struct wlan_objmgr_psoc *)psoc);
+	ppeds_cfg = cfg_get(psoc, CFG_DP_PPEDS_WIFI_SOC_CFG);
+	if (!(ppeds_cfg & (1 << psoc_id))) {
+		dp_info("ppeds_cfg is disabled for psoc_id  %d", psoc_id);
+		return;
+	}
+
+	/*
+	 * The CFG_DP_PPEDS_ENABLE provides ppeds enable/disable support
+	 * based on device ID in corresponding INI file.
+	 */
 	wlan_cfg_ctx->ppeds_enable = cfg_get(psoc, CFG_DP_PPEDS_ENABLE);
+	if (!wlan_cfg_ctx->ppeds_enable)
+		return;
+
 	wlan_cfg_ctx->reo2ppe_ring = cfg_get(psoc, CFG_DP_REO2PPE_RING);
 	wlan_cfg_ctx->ppe2tcl_ring = cfg_get(psoc, CFG_DP_PPE2TCL_RING);
 	wlan_cfg_ctx->ppeds_num_tx_desc = cfg_get(psoc, CFG_DP_PPEDS_TX_DESC);