summaryrefslogtreecommitdiff
path: root/core/pld
diff options
context:
space:
mode:
authorYuanyuan Liu <yuanliu@codeaurora.org>2016-12-01 10:59:29 -0800
committerqcabuildsw <qcabuildsw@localhost>2016-12-05 21:51:46 -0800
commit7145eb2383d13d0096b57331fb485cb133749c55 (patch)
tree7ae480e8a9a79e4dcd9dfbdf02c1422cf6630877 /core/pld
parentf0088926368807d9b29783ef97c5dbcf166ce260 (diff)
downloadqcacld-7145eb2383d13d0096b57331fb485cb133749c55.tar.gz
qcacld-3.0: Add support of getting MAC address from platform driver
Add support of getting WLAN MAC address from ICNSS platform driver. Change-Id: Ie31d9147e8dc4e11e14a6fdf93200122acbb4000 CRs-Fixed: 1096290
Diffstat (limited to 'core/pld')
-rw-r--r--core/pld/inc/pld_common.h2
-rw-r--r--core/pld/src/pld_common.c12
-rw-r--r--core/pld/src/pld_snoc.h11
3 files changed, 20 insertions, 5 deletions
diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h
index 22e08bca0d..37cc3605e5 100644
--- a/core/pld/inc/pld_common.h
+++ b/core/pld/inc/pld_common.h
@@ -363,7 +363,7 @@ int pld_get_msi_irq(struct device *dev, unsigned int vector);
void pld_get_msi_address(struct device *dev, uint32_t *msi_addr_low,
uint32_t *msi_addr_high);
unsigned int pld_socinfo_get_serial_number(struct device *dev);
-uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num);
+uint8_t *pld_get_wlan_mac_address(struct device *dev, uint32_t *num);
int pld_is_qmi_disable(struct device *dev);
#endif
diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c
index a82d595fbd..bb6acbf8ad 100644
--- a/core/pld/src/pld_common.c
+++ b/core/pld/src/pld_common.c
@@ -1630,7 +1630,7 @@ unsigned int pld_socinfo_get_serial_number(struct device *dev)
}
/*
- * pld_common_get_wlan_mac_address() - API to query MAC address from Platform
+ * pld_get_wlan_mac_address() - API to query MAC address from Platform
* Driver
* @dev: Device Structure
* @num: Pointer to number of MAC address supported
@@ -1640,15 +1640,19 @@ unsigned int pld_socinfo_get_serial_number(struct device *dev)
*
* Return: Pointer to the list of MAC address
*/
-uint8_t *pld_common_get_wlan_mac_address(struct device *dev, uint32_t *num)
+uint8_t *pld_get_wlan_mac_address(struct device *dev, uint32_t *num)
{
- switch (pld_get_bus_type(dev)) {
+ enum pld_bus_type type = pld_get_bus_type(dev);
+
+ switch (type) {
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:
+ return pld_snoc_get_wlan_mac_address(dev, num);
+ case PLD_BUS_TYPE_USB:
+ pr_err("Not supported on type %d\n", type);
break;
default:
pr_err("Invalid device type\n");
diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h
index a57511a9f6..d3ea8c6a1c 100644
--- a/core/pld/src/pld_snoc.h
+++ b/core/pld/src/pld_snoc.h
@@ -139,6 +139,12 @@ static inline int pld_snoc_is_qmi_disable(void)
{
return 0;
}
+static inline uint8_t *pld_snoc_get_wlan_mac_address(struct device *dev,
+ uint32_t *num)
+{
+ *num = 0;
+ return NULL;
+}
#else
int pld_snoc_register_driver(void);
void pld_snoc_unregister_driver(void);
@@ -231,5 +237,10 @@ static inline int pld_snoc_is_qmi_disable(void)
{
return icnss_is_qmi_disable();
}
+static inline uint8_t *pld_snoc_get_wlan_mac_address(struct device *dev,
+ uint32_t *num)
+{
+ return icnss_get_wlan_mac_address(dev, num);
+}
#endif
#endif