You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.7 KiB
72 lines
1.7 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2020-2021. All rights reserved.
|
|
* Description: DiSEqC mpi interface
|
|
* Author: Hisilicon
|
|
* Create: 2020-09-17
|
|
*/
|
|
|
|
#include "mpi_frontend_ext.h"
|
|
|
|
#include <sys/ioctl.h>
|
|
#include "soc_log.h"
|
|
#include "td_type.h"
|
|
#include "soc_errno.h"
|
|
|
|
#include "mpi_frontend.h"
|
|
#include "mpi_diseqc.h"
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
#endif /* __cplusplus */
|
|
|
|
td_s32 ext_mpi_frontend_diseqc_send_message(fe_ioctrl_diseqc_sendmsg fe_drv_send_msg)
|
|
{
|
|
td_s32 ret;
|
|
|
|
if (fe_drv_send_msg.port >= MPI_DISEQC_NUM) {
|
|
soc_log_err("Input parameter(fe_drv_send_msg.port) invalid.\n");
|
|
soc_err_print_u32(fe_drv_send_msg.port);
|
|
return SOC_ERR_FRONTEND_INVALID_PARA;
|
|
}
|
|
|
|
ret = ioctl(frontend_get_fd(), FRONTEND_DISEQC_SEND_MSG_CMD, &fe_drv_send_msg);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("FRONTEND_DISEQC_SEND_MSG_CMD error.\n");
|
|
return ret;
|
|
}
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
td_s32 ext_mpi_frontend_diseqc_recv_message(fe_ioctrl_diseqc_recvmsg *fe_drv_recv_msg)
|
|
{
|
|
td_s32 ret;
|
|
|
|
if (fe_drv_recv_msg == TD_NULL) {
|
|
soc_log_err("Input parameter(fe_drv_recv_msg) is TD_NULL.\n");
|
|
return SOC_ERR_FRONTEND_INVALID_POINT;
|
|
}
|
|
|
|
if (fe_drv_recv_msg->port >= MPI_DISEQC_NUM) {
|
|
soc_log_err("Input parameter(fe_drv_recv_msg->port) invalid.\n");
|
|
soc_err_print_u32(fe_drv_recv_msg->port);
|
|
return SOC_ERR_FRONTEND_INVALID_PARA;
|
|
}
|
|
|
|
ret = ioctl(frontend_get_fd(), FRONTEND_DISEQC_RECV_MSG_CMD, fe_drv_recv_msg);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("FRONTEND_DISEQC_RECV_MSG_CMD error.\n");
|
|
return ret;
|
|
}
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* __cplusplus */
|