#include "qat_utils.h"
#include "cpa.h"
#include "icp_accel_devices.h"
#include "icp_adf_init.h"
#include "icp_adf_transport.h"
#include "icp_adf_debug.h"
#include "icp_sal_iommu.h"
#include "lac_mem.h"
#include "lac_mem_pools.h"
#include "lac_common.h"
#include "lac_list.h"
#include "icp_qat_fw_la.h"
#include "lac_sal_types.h"
#define MAX_BUFFER_SIZE (LAC_BITS_TO_BYTES(4096))
CpaStatus
icp_LacBufferRestore(Cpa8U *pUserBuffer,
Cpa32U userLen,
Cpa8U *pWorkingBuffer,
Cpa32U workingLen,
CpaBoolean copyBuf)
{
Cpa32U padSize = 0;
if (NULL == pWorkingBuffer) {
return CPA_STATUS_SUCCESS;
}
if (workingLen < userLen) {
QAT_UTILS_LOG("Invalid buffer sizes\n");
return CPA_STATUS_INVALID_PARAM;
}
if (pUserBuffer != pWorkingBuffer) {
if (CPA_TRUE == copyBuf) {
padSize = workingLen - userLen;
memcpy(pUserBuffer, pWorkingBuffer + padSize, userLen);
}
Lac_MemPoolEntryFree(pWorkingBuffer);
}
return CPA_STATUS_SUCCESS;
}
CpaPhysicalAddr
SalMem_virt2PhysExternal(void *pVirtAddr, void *pServiceGen)
{
sal_service_t *pService = (sal_service_t *)pServiceGen;
if (NULL != pService->virt2PhysClient) {
return pService->virt2PhysClient(pVirtAddr);
} else {
return LAC_OS_VIRT_TO_PHYS_INTERNAL(pVirtAddr);
}
}
size_t
icp_sal_iommu_get_remap_size(size_t size)
{
return size;
}
CpaStatus
icp_sal_iommu_map(Cpa64U phaddr, Cpa64U iova, size_t size)
{
return CPA_STATUS_SUCCESS;
}
CpaStatus
icp_sal_iommu_unmap(Cpa64U iova, size_t size)
{
return CPA_STATUS_SUCCESS;
}