qcacld-3.0: Use new API pld_smmu_get_domain
Use new API pld_smmu_get_domain in place of pld_smmu_get_mapping, which is to be deprecated. Change-Id: I7a083cd3c0deecdbf774b57121866cd72fc157dc Crs-Fixed: 2464850
This commit is contained in:

zatwierdzone przez
nshrivas

rodzic
ac67d926a0
commit
65bdb19143
@@ -2740,6 +2740,54 @@ void cds_incr_arp_stats_tx_tgt_acked(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_SMMU_S1_TRANSLATION
|
#ifdef ENABLE_SMMU_S1_TRANSLATION
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
||||||
|
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
||||||
|
{
|
||||||
|
struct iommu_domain *domain;
|
||||||
|
bool ipa_smmu_enabled;
|
||||||
|
bool wlan_smmu_enabled;
|
||||||
|
|
||||||
|
domain = pld_smmu_get_domain(osdev->dev);
|
||||||
|
if (domain) {
|
||||||
|
int attr = 0;
|
||||||
|
int errno = iommu_domain_get_attr(domain,
|
||||||
|
DOMAIN_ATTR_S1_BYPASS, &attr);
|
||||||
|
|
||||||
|
wlan_smmu_enabled = !errno && !attr;
|
||||||
|
} else {
|
||||||
|
cds_info("No SMMU mapping present");
|
||||||
|
wlan_smmu_enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!wlan_smmu_enabled) {
|
||||||
|
osdev->smmu_s1_enabled = false;
|
||||||
|
goto exit_with_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ipa_present) {
|
||||||
|
osdev->smmu_s1_enabled = true;
|
||||||
|
goto exit_with_success;
|
||||||
|
}
|
||||||
|
|
||||||
|
ipa_smmu_enabled = qdf_get_ipa_smmu_enabled();
|
||||||
|
|
||||||
|
osdev->smmu_s1_enabled = ipa_smmu_enabled && wlan_smmu_enabled;
|
||||||
|
if (ipa_smmu_enabled != wlan_smmu_enabled) {
|
||||||
|
cds_err("SMMU mismatch; IPA:%s, WLAN:%s",
|
||||||
|
ipa_smmu_enabled ? "enabled" : "disabled",
|
||||||
|
wlan_smmu_enabled ? "enabled" : "disabled");
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
exit_with_success:
|
||||||
|
osdev->domain = domain;
|
||||||
|
|
||||||
|
cds_info("SMMU S1 %s", osdev->smmu_s1_enabled ? "enabled" : "disabled");
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
||||||
{
|
{
|
||||||
struct dma_iommu_mapping *mapping;
|
struct dma_iommu_mapping *mapping;
|
||||||
@@ -2785,6 +2833,7 @@ exit_with_success:
|
|||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef IPA_OFFLOAD
|
#ifdef IPA_OFFLOAD
|
||||||
int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
|
int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
|
||||||
@@ -2798,6 +2847,14 @@ int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0))
|
||||||
|
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
||||||
|
{
|
||||||
|
osdev->smmu_s1_enabled = false;
|
||||||
|
osdev->domain = NULL;
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
||||||
{
|
{
|
||||||
@@ -2805,6 +2862,7 @@ QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present)
|
|||||||
osdev->iommu_mapping = NULL;
|
osdev->iommu_mapping = NULL;
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
|
int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user