Browse Source

qcacld-3.0: Support one MSI vector dynamically

In some platform IRQ allocation may be failed because it can't support
so many MSI vectors. Driver can't be loaded in this platform.

Implement one MSI vector dynamic support. MSI vector number is defined
in platform driver, so add platform API to show whether platform is in
one MSI vector mode or not.

Change-Id: I5e87ec456b654701a195c793087f078cf7647a3c
CRs-Fixed: 3290815
Bing Sun 2 years ago
parent
commit
d23a0adbcb
3 changed files with 40 additions and 0 deletions
  1. 7 0
      core/pld/inc/pld_common.h
  2. 16 0
      core/pld/src/pld_common.c
  3. 17 0
      core/pld/src/pld_pcie.h

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

@@ -1250,4 +1250,11 @@ static inline bool pld_get_enable_intx(struct device *dev)
 	return false;
 }
 
+/**
+ * pld_is_one_msi()- whether one MSI is used or not
+ * @dev: device structure
+ *
+ * Return: true if it is one MSI
+ */
+bool pld_is_one_msi(struct device *dev);
 #endif

+ 16 - 0
core/pld/src/pld_common.c

@@ -3391,3 +3391,19 @@ int pld_get_audio_wlan_timestamp(struct device *dev,
 	return ret;
 }
 #endif /* FEATURE_WLAN_TIME_SYNC_FTM */
+
+bool pld_is_one_msi(struct device *dev)
+{
+	bool ret = false;
+	enum pld_bus_type type = pld_get_bus_type(dev);
+
+	switch (type) {
+	case PLD_BUS_TYPE_PCIE:
+		ret = pld_pcie_is_one_msi(dev);
+		break;
+	default:
+		break;
+	}
+
+	return ret;
+}

+ 17 - 0
core/pld/src/pld_pcie.h

@@ -412,6 +412,11 @@ static inline int pld_pcie_get_msi_irq(struct device *dev, unsigned int vector)
 	return 0;
 }
 
+static inline bool pld_pcie_is_one_msi(struct device *dev)
+{
+	return false;
+}
+
 static inline void pld_pcie_get_msi_address(struct device *dev,
 					    uint32_t *msi_addr_low,
 					    uint32_t *msi_addr_high)
@@ -702,6 +707,18 @@ static inline int pld_pcie_get_msi_irq(struct device *dev, unsigned int vector)
 	return cnss_get_msi_irq(dev, vector);
 }
 
+#ifdef WLAN_ONE_MSI_VECTOR
+static inline bool pld_pcie_is_one_msi(struct device *dev)
+{
+	return cnss_is_one_msi(dev);
+}
+#else
+static inline bool pld_pcie_is_one_msi(struct device *dev)
+{
+	return false;
+}
+#endif
+
 static inline void pld_pcie_get_msi_address(struct device *dev,
 					    uint32_t *msi_addr_low,
 					    uint32_t *msi_addr_high)