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.
42 lines
1.0 KiB
42 lines
1.0 KiB
/*
|
|
* Copyright (c) Hisilicon Technologies Co., Ltd. 2020-2021. All rights reserved.
|
|
* Description: Unicable 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_unicable.h"
|
|
|
|
td_s32 ext_mpi_frontend_get_agc(fe_ioctrl_data_buf *fe_data_buf)
|
|
{
|
|
td_s32 ret;
|
|
|
|
if (fe_data_buf == TD_NULL) {
|
|
soc_log_err("Input parameter(fe_data_buf) is TD_NULL.\n");
|
|
return SOC_ERR_FRONTEND_INVALID_POINT;
|
|
}
|
|
|
|
if (fe_data_buf->port >= MPI_UNICABLE_NUM) {
|
|
soc_log_err("Input parameter(fe_data_buf->port) invalid.\n");
|
|
soc_err_print_u32(fe_data_buf->port);
|
|
return SOC_ERR_FRONTEND_INVALID_PARA;
|
|
}
|
|
|
|
ret = ioctl(frontend_get_fd(), FRONTEND_GET_AGC_CMD, fe_data_buf);
|
|
if (ret != TD_SUCCESS) {
|
|
soc_log_err("FRONTEND_GET_AGC_CMD error.\n");
|
|
return SOC_ERR_FRONTEND_FAILED_GETAGC;
|
|
}
|
|
|
|
return TD_SUCCESS;
|
|
}
|
|
|