* Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef TRS_SQE_UPDATE_H
#define TRS_SQE_UPDATE_H
#include "drv_type.h"
#include "ka_base_pub.h"
struct trs_dma_desc_addr_info {
u64 src_va;
u32 passid;
u32 sqid;
u32 sqeid;
u16 offset;
u16 size;
u32 pid;
};
enum trs_dma_type {
TRS_DMA_TYPE_SDMA = 0,
TRS_DMA_TYPE_PCIEDMA,
TRS_DMA_TYPE_MAX,
};
struct trs_pciedma_desc {
void *sq_addr;
u32 sq_tail;
};
struct trs_sdma_desc {
void *dst_addr;
};
struct trs_dma_desc {
enum trs_dma_type dma_type;
union {
struct trs_sdma_desc sdma_desc;
struct trs_pciedma_desc pciedma_desc;
};
};
int hal_kernel_sqe_update_desc_create(u32 devid, u32 tsid, struct trs_dma_desc_addr_info *addr_info,
struct trs_dma_desc *dma_desc);
void hal_kernel_sqe_update_desc_destroy(u32 devid, u32 tsid, u32 sqid);
int hal_kernel_trs_get_ssid(u32 devid, u32 tsid, int pid, u32 *passid);
int trs_sqe_update_init(u32 devid);
void trs_sqe_update_uninit(u32 devid);
int trs_sqe_update_desc_create(u32 devid, u32 tsid, struct trs_dma_desc_addr_info *addr_info,
struct trs_dma_desc *dma_desc, bool is_src_secure);
#endif