VOS_UINT32 AT_TestCpmsPara(VOS_UINT8 ucIndex) { VOS_UINT16 usLength; AT_MODEM_SMS_CTX_STRU *pstSmsCtx = VOS_NULL_PTR; usLength = 0; pstSmsCtx = AT_GetModemSmsCtxAddrFromClientId(ucIndex); if (MN_MSG_ME_STORAGE_ENABLE == pstSmsCtx->enMsgMeStorageStatus) { usLength = (VOS_UINT16)VOS_sprintf((VOS_CHAR*)pgucAtSndCodeAddr, "%s: (\"SM\",\"ME\"),(\"SM\",\"ME\"),(\"SM\",\"ME\")", g_stParseContext[ucIndex].pstCmdElement->pszCmdName); } else { usLength = (VOS_UINT16)VOS_sprintf((VOS_CHAR*)pgucAtSndCodeAddr, "%s: (\"SM\"),(\"SM\"),(\"SM\")", g_stParseContext[ucIndex].pstCmdElement->pszCmdName); } gstAtSendData.usBufLen = usLength; return AT_OK; }
ssize_t DMS_ReadGetSliceFile( struct file *file, char __user *buf, size_t len, loff_t *ppos ) { VOS_CHAR acModeTemp[DMS_GET_SLICE_FILE_LEN]; VOS_UINT32 ulLength; VOS_UINT32 ulHigh32bitValue; VOS_UINT32 ulLow32bitValue; if (*ppos > 0) { return 0; } /* 初始化 */ ulLength = 0; ulHigh32bitValue = 0; ulLow32bitValue = 0; VOS_MemSet(acModeTemp, 0x00, DMS_GET_SLICE_FILE_LEN); /* 获取时间 Seattle 和 Portland不一样 */ DRV_GET_BBP_TIMER_VALUE(&ulHigh32bitValue, &ulLow32bitValue); if (ulHigh32bitValue != 0) { VOS_sprintf((VOS_CHAR *)acModeTemp, "%x%08x", ulHigh32bitValue, ulLow32bitValue); } else { VOS_sprintf((VOS_CHAR *)acModeTemp, "%x", ulLow32bitValue); } ulLength = VOS_StrLen(acModeTemp); len = PS_MIN(len, ulLength); /*拷贝内核空间数据到用户空间上面*/ if (0 == copy_to_user(buf,(VOS_VOID *)acModeTemp, (VOS_ULONG)len)) { *ppos += (loff_t)len; return (ssize_t)len; } else { return -EPERM; } }
VOS_VOID OM_LittleImgRemoveLogFile(VOS_UINT32 ulFileId) { VOS_CHAR acFileName[LOG_FILE_PATH_MAX_LENGTH] = {0}; LOG_FILE_DISK_INFO_STRU stDiskInfo; /* 拼接LOG文件名称 */ VOS_sprintf((VOS_CHAR *)acFileName, "%s_%04d", g_acLogFileName, ulFileId); DRV_FILE_RMFILE(acFileName); /* 更新全局信息 */ g_stLogFileSaveInfo.ulFileMinId++; /* 调用底软接口返回 */ if (DRV_ERROR == DRV_FILE_GET_DISKSPACE( g_acFileSystemRoot, (VOS_UINT*)&stDiskInfo.ulDiskSpace, (VOS_UINT*)&stDiskInfo.ulUsedSpace, (VOS_UINT*)&stDiskInfo.ulValidSpace)) { PS_LOG(WUEPS_PID_OM, 0, PS_PRINT_ERROR, "OM_LittleImgRemoveLogFile: DRV_FILE_GET_DISKSPACE Failed!"); return; } g_stLogFileSaveInfo.ulFSFreeSpace = stDiskInfo.ulValidSpace; return; }
/***************************************************************************** 函 数 名 : DMS_ReadPortCfgFile 功能描述 : PortCfg虚拟文件读实现 输入参数 : file --- 文件句柄 buf --- 用户空间 ppos --- 文件偏移,参数未使用 输出参数 : 无 返 回 值 : 成功或失败 修改历史 : 1.日 期 : 2013年10月25日 修改内容 : 新生成函数 *****************************************************************************/ ssize_t DMS_ReadPortCfgFile( struct file *file, char __user *buf, size_t len, loff_t *ppos ) { VOS_CHAR acModeTemp[DMS_PORTCFG_FILE_LEN]; VOS_INT32 lRlst; VOS_UINT32 ulLength; if (*ppos > 0) { return 0; } VOS_MemSet(acModeTemp, 0x00, DMS_PORTCFG_FILE_LEN); VOS_sprintf((VOS_CHAR *)acModeTemp, "%d", g_stDmsMainInfo.ulPortCfgValue); ulLength = VOS_StrLen(acModeTemp); len = PS_MIN(len, ulLength); /*拷贝内核空间数据到用户空间上面*/ lRlst = copy_to_user(buf,(VOS_VOID *)acModeTemp, len); if (lRlst < 0) { return -EPERM; } *ppos += (loff_t)len; return (ssize_t)len; }
VOS_UINT32 OM_LittleImgCreateLogFile(VOS_UINT32 ulFileSize) { VOS_CHAR acFileName[LOG_FILE_PATH_MAX_LENGTH] = {0}; LOG_FILE_DISK_INFO_STRU stDiskInfo; /* 调用底软接口返回 */ if (DRV_ERROR == DRV_FILE_GET_DISKSPACE( g_acFileSystemRoot, (VOS_UINT*)&stDiskInfo.ulDiskSpace, (VOS_UINT*)&stDiskInfo.ulUsedSpace, (VOS_UINT*)&stDiskInfo.ulValidSpace)) { PS_LOG(WUEPS_PID_OM, 0, PS_PRINT_ERROR, "OM_LittleImgRemoveLogFile: DRV_FILE_GET_DISKSPACE Failed!"); return VOS_ERR; } g_stLogFileSaveInfo.ulFSFreeSpace = stDiskInfo.ulValidSpace; /*文件系统已满无法创建LOG文件*/ while ((ulFileSize >= g_stLogFileSaveInfo.ulFSFreeSpace) && (g_stLogFileSaveInfo.ulFileMinId != g_stLogFileSaveInfo.ulFileMaxId)) { /*删除最老的LOG文件*/ OM_LittleImgRemoveLogFile(g_stLogFileSaveInfo.ulFileMinId); } /* 以最大的ID创建文件名称 */ VOS_sprintf((VOS_CHAR *)acFileName, "%s_%04d", g_acLogFileName, g_stLogFileSaveInfo.ulFileMaxId); g_lFileHandle = OM_Open((VOS_CHAR *)acFileName, DRV_O_CREAT|DRV_O_TRUNC|DRV_O_RDWR); if (DRV_FILE_NULL == g_lFileHandle) { g_ulLittleImgLogErr = LOG_OPERATION_OPEN_FILE_FAIL; return VOS_ERR; } /* 更新全局变量信息 */ g_stLogFileSaveInfo.ulFileMaxId++; g_stLogFileSaveInfo.ulCurLogFileSize = 0; return VOS_OK; }
ssize_t RNIC_ReadDialEventReportFile( struct file *file, char __user *buf, size_t len, loff_t *ppos ) { RNIC_DIAL_MODE_STRU *pstDialMode; VOS_CHAR acDialEventTemp[RNIC_EVENTFLAG_FILE_LEN]; VOS_UINT32 ulDialEventLen; if (*ppos > 0) { RNIC_ERROR_LOG(ACPU_PID_RNIC, "RNIC_ReadDialEventReportFile:ppos err!"); return 0; } PS_MEM_SET(acDialEventTemp, 0x00, RNIC_EVENTFLAG_FILE_LEN); /* 获取按需拨号的模式以及时长的地址 */ pstDialMode = RNIC_GetDialModeAddr(); VOS_sprintf(acDialEventTemp, "%d", pstDialMode->enEventReportFlag); ulDialEventLen = VOS_StrLen(acDialEventTemp); len = PS_MIN(len, ulDialEventLen); /*拷贝内核空间数据到用户空间上面*/ if (0 == copy_to_user(buf, (VOS_VOID *)acDialEventTemp, len)) { *ppos += (loff_t)len; return (ssize_t)len; } else { RNIC_ERROR_LOG(ACPU_PID_RNIC, "RNIC_ReadDialEventReportFile:copy_to_user err!"); return -EPERM; } }
VOS_UINT32 AT_TestCnmaPara(VOS_UINT8 ucIndex) { AT_MODEM_SMS_CTX_STRU *pstSmsCtx = VOS_NULL_PTR; pstSmsCtx = AT_GetModemSmsCtxAddrFromClientId(ucIndex); if(AT_CMGF_MSG_FORMAT_PDU == pstSmsCtx->enCmgfMsgFormat) /* TEXT方式参数检查 */ { gstAtSendData.usBufLen = (TAF_UINT16)VOS_sprintf((TAF_CHAR*)pgucAtSndCodeAddr, "%s: (0-2)", g_stParseContext[ucIndex].pstCmdElement->pszCmdName); } else { gstAtSendData.usBufLen = 0; } return AT_OK; }
ssize_t RNIC_ReadIdleTimerOutFile( struct file *file, char __user *buf, size_t len, loff_t *ppos ) { RNIC_DIAL_MODE_STRU *pstDialMode; VOS_CHAR acIdleTimeTemp[RNIC_IDLETIMEROUT_FILE_LEN]; VOS_UINT32 ulIdleTimeLen; if (*ppos > 0) { RNIC_ERROR_LOG(ACPU_PID_RNIC, "RNIC_ReadIdleTimerOutFile:ppos ERR!"); return 0; } PS_MEM_SET(acIdleTimeTemp, 0x00, RNIC_IDLETIMEROUT_FILE_LEN); /* 获取按需拨号的模式以及时长的地址 */ pstDialMode = RNIC_GetDialModeAddr(); VOS_sprintf(acIdleTimeTemp, "%d", pstDialMode->ulIdleTime); ulIdleTimeLen = VOS_StrLen(acIdleTimeTemp); len = PS_MIN(len, ulIdleTimeLen); /*拷贝内核空间数据到用户空间上面*/ if (0 == copy_to_user(buf,(VOS_VOID *)acIdleTimeTemp, len)) { *ppos += (loff_t)len; return (ssize_t)len; } else { RNIC_ERROR_LOG(ACPU_PID_RNIC, "RNIC_ReadIdleTimerOutFile:copy_to_user ERR!"); return -EPERM; } }
VOS_VOID TAF_MMA_InitOrigMeInfo( VOS_VOID ) { VOS_UINT32 i; VOS_INT32 lRslt; VOS_UINT32 ulDataLen; VOS_CHAR *ucSoftDate = "2006/11/15"; VOS_CHAR *ucSoftTime = "00:00:00"; gstMmaValue.stMeInfo.ImeisV.ImeiMode = TAF_PH_IMEIV_Mode; for ( i = 0; i < TAF_PH_IMEI_LEN; i++ ) { gstMmaValue.stMeInfo.ImeisV.aucImei[i] = 0; } gstMmaValue.stMeInfo.ProductName.aucProductName[0] = '\0'; gstMmaValue.stMeInfo.ModelId.aucModelId[0] = '\0'; gstMmaValue.stMeInfo.ReleaseDate.aucReleaseDate[0] = '\0'; gstMmaValue.stMeInfo.ReleaseTime.aucReleaseTime[0] = '\0'; gstMmaValue.stMeInfo.CompleteCapitiyList.aucCompleteCapilityList[0][0] = '\0'; gstMmaValue.stMeInfo.CompleteCapitiyList.aucCompleteCapilityList[1][0] = '\0'; gstMmaValue.stMeInfo.CompleteCapitiyList.aucCompleteCapilityList[2][0] = '\0'; gstMmaValue.stMeInfo.GsmCompleteCapitiyList.aucCompleteCapilityList[0][0] = '\0'; gstMmaValue.stMeInfo.GsmCompleteCapitiyList.aucCompleteCapilityList[1][0] = '\0'; gstMmaValue.stMeInfo.GsmCompleteCapitiyList.aucCompleteCapilityList[2][0] = '\0'; VOS_StrNCpy((VOS_CHAR *)( gstMmaValue.stMeInfo.SoftVersion.aucRevisionId), 0x00, TAF_MAX_REVISION_ID_LEN+1); VOS_sprintf((VOS_CHAR *) gstMmaValue.stMeInfo.FmrId.aucMfrId, "huawei"); /*获取发行日期*/ ulDataLen = TAF_PH_RELEASEDATE_LEN + 1; VOS_StrNCpy( (VOS_CHAR *)(gstMmaValue.stMeInfo.ReleaseDate.aucReleaseDate), ucSoftDate, ulDataLen); /*获取发行时间*/ ulDataLen = TAF_PH_RELEASETIME_LEN + 1; VOS_StrNCpy( (VOS_CHAR *)(gstMmaValue.stMeInfo.ReleaseTime.aucReleaseTime), ucSoftTime, ulDataLen); /*获取硬件模块名*/ lRslt = DRV_MEM_VERCTRL((char *)(gstMmaValue.stMeInfo.ModelId.aucModelId), TAF_MAX_MODEL_ID_LEN, VER_PRODUCT_ID, VERIONREADMODE); if(DRV_INTERFACE_RSLT_OK != lRslt) { MMA_WARNINGLOG("MMA_InitMeInfo():VER_PRODUCT_ID Failed!"); } /*获取软件版本号*/ lRslt = DRV_MEM_VERCTRL((char *)(gstMmaValue.stMeInfo.SoftVersion.aucRevisionId), TAF_MAX_REVISION_ID_LEN + 1, VER_SOFTWARE, VERIONREADMODE); if ( DRV_INTERFACE_RSLT_OK != lRslt ) { MMA_WARNINGLOG("MMA_InitMeInfo():Read Software Version Failed!"); } gstMmaValue.ucCopsNotDisplaySpnFlg = MMA_FALSE; /* 默认全球运营商表有效 */ gstMmaValue.ucNotDisplayLocalNetworkNameFlg = MMA_FALSE; PS_MEM_SET(&gstMmaStoredClientOPID,0x00,sizeof(gstMmaStoredClientOPID)); MMA_RdWt_StordedClientOpID(MMA_STORED_CLIENT_OPID_OP_READ); }
VOS_UINT32 AT_TestCscbPara(VOS_UINT8 ucIndex) { gstAtSendData.usBufLen = (VOS_UINT16)VOS_sprintf((VOS_CHAR*)pgucAtSndCodeAddr,"%s:(0,1)", g_stParseContext[ucIndex].pstCmdElement->pszCmdName); return AT_OK; }
VOS_UINT32 atSetTselrfPara(VOS_UINT8 ucClientId) { FTM_SET_TSELRF_REQ_STRU stTselrfSetReq = { 0 }; VOS_UINT32 ulRst = AT_SUCCESS; VOS_UINT32 Rst; VOS_UINT8 ulPath = 0 ; VOS_CHAR acCmd[200]={0}; if(AT_CMD_OPT_SET_PARA_CMD != g_stATParseCmd.ucCmdOptType) { return ERR_MSP_INVALID_PARAMETER; } if((1 != gucAtParaIndex) && (2 != gucAtParaIndex)) { return ERR_MSP_INVALID_PARAMETER; } if(0 == gastAtParaList[0].usParaLen) { return ERR_MSP_INVALID_PARAMETER; } ulPath = (VOS_UINT8)(gastAtParaList[0].ulParaValue); if((FTM_TSELRF_FDD_LTE_MAIN == ulPath) || (FTM_TSELRF_TDD_LTE_MAIN == ulPath) || (FTM_TSELRF_FDD_LTE_SUB == ulPath) || (FTM_TSELRF_TDD_LTE_SUB == ulPath) || (FTM_TSELRF_TD == ulPath)) { stTselrfSetReq.ucPath = ulPath; stTselrfSetReq.ucGroup = (VOS_UINT8)gastAtParaList[1].ulParaValue; } else if(FTM_TSELRF_WIFI == ulPath) { #ifdef VERSION_V7R1_C010 ulRst=BSP_HwIsSupportWifi(); #endif if(ulRst == ERR_MSP_SUCCESS) { /*WIFI未Enable直接返回失败*/ if(VOS_FALSE == (VOS_UINT32)WIFI_GET_STATUS()) { return AT_ERROR; } if((0 != gastAtParaList[1].ulParaValue) && (1 != gastAtParaList[1].ulParaValue)) { return AT_ERROR; } g_ulWifiRF = gastAtParaList[1].ulParaValue; Rst = (VOS_UINT32)VOS_sprintf(acCmd, "wl txchain %d", (gastAtParaList[1].ulParaValue + 1)); if(Rst != ERR_MSP_SUCCESS) { } WIFI_TEST_CMD(acCmd); Rst = (VOS_UINT32)VOS_sprintf(acCmd, "wl rxchain %d", (gastAtParaList[1].ulParaValue + 1)); if(Rst != ERR_MSP_SUCCESS) { } WIFI_TEST_CMD(acCmd); Rst = (VOS_UINT32)VOS_sprintf(acCmd, "wl txant %d", gastAtParaList[1].ulParaValue); if(Rst != ERR_MSP_SUCCESS) { } WIFI_TEST_CMD(acCmd); Rst = (VOS_UINT32)VOS_sprintf(acCmd, "wl antdiv %d", gastAtParaList[1].ulParaValue); if(Rst != ERR_MSP_SUCCESS) { } WIFI_TEST_CMD(acCmd); return AT_OK; } } else { return ERR_MSP_INVALID_PARAMETER; } ulRst = atSendFtmDataMsg(MSP_SYS_FTM_PID, ID_MSG_FTM_SET_TSELRF_REQ, ucClientId,(VOS_VOID*)(&stTselrfSetReq), sizeof(stTselrfSetReq)); if(AT_SUCCESS == ulRst) { /* 设置当前操作类型 */ gastAtClientTab[ucClientId].CmdCurrentOpt = AT_CMD_TSELRF_SET; return AT_WAIT_ASYNC_RETURN; /* 返回命令处理挂起状态 */ } return ulRst; }
VOS_VOID TAF_MMA_InitOrigMeInfo( VOS_VOID ) { VOS_UINT32 i; VOS_INT32 lRslt; VOS_UINT32 ulDataLen; VOS_CHAR *ucSoftDate = "2006/11/15"; VOS_CHAR *ucSoftTime = "00:00:00"; gstMmaValue.stMeInfo.ImeisV.ImeiMode = TAF_PH_IMEIV_Mode; for ( i = 0; i < TAF_PH_IMEI_LEN; i++ ) { gstMmaValue.stMeInfo.ImeisV.aucImei[i] = 0; } gstMmaValue.stMeInfo.ProductName.aucProductName[0] = '\0'; gstMmaValue.stMeInfo.ModelId.aucModelId[0] = '\0'; gstMmaValue.stMeInfo.ReleaseDate.aucReleaseDate[0] = '\0'; gstMmaValue.stMeInfo.ReleaseTime.aucReleaseTime[0] = '\0'; gstMmaValue.stMeInfo.CompleteCapitiyList.aucCompleteCapilityList[0][0] = '\0'; gstMmaValue.stMeInfo.CompleteCapitiyList.aucCompleteCapilityList[1][0] = '\0'; gstMmaValue.stMeInfo.CompleteCapitiyList.aucCompleteCapilityList[2][0] = '\0'; gstMmaValue.stMeInfo.GsmCompleteCapitiyList.aucCompleteCapilityList[0][0] = '\0'; gstMmaValue.stMeInfo.GsmCompleteCapitiyList.aucCompleteCapilityList[1][0] = '\0'; gstMmaValue.stMeInfo.GsmCompleteCapitiyList.aucCompleteCapilityList[2][0] = '\0'; (VOS_VOID)VOS_StrNCpy((VOS_CHAR *)( gstMmaValue.stMeInfo.SoftVersion.aucRevisionId), 0x00, TAF_MAX_REVISION_ID_LEN+1); (VOS_VOID)VOS_sprintf((VOS_CHAR *) gstMmaValue.stMeInfo.FmrId.aucMfrId, "huawei"); /*获取发行日期*/ ulDataLen = TAF_PH_RELEASEDATE_LEN + 1; (VOS_VOID)VOS_StrNCpy( (VOS_CHAR *)(gstMmaValue.stMeInfo.ReleaseDate.aucReleaseDate), ucSoftDate, ulDataLen); /*获取发行时间*/ ulDataLen = TAF_PH_RELEASETIME_LEN + 1; (VOS_VOID)VOS_StrNCpy( (VOS_CHAR *)(gstMmaValue.stMeInfo.ReleaseTime.aucReleaseTime), ucSoftTime, ulDataLen); /*获取硬件模块名*/ lRslt = mdrv_ver_memberctrl((VOS_INT8 *)(gstMmaValue.stMeInfo.ModelId.aucModelId), TAF_MAX_MODEL_ID_LEN, VER_PRODUCT_ID, VERIONREADMODE); if(MDRV_OK != lRslt) { MMA_WARNINGLOG("MMA_InitMeInfo():VER_PRODUCT_ID Failed!"); } /*获取软件版本号*/ lRslt = mdrv_ver_memberctrl((VOS_INT8 *)(gstMmaValue.stMeInfo.SoftVersion.aucRevisionId), TAF_MAX_REVISION_ID_LEN + 1, VER_SOFTWARE, VERIONREADMODE); if ( MDRV_OK != lRslt ) { MMA_WARNINGLOG("MMA_InitMeInfo():Read Software Version Failed!"); } /* 默认全球运营商表有效 */ gstMmaValue.ucNotDisplayLocalNetworkNameFlg = VOS_FALSE; }