Explorar o código

qcacld-3.0: Fix compilation error when shadow config v3 is unsupported

For targets not supporting shadow config v3, the compilation
may fail since the definition for shadow config v3 will not
be available.

Featurize the shadow config v3 properly to avoid any
compilation errors for targets not supporting this feature.

Change-Id: I6d968ff98776159319ec5edad1ada1b6d888f87e
CRs-Fixed: 3214412
Rakesh Pillai %!s(int64=2) %!d(string=hai) anos
pai
achega
a3392b9562
Modificáronse 2 ficheiros con 22 adicións e 3 borrados
  1. 4 0
      core/pld/inc/pld_common.h
  2. 18 3
      core/pld/src/pld_pcie.c

+ 4 - 0
core/pld/inc/pld_common.h

@@ -297,9 +297,11 @@ struct pld_shadow_reg_v2_cfg {
 	u32 addr;
 };
 
+#ifdef CONFIG_SHADOW_V3
 struct pld_shadow_reg_v3_cfg {
 	u32 addr;
 };
+#endif
 
 /**
  * struct pld_rri_over_ddr_cfg_s - rri_over_ddr configuration
@@ -341,8 +343,10 @@ struct pld_wlan_enable_cfg {
 	struct pld_shadow_reg_v2_cfg *shadow_reg_v2_cfg;
 	bool rri_over_ddr_cfg_valid;
 	struct pld_rri_over_ddr_cfg rri_over_ddr_cfg;
+#ifdef CONFIG_SHADOW_V3
 	u32 num_shadow_reg_v3_cfg;
 	struct pld_shadow_reg_v3_cfg *shadow_reg_v3_cfg;
+#endif
 };
 
 /**

+ 18 - 3
core/pld/src/pld_pcie.c

@@ -804,6 +804,22 @@ int pld_pcie_get_ce_id(struct device *dev, int irq)
 }
 
 #ifdef CONFIG_PLD_PCIE_CNSS
+#ifdef CONFIG_SHADOW_V3
+static inline void
+pld_pcie_populate_shadow_v3_cfg(struct cnss_wlan_enable_cfg *cfg,
+				struct pld_wlan_enable_cfg *config)
+{
+	cfg->num_shadow_reg_v3_cfg = config->num_shadow_reg_v3_cfg;
+	cfg->shadow_reg_v3_cfg = (struct cnss_shadow_reg_v3_cfg *)
+				 config->shadow_reg_v3_cfg;
+}
+#else
+static inline void
+pld_pcie_populate_shadow_v3_cfg(struct cnss_wlan_enable_cfg *cfg,
+				struct pld_wlan_enable_cfg *config)
+{
+}
+#endif
 /**
  * pld_pcie_wlan_enable() - Enable WLAN
  * @dev: device
@@ -842,9 +858,8 @@ int pld_pcie_wlan_enable(struct device *dev, struct pld_wlan_enable_cfg *config,
 		cfg.rri_over_ddr_cfg.base_addr_high =
 			 config->rri_over_ddr_cfg.base_addr_high;
 	}
-	cfg.num_shadow_reg_v3_cfg = config->num_shadow_reg_v3_cfg;
-	cfg.shadow_reg_v3_cfg = (struct cnss_shadow_reg_v3_cfg *)
-		config->shadow_reg_v3_cfg;
+
+	pld_pcie_populate_shadow_v3_cfg(&cfg, config);
 
 	switch (mode) {
 	case PLD_FTM: