فهرست منبع

qcacld-3.0: Add PLD API to get wifi kobject

Add PLD API to get wifi kobject.

Change-Id: I136d3f4abec831ab05058678beb23fe2e1b05d49
CRs-Fixed: 3264204
Sandeep Singh 2 سال پیش
والد
کامیت
ca38ac5038
3فایلهای تغییر یافته به همراه50 افزوده شده و 0 حذف شده
  1. 8 0
      core/pld/inc/pld_common.h
  2. 25 0
      core/pld/src/pld_common.c
  3. 17 0
      core/pld/src/pld_pcie.h

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

@@ -872,6 +872,14 @@ void *pld_smmu_get_mapping(struct device *dev);
 #endif
 int pld_smmu_map(struct device *dev, phys_addr_t paddr,
 		 uint32_t *iova_addr, size_t size);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0))
+struct kobject *pld_get_wifi_kobj(struct device *dev);
+#else
+static inline struct kobject *pld_get_wifi_kobj(struct device *dev)
+{
+	return NULL;
+}
+#endif
 #ifdef CONFIG_SMMU_S1_UNMAP
 int pld_smmu_unmap(struct device *dev,
 		   uint32_t iova_addr, size_t size);

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

@@ -2103,6 +2103,31 @@ void *pld_smmu_get_mapping(struct device *dev)
 }
 #endif
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0))
+struct kobject *pld_get_wifi_kobj(struct device *dev)
+{
+	enum pld_bus_type type = pld_get_bus_type(dev);
+	struct kobject *wifi_kobj = NULL;
+
+	switch (type) {
+	case PLD_BUS_TYPE_SNOC:
+	case PLD_BUS_TYPE_PCIE_FW_SIM:
+	case PLD_BUS_TYPE_IPCI_FW_SIM:
+	case PLD_BUS_TYPE_SNOC_FW_SIM:
+	case PLD_BUS_TYPE_IPCI:
+		break;
+	case PLD_BUS_TYPE_PCIE:
+		wifi_kobj = pld_pcie_get_wifi_kobj(dev);
+		break;
+	default:
+		pr_err("Invalid device type %d\n", type);
+		break;
+	}
+
+	return wifi_kobj;
+}
+#endif
+
 /**
  * pld_smmu_map() - Map SMMU
  * @dev: device

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

@@ -353,6 +353,11 @@ static inline int pld_pcie_get_pci_slot(struct device *dev)
 	return 0;
 }
 
+static inline struct kobject *pld_pcie_get_wifi_kobj(struct device *dev)
+{
+	return NULL;
+}
+
 static inline int pld_pcie_power_on(struct device *dev)
 {
 	return 0;
@@ -663,6 +668,18 @@ static inline int pld_pcie_get_pci_slot(struct device *dev)
 }
 #endif
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0))
+static inline struct kobject *pld_pcie_get_wifi_kobj(struct device *dev)
+{
+	return cnss_get_wifi_kobj(dev);
+}
+#else
+static inline struct kobject *pld_pcie_get_wifi_kobj(struct device *dev)
+{
+	return NULL;
+}
+#endif
+
 static inline int pld_pcie_power_on(struct device *dev)
 {
 	return cnss_power_up(dev);