qcacmn: Support WLAN IPA WDI 3.0 SMMU
Support WLAN IPA WDI 3.0 with SMMU-S1 enabled. Key design considerations are captured below. - ring base addresses are passed as struct sg_table and IPA driver will do the IOVA mapping to IPA domain. - ring doorbell addresses are passed as physical address and IPA driver will do the IOVA mapping to IPA domain. - TX/RX buffers need to be mapped to IPA domain by WLAN driver via ipa_wdi_create|release_smmu_mapping API. - IPA doorbell addresses returned from ipa_wdi_conn_pipes are DDR addresses and WLAN driver needs to do the IOVA mapping to WLAN domain. Change-Id: I2398df58c9a9d002af7035f239eda37a86f5d00f CRs-Fixed: 2422155
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "dp_types.h"
|
||||
#include "dp_rx.h"
|
||||
#include "dp_ipa.h"
|
||||
|
||||
/*
|
||||
* dp_rx_desc_pool_alloc() - create a pool of software rx_descs
|
||||
@@ -81,16 +82,22 @@ QDF_STATUS dp_rx_desc_pool_alloc(struct dp_soc *soc, uint32_t pool_id,
|
||||
void dp_rx_desc_pool_free(struct dp_soc *soc, uint32_t pool_id,
|
||||
struct rx_desc_pool *rx_desc_pool)
|
||||
{
|
||||
qdf_nbuf_t nbuf;
|
||||
int i;
|
||||
|
||||
qdf_spin_lock_bh(&rx_desc_pool->lock);
|
||||
for (i = 0; i < rx_desc_pool->pool_size; i++) {
|
||||
if (rx_desc_pool->array[i].rx_desc.in_use) {
|
||||
if (!(rx_desc_pool->array[i].rx_desc.unmapped))
|
||||
qdf_nbuf_unmap_single(soc->osdev,
|
||||
rx_desc_pool->array[i].rx_desc.nbuf,
|
||||
QDF_DMA_BIDIRECTIONAL);
|
||||
qdf_nbuf_free(rx_desc_pool->array[i].rx_desc.nbuf);
|
||||
nbuf = rx_desc_pool->array[i].rx_desc.nbuf;
|
||||
|
||||
if (!(rx_desc_pool->array[i].rx_desc.unmapped)) {
|
||||
dp_ipa_handle_rx_buf_smmu_mapping(soc, nbuf,
|
||||
false);
|
||||
|
||||
qdf_nbuf_unmap_single(soc->osdev, nbuf,
|
||||
QDF_DMA_BIDIRECTIONAL);
|
||||
}
|
||||
qdf_nbuf_free(nbuf);
|
||||
}
|
||||
}
|
||||
qdf_mem_free(rx_desc_pool->array);
|
||||
@@ -109,16 +116,23 @@ void dp_rx_desc_pool_free(struct dp_soc *soc, uint32_t pool_id,
|
||||
void dp_rx_desc_nbuf_pool_free(struct dp_soc *soc,
|
||||
struct rx_desc_pool *rx_desc_pool)
|
||||
{
|
||||
qdf_nbuf_t nbuf;
|
||||
int i;
|
||||
|
||||
qdf_spin_lock_bh(&rx_desc_pool->lock);
|
||||
for (i = 0; i < rx_desc_pool->pool_size; i++) {
|
||||
if (rx_desc_pool->array[i].rx_desc.in_use) {
|
||||
if (!(rx_desc_pool->array[i].rx_desc.unmapped))
|
||||
qdf_nbuf_unmap_single(soc->osdev,
|
||||
rx_desc_pool->array[i].rx_desc.nbuf,
|
||||
QDF_DMA_BIDIRECTIONAL);
|
||||
qdf_nbuf_free(rx_desc_pool->array[i].rx_desc.nbuf);
|
||||
nbuf = rx_desc_pool->array[i].rx_desc.nbuf;
|
||||
|
||||
if (!(rx_desc_pool->array[i].rx_desc.unmapped)) {
|
||||
dp_ipa_handle_rx_buf_smmu_mapping(soc, nbuf,
|
||||
false);
|
||||
|
||||
qdf_nbuf_unmap_single(soc->osdev, nbuf,
|
||||
QDF_DMA_BIDIRECTIONAL);
|
||||
}
|
||||
|
||||
qdf_nbuf_free(nbuf);
|
||||
}
|
||||
}
|
||||
qdf_spin_unlock_bh(&rx_desc_pool->lock);
|
||||
|
Reference in New Issue
Block a user