diff options
| author | Yuanyuan Liu <yuanliu@codeaurora.org> | 2016-12-01 10:59:29 -0800 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-12-05 21:51:40 -0800 |
| commit | 0f52f5557441f8b40664e09154257e6282a95585 (patch) | |
| tree | 63103f893c11be8dc0aa6a8c98cbb3ead0a48782 | |
| parent | 1c88fda3631202643da4eea60fa03fa5eec01ee4 (diff) | |
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
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 16 | ||||
| -rw-r--r-- | core/pld/inc/pld_common.h | 2 | ||||
| -rw-r--r-- | core/pld/src/pld_common.c | 12 | ||||
| -rw-r--r-- | core/pld/src/pld_snoc.h | 11 |
4 files changed, 29 insertions, 12 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 62b6794e7cd3..46bef0eb319b 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -7235,15 +7235,17 @@ QDF_STATUS hdd_register_for_sap_restart_with_channel_switch(void) #endif /** - * hdd_get_cnss_wlan_mac_buff() - API to query platform driver for MAC address + * hdd_get_platform_wlan_mac_buff() - API to query platform driver + * for MAC address * @dev: Device Pointer * @num: Number of Valid Mac address * * Return: Pointer to MAC address buffer */ -static uint8_t *hdd_get_cnss_wlan_mac_buff(struct device *dev, uint32_t *num) +static uint8_t *hdd_get_platform_wlan_mac_buff(struct device *dev, + uint32_t *num) { - return pld_common_get_wlan_mac_address(dev, num); + return pld_get_wlan_mac_address(dev, num); } /** @@ -7279,14 +7281,14 @@ static void hdd_populate_random_mac_addr(hdd_context_t *hdd_ctx, uint32_t num) } /** - * hdd_cnss_wlan_mac() - API to get mac addresses from cnss platform driver + * hdd_platform_wlan_mac() - API to get mac addresses from platform driver * @hdd_ctx: HDD Context * * API to get mac addresses from platform driver and update the driver * structures and configure FW with the base mac address. * Return: int */ -static int hdd_cnss_wlan_mac(hdd_context_t *hdd_ctx) +static int hdd_platform_wlan_mac(hdd_context_t *hdd_ctx) { uint32_t no_of_mac_addr, iter; uint32_t max_mac_addr = QDF_MAX_CONCURRENCY_PERSONA; @@ -7297,7 +7299,7 @@ static int hdd_cnss_wlan_mac(hdd_context_t *hdd_ctx) tSirMacAddr mac_addr; QDF_STATUS status; - addr = hdd_get_cnss_wlan_mac_buff(dev, &no_of_mac_addr); + addr = hdd_get_platform_wlan_mac_buff(dev, &no_of_mac_addr); if (no_of_mac_addr == 0 || !addr) { hdd_warn("Platform Driver Doesn't have wlan mac addresses"); @@ -7364,7 +7366,7 @@ static void hdd_initialize_mac_address(hdd_context_t *hdd_ctx) QDF_STATUS status; int ret; - ret = hdd_cnss_wlan_mac(hdd_ctx); + ret = hdd_platform_wlan_mac(hdd_ctx); if (ret == 0) return; diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h index 94854a79f390..a94c95954d6e 100644 --- a/core/pld/inc/pld_common.h +++ b/core/pld/inc/pld_common.h @@ -357,7 +357,7 @@ 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); +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 649b00680612..0c052f4d5c26 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -1513,7 +1513,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 @@ -1523,15 +1523,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 a57511a9f6f0..d3ea8c6a1c5c 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 |
