diff options
| author | Linux Build Service Account <lnxbuild@localhost> | 2017-02-15 12:18:44 -0700 |
|---|---|---|
| committer | Linux Build Service Account <lnxbuild@localhost> | 2017-02-15 12:18:44 -0700 |
| commit | 10f765f0243b0ef6f1ff260c78fa6d1b85f6cfe7 (patch) | |
| tree | 6c3311f9e96f4489f539a38f24d8c7a1b94e9558 | |
| parent | af4a1055becc4b16966ada2c9d6d6693fd7c39b5 (diff) | |
| parent | 9bf479daee9f736d2e1c3e2f8f864966585ab508 (diff) | |
Promotion of wlan-cmn.driver.lnx.1.0-00129.
CRs Change ID Subject
--------------------------------------------------------------------------------------------------------------
1114605 I8dec7da47766985ab0590f885b29f345f153cd08 qcacmn: Do IPA version based DMA coherent mask setting
688141 Ibb41a35c63ad8bf73e0b08a05d80c16af1c87e13 Release 5.1.0.27S
Change-Id: I64fe2025012bd4b4d8bc630febe2868ca051ce19
CRs-Fixed: 688141, 1114605
| -rw-r--r-- | VERSION.txt | 2 | ||||
| -rw-r--r-- | hif/inc/hif.h | 22 | ||||
| -rw-r--r-- | hif/src/snoc/if_snoc.c | 30 | ||||
| -rw-r--r-- | qdf/inc/qdf_util.h | 15 | ||||
| -rw-r--r-- | qdf/linux/src/i_qdf_util.h | 37 |
5 files changed, 98 insertions, 8 deletions
diff --git a/VERSION.txt b/VERSION.txt index e322bac67cc2..1cbbd76e196e 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1,2 +1,2 @@ -Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.27R +Current Component wlan-cmn.driver.lnx.1.0 version 5.1.0.27S Matches Component wlan-cld3.driver.lnx.1.1 version 5.1.0.22D diff --git a/hif/inc/hif.h b/hif/inc/hif.h index bd0c15a68d80..505ac0bcbf4f 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -43,6 +43,9 @@ extern "C" { #ifdef HIF_USB #include <linux/usb.h> #endif /* HIF_USB */ +#ifdef IPA_OFFLOAD +#include <linux/ipa.h> +#endif #define ENABLE_MBOX_DUMMY_SPACE_FEATURE 1 typedef struct htc_callbacks HTC_CALLBACKS; @@ -94,6 +97,11 @@ typedef void *hif_handle_t; #define TARGET_TYPE_ADRASTEA 19 #endif +#ifdef IPA_OFFLOAD +#define DMA_COHERENT_MASK_IPA_VER_3_AND_ABOVE 37 +#define DMA_COHERENT_MASK_BELOW_IPA_VER_3 32 +#endif + struct CE_state; #define CE_COUNT_MAX 12 @@ -621,6 +629,20 @@ void hif_vote_link_down(struct hif_opaque_softc *); void hif_vote_link_up(struct hif_opaque_softc *); bool hif_can_suspend_link(struct hif_opaque_softc *); +#ifdef IPA_OFFLOAD +/** + * hif_get_ipa_hw_type() - get IPA hw type + * + * This API return the IPA hw type. + * + * Return: IPA hw type + */ +static inline +enum ipa_hw_type hif_get_ipa_hw_type(void) +{ + return ipa_get_hw_type(); +} +#endif int hif_bus_resume(struct hif_opaque_softc *); /** * hif_bus_ealry_suspend() - stop non wmi tx traffic diff --git a/hif/src/snoc/if_snoc.c b/hif/src/snoc/if_snoc.c index 6c34f43122e1..62bc42ca6487 100644 --- a/hif/src/snoc/if_snoc.c +++ b/hif/src/snoc/if_snoc.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2015-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -41,6 +41,9 @@ #include <soc/qcom/icnss.h> #include "pld_common.h" #include "qdf_util.h" +#ifdef IPA_OFFLOAD +#include <uapi/linux/msm_ipa.h> +#endif /** * hif_disable_isr(): disable isr @@ -210,6 +213,25 @@ static inline int hif_snoc_get_target_type(struct hif_softc *ol_sc, return 0; } +#ifdef IPA_OFFLOAD +static int hif_set_dma_coherent_mask(struct device *dev) +{ + uint8_t addr_bits; + + if (hif_get_ipa_hw_type() < IPA_HW_v3_0) + addr_bits = DMA_COHERENT_MASK_BELOW_IPA_VER_3; + else + addr_bits = DMA_COHERENT_MASK_IPA_VER_3_AND_ABOVE; + + return qdf_set_dma_coherent_mask(dev, addr_bits); +} +#else +static int hif_set_dma_coherent_mask(struct device *dev) +{ + return qdf_set_dma_coherent_mask(dev, 37); +} +#endif + /** * hif_enable_bus(): hif_enable_bus * @dev: dev @@ -233,11 +255,7 @@ QDF_STATUS hif_snoc_enable_bus(struct hif_softc *ol_sc, return QDF_STATUS_E_NOMEM; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) - ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(37)); -#else - ret = dma_set_coherent_mask(dev, DMA_BIT_MASK(37)); -#endif + ret = hif_set_dma_coherent_mask(dev); if (ret) { HIF_ERROR("%s: failed to set dma mask error = %d", __func__, ret); diff --git a/qdf/inc/qdf_util.h b/qdf/inc/qdf_util.h index 5356ba89b2cb..2e14a5449230 100644 --- a/qdf/inc/qdf_util.h +++ b/qdf/inc/qdf_util.h @@ -498,4 +498,19 @@ bool qdf_is_group_addr(uint8_t *mac_addr) return false; } +/** + * qdf_set_dma_coherent_mask() - set max number of bits allowed in dma addr + * @dev: device pointer + * @addr_bits: max number of bits allowed in dma address + * + * This API sets the maximum allowed number of bits in the dma address. + * + * Return: 0 - success, non zero - failure + */ +static inline +int qdf_set_dma_coherent_mask(struct device *dev, uint8_t addr_bits) +{ + return __qdf_set_dma_coherent_mask(dev, addr_bits); +} + #endif /*_QDF_UTIL_H*/ diff --git a/qdf/linux/src/i_qdf_util.h b/qdf/linux/src/i_qdf_util.h index fbd2e8433f93..711fc3ebe261 100644 --- a/qdf/linux/src/i_qdf_util.h +++ b/qdf/linux/src/i_qdf_util.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -337,4 +337,39 @@ unsigned long __qdf_rounddown_pow_of_two(unsigned long n) return __rounddown_pow_of_two(n); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) + +/** + * __qdf_set_dma_coherent_mask() - set max number of bits allowed in dma addr + * @dev: device pointer + * @addr_bits: max number of bits allowed in dma address + * + * This API sets the maximum allowed number of bits in the dma address. + * + * Return: 0 - success, non zero - failure + */ +static inline +int __qdf_set_dma_coherent_mask(struct device *dev, uint8_t addr_bits) +{ + return dma_set_mask_and_coherent(dev, DMA_BIT_MASK(addr_bits)); +} + +#else + +/** + * __qdf_set_dma_coherent_mask() - set max number of bits allowed in dma addr + * @dev: device pointer + * @addr_bits: max number of bits allowed in dma address + * + * This API sets the maximum allowed number of bits in the dma address. + * + * Return: 0 - success, non zero - failure + */ +static inline +int __qdf_set_dma_coherent_mask(struct device *dev, uint8_t addr_bits) +{ + return dma_set_coherent_mask(dev, DMA_BIT_MASK(addr_bits)); +} +#endif + #endif /*_I_QDF_UTIL_H*/ |
