本文整理汇总了C++中WMT_ERR_FUNC函数的典型用法代码示例。如果您正苦于以下问题:C++ WMT_ERR_FUNC函数的具体用法?C++ WMT_ERR_FUNC怎么用?C++ WMT_ERR_FUNC使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WMT_ERR_FUNC函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wmt_func_bt_off
INT32 wmt_func_bt_off(P_WMT_IC_OPS pOps, P_WMT_GEN_CONF pConf)
{
//return wmt_func_bt_ctrl(FUNC_OFF);
INT32 iRet1 = -1;
INT32 iRet2 = -1;
UINT32 ctrlPa1;
UINT32 ctrlPa2;
iRet1 = wmt_core_func_ctrl_cmd(WMTDRV_TYPE_BT, MTK_WCN_BOOL_FALSE);
if(iRet1){
WMT_ERR_FUNC("wmt-func: wmt_core_func_ctrl_cmd(bt_off) failed(%d)\n",iRet1);
}
ctrlPa1 = BT_PALDO;
ctrlPa2 = PALDO_OFF;
iRet2 = wmt_core_ctrl(WMT_CTRL_SOC_PALDO_CTRL,&ctrlPa1,&ctrlPa2);
if(iRet2){
WMT_ERR_FUNC("wmt-func: wmt_ctrl_soc_paldo_ctrl(bt_off) failed(%d)\n",iRet2);
}
if(iRet1 + iRet2)
{
return -1;
}
osal_clear_bit(WMT_BT_ON,&gBtWifiGpsState);
if((!osal_test_bit(WMT_WIFI_ON,&gBtWifiGpsState)) && (osal_test_bit(WMT_GPS_ON,&gBtWifiGpsState)))
{
//send msg to GPS native for stopping send de-sense CMD
ctrlPa1 = 0;
ctrlPa2 = 0;
wmt_core_ctrl(WMT_CTRL_BGW_DESENSE_CTRL,&ctrlPa1,&ctrlPa2);
}
return 0;
}
示例2: wmt_conf_parse_int
static int wmt_conf_parse_int(P_DEV_WMT pWmtDev, const struct parse_data *data, const PINT8 pos)
{
PUINT32 dst;
long res;
int ret;
dst = (PINT32) (((PUINT8) pWmtDev) + (long)data->param1);
/* WMT_INFO_FUNC(">strlen(pos)=%d\n", strlen(pos)); */
if ((osal_strlen(pos) > 2) && ((*pos) == '0') && (*(pos + 1) == 'x')) {
ret = osal_strtol(pos + 2, 16, &res);
if (ret)
WMT_ERR_FUNC("fail(%d)\n", ret);
*dst = res;
WMT_DBG_FUNC("wmtcfg==> %s=0x%x\n", data->name, *dst);
} else {
ret = osal_strtol(pos, 10, &res);
if (ret)
WMT_ERR_FUNC("fail(%d)\n", ret);
*dst = res;
WMT_DBG_FUNC("wmtcfg==> %s=%d\n", data->name, *dst);
}
return 0;
}
示例3: wmt_func_bt_off
INT32 wmt_func_bt_off(P_WMT_IC_OPS pOps, P_WMT_GEN_CONF pConf)
{
/* return wmt_func_bt_ctrl(FUNC_OFF); */
INT32 iRet1 = -1;
INT32 iRet2 = -1;
UINT32 ctrlPa1;
UINT32 ctrlPa2;
iRet1 = wmt_core_func_ctrl_cmd(WMTDRV_TYPE_BT, MTK_WCN_BOOL_FALSE);
if (iRet1)
WMT_ERR_FUNC("wmt-func: wmt_core_func_ctrl_cmd(bt_off) failed(%d)\n", iRet1);
ctrlPa1 = BT_PALDO;
ctrlPa2 = PALDO_OFF;
iRet2 = wmt_core_ctrl(WMT_CTRL_SOC_PALDO_CTRL, &ctrlPa1, &ctrlPa2);
if (iRet2)
WMT_ERR_FUNC("wmt-func: wmt_ctrl_soc_paldo_ctrl(bt_off) failed(%d)\n", iRet2);
if (iRet1 + iRet2) {
/*do coredump when bt off fail */
wmt_core_set_coredump_state(DRV_STS_FUNC_ON);
ctrlPa1 = WMTDRV_TYPE_BT;
ctrlPa2 = 32;
wmt_core_ctrl(WMT_CTRL_EVT_ERR_TRG_ASSERT, &ctrlPa1, &ctrlPa2);
return -1;
}
osal_clear_bit(WMT_BT_ON, &gBtWifiGpsState);
if ((!osal_test_bit(WMT_WIFI_ON, &gBtWifiGpsState)) && (osal_test_bit(WMT_GPS_ON, &gBtWifiGpsState))) {
/* send msg to GPS native for stopping send de-sense CMD */
ctrlPa1 = 0;
ctrlPa2 = 0;
wmt_core_ctrl(WMT_CTRL_BGW_DESENSE_CTRL, &ctrlPa1, &ctrlPa2);
}
return 0;
}
示例4: wmt_conf_parse_pair
static INT32 wmt_conf_parse_pair (
P_DEV_WMT pWmtDev,
const PCHAR pKey,
const PCHAR pVal
)
{
int i = 0;
int ret = 0;
//WMT_INFO_FUNC( DBG_NAME "cfg(%s) val(%s) \n", pKey, pVal);
for (i = 0; i < NUM_WMTCFG_FIELDS; i++) {
const struct parse_data *field = &wmtcfg_fields[i];
if (osal_strcmp(pKey, field->name) != 0)
continue;
if (field->parser(pWmtDev, field, pVal)) {
WMT_ERR_FUNC("failed to parse %s '%s'.\n", pKey, pVal);
ret = -1;
}
break;
}
if (i == NUM_WMTCFG_FIELDS) {
WMT_ERR_FUNC("unknown field '%s'.\n", pKey);
ret = -1;
}
return ret;
}
示例5: wmt_func_bt_on
INT32 wmt_func_bt_on(P_WMT_IC_OPS pOps, P_WMT_GEN_CONF pConf)
{
//return wmt_func_bt_ctrl(FUNC_ON);
INT32 iRet = -1;
UINT32 ctrlPa1;
UINT32 ctrlPa2;
ctrlPa1 = BT_PALDO;
ctrlPa2 = PALDO_ON;
iRet = wmt_core_ctrl(WMT_CTRL_SOC_PALDO_CTRL,&ctrlPa1,&ctrlPa2);
if(iRet){
WMT_ERR_FUNC("wmt-func: wmt_ctrl_soc_paldo_ctrl failed(%d)(%d)(%d)\n",iRet,ctrlPa1,ctrlPa2);
return -1;
}
iRet = wmt_core_func_ctrl_cmd(WMTDRV_TYPE_BT, MTK_WCN_BOOL_TRUE);
if(iRet){
WMT_ERR_FUNC("wmt-func: wmt_core_func_ctrl_cmd(bt_on) failed(%d)\n",iRet);
ctrlPa1 = BT_PALDO;
ctrlPa2 = PALDO_OFF;
wmt_core_ctrl(WMT_CTRL_SOC_PALDO_CTRL,&ctrlPa1,&ctrlPa2);
return -2;
}else
{
osal_set_bit(WMT_BT_ON,&gBtWifiGpsState);
if(osal_test_bit(WMT_GPS_ON,&gBtWifiGpsState))
{
//send msg to GPS native for sending de-sense CMD
ctrlPa1 = 1;
ctrlPa2 = 0;
wmt_core_ctrl(WMT_CTRL_BGW_DESENSE_CTRL,&ctrlPa1,&ctrlPa2);
}
return 0;
}
}
示例6: wmt_dev_is_file_exist
MTK_WCN_BOOL wmt_dev_is_file_exist(PUINT8 pFileName)
{
struct file *fd = NULL;
/* ssize_t iRet; */
INT32 fileLen = -1;
const struct cred *cred = get_current_cred();
if (pFileName == NULL) {
WMT_ERR_FUNC("invalid file name pointer(%p)\n", pFileName);
return MTK_WCN_BOOL_FALSE;
}
if (osal_strlen(pFileName) < osal_strlen(defaultPatchName)) {
WMT_ERR_FUNC("invalid file name(%s)\n", pFileName);
return MTK_WCN_BOOL_FALSE;
}
/* struct cred *cred = get_task_cred(current); */
fd = filp_open(pFileName, O_RDONLY, 0);
if (!fd || IS_ERR(fd) || !fd->f_op || !fd->f_op->read) {
WMT_ERR_FUNC("failed to open or read(%s)!(0x%p, %d, %d)\n", pFileName, fd,
cred->fsuid, cred->fsgid);
return MTK_WCN_BOOL_FALSE;
}
fileLen = fd->f_path.dentry->d_inode->i_size;
filp_close(fd, NULL);
fd = NULL;
if (fileLen <= 0) {
WMT_ERR_FUNC("invalid file(%s), length(%d)\n", pFileName, fileLen);
return MTK_WCN_BOOL_FALSE;
}
WMT_ERR_FUNC("valid file(%s), length(%d)\n", pFileName, fileLen);
return true;
}
示例7: mtk_wcn_wmt_therm_ctrl
INT8 mtk_wcn_wmt_therm_ctrl(ENUM_WMTTHERM_TYPE_T eType)
#endif
{
P_OSAL_OP pOp;
P_WMT_OP pOpData;
MTK_WCN_BOOL bRet;
P_OSAL_SIGNAL pSignal;
/*parameter validation check */
if (WMTTHERM_MAX < eType || WMTTHERM_ENABLE > eType) {
WMT_ERR_FUNC("invalid thermal control command (%d)\n", eType);
return MTK_WCN_BOOL_FALSE;
}
/*check if chip support thermal control function or not */
bRet = wmt_lib_is_therm_ctrl_support();
if (MTK_WCN_BOOL_FALSE == bRet) {
WMT_DBG_FUNC("thermal ctrl function not supported\n");
return MTK_WCN_BOOL_FALSE;
}
pOp = wmt_lib_get_free_op();
if (!pOp) {
WMT_DBG_FUNC("get_free_lxop fail\n");
return MTK_WCN_BOOL_FALSE;
}
pSignal = &pOp->signal;
pOpData = &pOp->op;
pOpData->opId = WMT_OPID_THERM_CTRL;
/*parameter fill */
pOpData->au4OpData[0] = eType;
pSignal->timeoutValue = MAX_EACH_WMT_CMD;
WMT_DBG_FUNC("OPID(%d) type(%d) start\n",
pOp->op.opId,
pOp->op.au4OpData[0]);
if (DISABLE_PSM_MONITOR()) {
WMT_ERR_FUNC("wake up failed\n");
wmt_lib_put_op_to_free_queue(pOp);
return -1;
}
bRet = wmt_lib_put_act_op(pOp);
ENABLE_PSM_MONITOR();
if (MTK_WCN_BOOL_FALSE == bRet) {
WMT_WARN_FUNC("OPID(%d) type(%d) fail\n\n", pOpData->opId, pOpData->au4OpData[0]);
/*0xFF means read error occurs */
pOpData->au4OpData[1] = (eType == WMTTHERM_READ) ? 0xFF : MTK_WCN_BOOL_FALSE; /*will return to function driver */
} else {
WMT_DBG_FUNC("OPID(%d) type(%d) return(%d) ok\n\n",
pOpData->opId, pOpData->au4OpData[0], pOpData->au4OpData[1]);
}
/*return value will be put to lxop->op.au4OpData[1] */
WMT_DBG_FUNC("therm ctrl type(%d), iRet(0x%08x)\n", eType, pOpData->au4OpData[1]);
return (INT8) pOpData->au4OpData[1];
}
示例8: mtk_wcn_consys_stp_btif_tx
INT32 mtk_wcn_consys_stp_btif_tx(const UINT8 *pBuf, const UINT32 len, UINT32 *written_len)
{
INT32 retry_left = STP_BTIF_TX_RTY_LMT;
INT32 wr_count = 0;
INT32 written = 0;
if (!stpBtifId) {
WMT_WARN_FUNC("NULL BTIF ID reference!\n");
return -1;
}
if (len == 0) {
*written_len = 0;
WMT_INFO_FUNC("special case for STP-CORE,pbuf(%p)\n", pBuf);
return 0;
}
*written_len = 0;
if (len > STP_MAX_PACKAGE_ALLOWED) {
WMT_WARN_FUNC("abnormal pacage length,len(%d),pid[%d/%s]\n", len, current->pid, current->comm);
return -2;
}
wr_count = mtk_wcn_btif_write(stpBtifId, pBuf, len);
if (wr_count < 0) {
WMT_ERR_FUNC("mtk_wcn_btif_write err(%d)\n", wr_count);
*written_len = 0;
return -3;
}
if (wr_count == len) {
/*perfect case */
*written_len = wr_count;
return wr_count;
}
while ((retry_left--) && (wr_count < len)) {
osal_sleep_ms(STP_BTIF_TX_RTY_DLY);
written = mtk_wcn_btif_write(stpBtifId, pBuf + wr_count, len - wr_count);
if (written < 0) {
WMT_ERR_FUNC("mtk_wcn_btif_write err(%d)when do recovered\n", written);
break;
}
wr_count += written;
}
if (wr_count == len) {
WMT_INFO_FUNC("recovered,len(%d),retry_left(%d)\n", len, retry_left);
/*recovered case */
*written_len = wr_count;
return wr_count;
}
WMT_ERR_FUNC("stp btif write fail,len(%d),written(%d),retry_left(%d),pid[%d/%s]\n",
len, wr_count, retry_left, current->pid, current->comm);
*written_len = 0;
return -wr_count;
}
示例9: wmt_conf_read_file
INT32 wmt_conf_read_file(VOID)
{
INT32 ret = -1;
osal_memset(&gDevWmt.rWmtGenConf, 0, osal_sizeof(gDevWmt.rWmtGenConf));
osal_memset(&gDevWmt.pWmtCfg, 0, osal_sizeof(gDevWmt.pWmtCfg));
#if 1
osal_memset(&gDevWmt.cWmtcfgName[0], 0, osal_sizeof(gDevWmt.cWmtcfgName));
osal_strncat(&(gDevWmt.cWmtcfgName[0]), CUST_CFG_WMT_PREFIX, osal_sizeof(CUST_CFG_WMT_PREFIX));
osal_strncat(&(gDevWmt.cWmtcfgName[0]), CUST_CFG_WMT, osal_sizeof(CUST_CFG_WMT));
#endif
if (!osal_strlen(&(gDevWmt.cWmtcfgName[0]))) {
WMT_ERR_FUNC("empty Wmtcfg name\n");
osal_assert(0);
return ret;
}
WMT_INFO_FUNC("WMT config file:%s\n", &(gDevWmt.cWmtcfgName[0]));
if (0 == wmt_dev_patch_get(&gDevWmt.cWmtcfgName[0], (osal_firmware **) &gDevWmt.pWmtCfg, 0)) {
/*get full name patch success */
WMT_INFO_FUNC("get full file name(%s) buf(0x%p) size(%d)\n",
&gDevWmt.cWmtcfgName[0], gDevWmt.pWmtCfg->data, gDevWmt.pWmtCfg->size);
if (0 == wmt_conf_parse(&gDevWmt, (const PINT8)gDevWmt.pWmtCfg->data, gDevWmt.pWmtCfg->size)) {
/*config file exists */
gDevWmt.rWmtGenConf.cfgExist = 1;
WMT_INFO_FUNC("&gDevWmt.rWmtGenConf=%p\n", &gDevWmt.rWmtGenConf);
ret = 0;
} else {
WMT_ERR_FUNC("wmt conf parsing fail\n");
osal_assert(0);
ret = -1;
}
wmt_dev_patch_put((osal_firmware **) &gDevWmt.pWmtCfg);
/*
if (gDevWmt.pWmtCfg)
{
if (gDevWmt.pWmtCfg->data)
{
osal_free(gDevWmt.pWmtCfg->data);
}
osal_free(gDevWmt.pWmtCfg);
gDevWmt.pWmtCfg = 0;
}
*/
return ret;
} else {
WMT_ERR_FUNC("read %s file fails\n", &(gDevWmt.cWmtcfgName[0]));
osal_assert(0);
gDevWmt.rWmtGenConf.cfgExist = 0;
return ret;
}
}
示例10: mtk_wcn_wmt_dsns_ctrl
MTK_WCN_BOOL mtk_wcn_wmt_dsns_ctrl(ENUM_WMTDSNS_TYPE_T eType)
#endif
{
P_OSAL_OP pOp;
P_WMT_OP pOpData;
MTK_WCN_BOOL bRet;
P_OSAL_SIGNAL pSignal;
if (WMTDSNS_MAX <= eType) {
WMT_ERR_FUNC("invalid desense control command (%d)\n", eType);
return MTK_WCN_BOOL_FALSE;
}
/*check if chip support thermal control function or not */
bRet = wmt_lib_is_dsns_ctrl_support();
if (MTK_WCN_BOOL_FALSE == bRet) {
WMT_ERR_FUNC("thermal ctrl function not supported\n");
return MTK_WCN_BOOL_FALSE;
}
pOp = wmt_lib_get_free_op();
if (!pOp) {
WMT_DBG_FUNC("get_free_lxop fail\n");
return MTK_WCN_BOOL_FALSE;
}
pSignal = &pOp->signal;
pOpData = &pOp->op;
pOpData->opId = WMT_OPID_DSNS;
pSignal->timeoutValue = MAX_EACH_WMT_CMD;
/*parameter fill */
if ((WMTDSNS_FM_DISABLE <= eType) && (WMTDSNS_FM_GPS_ENABLE >= eType)) {
pOpData->au4OpData[0] = WMTDRV_TYPE_FM;
pOpData->au4OpData[1] = eType;
}
WMT_INFO_FUNC("OPID(%d) type(%d) start\n", pOp->op.opId, pOp->op.au4OpData[0]);
if (DISABLE_PSM_MONITOR()) {
WMT_ERR_FUNC("wake up failed\n");
wmt_lib_put_op_to_free_queue(pOp);
return MTK_WCN_BOOL_FALSE;
}
bRet = wmt_lib_put_act_op(pOp);
ENABLE_PSM_MONITOR();
if (MTK_WCN_BOOL_FALSE == bRet) {
WMT_WARN_FUNC("OPID(%d) type(%d) fail\n\n", pOpData->opId, pOpData->au4OpData[0]);
} else {
WMT_INFO_FUNC("OPID(%d) type(%d) ok\n\n", pOpData->opId, pOpData->au4OpData[0]);
}
return bRet;
}
示例11: wmt_aee_read
ssize_t wmt_aee_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
{
INT32 retval = 0;
UINT32 len = 0;
WMT_INFO_FUNC("%s: count %d pos %lld\n", __func__, count, *f_pos);
if (0 == *f_pos) {
pBuf = wmt_lib_get_cpupcr_xml_format(&len);
g_buf_len = len;
WMT_INFO_FUNC("wmt_dev:wmt for aee buffer len(%d)\n", g_buf_len);
}
if (g_buf_len >= count) {
retval = copy_to_user(buf, pBuf, count);
if (retval) {
WMT_ERR_FUNC("copy to aee buffer failed, ret:%d\n", retval);
retval = -EFAULT;
goto err_exit;
}
*f_pos += count;
g_buf_len -= count;
pBuf += count;
WMT_INFO_FUNC("wmt_dev:after read,wmt for aee buffer len(%d)\n", g_buf_len);
retval = count;
} else if (0 != g_buf_len) {
retval = copy_to_user(buf, pBuf, g_buf_len);
if (retval) {
WMT_ERR_FUNC("copy to aee buffer failed, ret:%d\n", retval);
retval = -EFAULT;
goto err_exit;
}
*f_pos += g_buf_len;
len = g_buf_len;
g_buf_len = 0;
pBuf += len;
retval = len;
WMT_INFO_FUNC("wmt_dev:after read,wmt for aee buffer len(%d)\n", g_buf_len);
} else {
WMT_INFO_FUNC("wmt_dev: no data avaliable for aee\n");
retval = 0;
}
err_exit:
return retval;
}
示例12: mtk_wcn_wmt_func_ctrl
static MTK_WCN_BOOL
mtk_wcn_wmt_func_ctrl (
ENUM_WMTDRV_TYPE_T type,
ENUM_WMT_OPID_T opId
)
{
P_OSAL_OP pOp;
MTK_WCN_BOOL bRet;
P_OSAL_SIGNAL pSignal;
pOp = wmt_lib_get_free_op();
if (!pOp) {
WMT_WARN_FUNC("get_free_lxop fail\n");
return MTK_WCN_BOOL_FALSE;
}
pSignal = &pOp->signal;
pOp->op.opId = opId;
#if MTK_WCN_CMB_FOR_SDIO_1V_AUTOK
if(WMTDRV_TYPE_AUTOK == type)
pOp->op.au4OpData[0] = WMTDRV_TYPE_WIFI;
else
#endif
pOp->op.au4OpData[0] = type;
if (WMTDRV_TYPE_WIFI == type)
pSignal->timeoutValue = 4000; /*workaround, donot block system server/Init/Netd from longer than 5s, in case of ANR happens*/
else
pSignal->timeoutValue = (WMT_OPID_FUNC_ON == pOp->op.opId) ? MAX_FUNC_ON_TIME : MAX_FUNC_OFF_TIME;
WMT_INFO_FUNC("OPID(%d) type(%d) start\n",
pOp->op.opId,
pOp->op.au4OpData[0]);
/*do not check return value, we will do this either way*/
wmt_lib_host_awake_get();
/*wake up chip first*/
if (DISABLE_PSM_MONITOR()) {
WMT_ERR_FUNC("wake up failed\n");
wmt_lib_put_op_to_free_queue(pOp);
return MTK_WCN_BOOL_FALSE;
}
bRet = wmt_lib_put_act_op(pOp);
ENABLE_PSM_MONITOR();
wmt_lib_host_awake_put();
if (MTK_WCN_BOOL_FALSE == bRet) {
WMT_WARN_FUNC("OPID(%d) type(%d) fail\n",
pOp->op.opId,
pOp->op.au4OpData[0]);
}
else{
WMT_INFO_FUNC("OPID(%d) type(%d) ok\n",
pOp->op.opId,
pOp->op.au4OpData[0]);
}
return bRet;
}
示例13: wmt_ctrl_get_patch_info
INT32 wmt_ctrl_get_patch_info(P_WMT_CTRL_DATA pWmtCtrlData)
{
P_DEV_WMT pDev = &gDevWmt; /* single instance */
UINT32 downLoadSeq = 0;
P_WMT_PATCH_INFO pPatchinfo = NULL;
PUCHAR pNbuf = NULL;
PUCHAR pAbuf =NULL;
downLoadSeq = pWmtCtrlData->au4CtrlData[0];
WMT_DBG_FUNC("download seq is %d\n",downLoadSeq);
pPatchinfo = pDev->pWmtPatchInfo + downLoadSeq - 1;
pNbuf = (PUCHAR)pWmtCtrlData->au4CtrlData[1];
pAbuf = (PUCHAR)pWmtCtrlData->au4CtrlData[2];
if(pPatchinfo)
{
osal_memcpy(pNbuf,pPatchinfo->patchName,osal_sizeof(pPatchinfo->patchName));
osal_memcpy(pAbuf,pPatchinfo->addRess,osal_sizeof(pPatchinfo->addRess));
WMT_DBG_FUNC("get 4 address bytes is 0x%2x,0x%2x,0x%2x,0x%2x",pAbuf[0],pAbuf[1],pAbuf[2],pAbuf[3]);
}
else
{
WMT_ERR_FUNC("NULL patchinfo pointer\n");
}
return 0;
}
示例14: wmt_ctrl_crystal_triming_get
INT32 wmt_ctrl_crystal_triming_get(P_WMT_CTRL_DATA pWmtCtrlData)
{
INT32 iRet = 0x0;
UCHAR *pFileName = (UCHAR *)pWmtCtrlData->au4CtrlData[0];
PUINT8 *ppBuf = (PUINT8 *)pWmtCtrlData->au4CtrlData[1];
PUINT32 pSize = (PUINT32)pWmtCtrlData->au4CtrlData[2];
osal_firmware *pNvram = NULL;
if ((NULL == pFileName) || (NULL == pSize))
{
WMT_ERR_FUNC("parameter error, pFileName(0x%08x), pSize(0x%08x)\n", pFileName, pSize);
iRet = -1;
return iRet;
}
if (0 == wmt_dev_patch_get(pFileName, &pNvram, 0))
{
*ppBuf = (PUINT8)(pNvram)->data;
*pSize = (pNvram)->size;
gDevWmt.pNvram = pNvram;
return 0;
}
return -1;
}
示例15: wmt_conf_set_cfg_file
INT32 wmt_conf_set_cfg_file(const char *name)
{
if (NULL == name) {
WMT_ERR_FUNC("name is NULL\n");
return -1;
}
if (osal_strlen(name) >= osal_sizeof(gDevWmt.cWmtcfgName)) {
WMT_ERR_FUNC("name is too long, length=%d, expect to < %d\n", osal_strlen(name),
osal_sizeof(gDevWmt.cWmtcfgName));
return -2;
}
osal_memset(&gDevWmt.cWmtcfgName[0], 0, osal_sizeof(gDevWmt.cWmtcfgName));
osal_strcpy(&(gDevWmt.cWmtcfgName[0]), name);
WMT_ERR_FUNC("WMT config file is set to (%s)\n", &(gDevWmt.cWmtcfgName[0]));
return 0;
}