summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKomal Seelam <kseelam@codeaurora.org>2016-09-02 14:36:21 +0530
committerqcabuildsw <qcabuildsw@localhost>2016-10-17 21:58:05 -0700
commit355b1474f985cae3c84d6d152ebd0064d897009a (patch)
treea9b76df438ec6c476b0022370c85a7fabb44e317
parent81cb16678fbc0b5943053e0dbbe8623e202f3fca (diff)
qcacld-3.0: Use PLD API to query MAC Address from Platform Driver
Move CNSS API to PLD API to query WLAN MAC Address from Platform Driver Change-Id: I97724711cdf08824e0a46398284e40b798b4553d CRs-Fixed: 1063837
-rw-r--r--core/hdd/src/wlan_hdd_main.c10
-rw-r--r--core/pld/inc/pld_common.h1
-rw-r--r--core/pld/src/pld_common.c30
-rw-r--r--core/pld/src/pld_pcie.c1
-rw-r--r--core/pld/src/pld_pcie.h15
-rw-r--r--core/pld/src/pld_sdio.c1
-rw-r--r--core/pld/src/pld_sdio.h11
7 files changed, 57 insertions, 12 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index d480dab1f386..15d27321fe8c 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -7169,7 +7169,6 @@ QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void)
}
#endif
-#ifdef CONFIG_CNSS
/**
* hdd_get_cnss_wlan_mac_buff() - API to query platform driver for MAC address
* @dev: Device Pointer
@@ -7179,15 +7178,8 @@ QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void)
*/
static uint8_t *hdd_get_cnss_wlan_mac_buff(struct device *dev, uint32_t *num)
{
- return cnss_common_get_wlan_mac_address(dev, num);
+ return pld_common_get_wlan_mac_address(dev, num);
}
-#else
-static uint8_t *hdd_get_cnss_wlan_mac_buff(struct device *dev, uint32_t *num)
-{
- *num = 0;
- return NULL;
-}
-#endif
/**
* hdd_populate_random_mac_addr() - API to populate random mac addresses
diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h
index bcf647b0b1a4..5d24f7949753 100644
--- a/core/pld/inc/pld_common.h
+++ b/core/pld/inc/pld_common.h
@@ -379,4 +379,5 @@ void *pld_smmu_get_mapping(struct device *dev);
int pld_smmu_map(struct device *dev, phys_addr_t paddr,
uint32_t *iova_addr, size_t size);
unsigned int pld_socinfo_get_serial_number(struct device *dev);
+uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num);
#endif
diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c
index 737cc389c600..023e58324557 100644
--- a/core/pld/src/pld_common.c
+++ b/core/pld/src/pld_common.c
@@ -1544,3 +1544,33 @@ unsigned int pld_socinfo_get_serial_number(struct device *dev)
return ret;
}
+
+/*
+ * pld_common_get_wlan_mac_address() - API to query MAC address from Platform
+ * Driver
+ * @dev: Device Structure
+ * @num: Pointer to number of MAC address supported
+ *
+ * Platform Driver can have MAC address stored. This API needs to be used
+ * to get those MAC address
+ *
+ * Return: Pointer to the list of MAC address
+ */
+uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num)
+{
+ switch (pld_get_bus_type(dev)) {
+ case PLD_BUS_TYPE_PCIE:
+ return pld_pcie_get_wlan_mac_address(dev, num);
+ case PLD_BUS_TYPE_SDIO:
+ return pld_sdio_get_wlan_mac_address(dev, num);
+ case PLD_BUS_TYPE_USB:
+ case PLD_BUS_TYPE_SNOC:
+ break;
+ default:
+ pr_err("Invalid device type\n");
+ break;
+ }
+
+ *num = 0;
+ return NULL;
+}
diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c
index 54ff2e5cbec5..f95498154795 100644
--- a/core/pld/src/pld_pcie.c
+++ b/core/pld/src/pld_pcie.c
@@ -530,5 +530,4 @@ void pld_pcie_set_driver_status(enum pld_driver_status status)
cnss_set_driver_status(cnss_status);
}
#endif
-
#endif
diff --git a/core/pld/src/pld_pcie.h b/core/pld/src/pld_pcie.h
index e94c9f69ddcd..dfba7b4d2fe6 100644
--- a/core/pld/src/pld_pcie.h
+++ b/core/pld/src/pld_pcie.h
@@ -220,12 +220,20 @@ static inline int pld_pcie_power_off(struct device *dev)
{
return 0;
}
+
+static inline uint8_t *pld_pcie_get_wlan_mac_address(struct device *dev,
+ uint32_t *num)
+{
+ *num = 0;
+ return NULL;
+}
#else
int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
u32 target_type, u32 target_version);
int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg);
int pld_pcie_get_platform_cap(struct pld_platform_cap *cap);
void pld_pcie_set_driver_status(enum pld_driver_status status);
+
static inline void pld_pcie_link_down(void)
{
cnss_wlan_pci_link_down();
@@ -304,6 +312,11 @@ static inline int pld_pcie_power_off(struct device *dev)
{
return cnss_power_down(dev);
}
-#endif
+static inline uint8_t *pld_pcie_get_wlan_mac_address(struct device *dev,
+ uint32_t *num)
+{
+ return cnss_common_get_wlan_mac_address(dev, num);
+}
+#endif
#endif
diff --git a/core/pld/src/pld_sdio.c b/core/pld/src/pld_sdio.c
index 8bd37115fcb1..14b17f989b26 100644
--- a/core/pld/src/pld_sdio.c
+++ b/core/pld/src/pld_sdio.c
@@ -380,6 +380,5 @@ int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files,
return 0;
}
-
#endif
#endif
diff --git a/core/pld/src/pld_sdio.h b/core/pld/src/pld_sdio.h
index 619b3134b740..0f6786256dff 100644
--- a/core/pld/src/pld_sdio.h
+++ b/core/pld/src/pld_sdio.h
@@ -65,11 +65,22 @@ int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files,
{
return 0;
}
+static inline uint8_t *pld_sdio_get_wlan_mac_address(struct device *dev,
+ uint32_t *num)
+{
+ *num = 0;
+ return NULL;
+}
#else
int pld_sdio_register_driver(void);
void pld_sdio_unregister_driver(void);
int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files,
u32 target_type, u32 target_version);
+static inline uint8_t *pld_sdio_get_wlan_mac_address(struct device *dev,
+ uint32_t *num)
+{
+ return cnss_common_get_wlan_mac_address(dev, num);
+}
#endif
#endif