Esempio n. 1
0
kal_bool srv_ies_job_send_request(srv_ies_job_handle hJob)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    srv_ies_app_session     *pApp;
    srv_ies_ilm_job_request *pReq;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ASSERT(hJob != NULL);

    pApp = hJob->pParent;

    if ((KAL_TRUE == g_srv_ies_job_deinit) ||
        ((pApp->appState & SRV_IES_APP_STATE_JOB_INITED) == 0) ||
        (SRV_IES_JOB_STATE_INVALID == hJob->state))
    {
        return MMI_FALSE;
    }

    pReq = (srv_ies_ilm_job_request*)construct_local_para(sizeof(srv_ies_ilm_job_request), TD_CTRL);
    ASSERT(NULL != pReq);

    pReq->type           = SRV_IES_JOB_REQUEST_START;
    pReq->pJob           = hJob;
    pReq->seqNum         = hJob->seqNum;

    return msg_send5(hJob->modID, MOD_IES, MMI_MMI_SAP, MSG_ID_IES_JOB_REQ, (local_para_struct*)pReq);
}
/*******************************************************************************
 * FUNCTION
 *   FT_InitCalibrationData
 *
 * DESCRIPTION
 *   The calibration data fetch in power-on stage
 *
 * CALLS
 *
 * PARAMETERS
 *   None
 *
 * RETURNS
 *   None
 *
 * GLOBALS AFFECTED
 *   None
 *******************************************************************************/
void FT_InitCalibrationData(task_entry_struct *task_entry_ptr)
{
    nvram_startup_req_struct *ptrMsg;
    ptrMsg = (nvram_startup_req_struct*)construct_local_para(sizeof(nvram_startup_req_struct), TD_CTRL);
    if(NULL == ptrMsg)
    {
        ASSERT(0);    
    }    
    ptrMsg->poweron_mode=NVRAM_POWERON_NORMAL;        
    msg_send5(MOD_FT, MOD_NVRAM, PS_NVRAM_SAP, MSG_ID_NVRAM_STARTUP_REQ, (local_para_struct*)ptrMsg);
}
/***********************************************
 * FT task self message API
 * This API is called in other task context
 * or HISR conext!
 **********************************************/
void ft_send_in_proc_call_req(ft_in_proc_call_type func, kal_uint32 func_arg1, void *func_arg2)
{
    ft_in_proc_call_req_struct *ptrMsg;
    ptrMsg = (ft_in_proc_call_req_struct *)construct_local_para(sizeof(ft_in_proc_call_req_struct), TD_RESET);
    if(NULL == ptrMsg)
    {
        ASSERT(0);    
    }    
    ptrMsg->func = func;
    ptrMsg->func_arg1 = func_arg1;
    ptrMsg->func_arg2 = func_arg2;    
    msg_send5(kal_get_active_module_id(), MOD_FT, FT_TST_SAP, (msg_type)MSG_ID_FT_IN_PROC_CALL_REQ, (local_para_struct*)ptrMsg);
}
kal_bool custom_send_sm_stress_inject_msg( kal_char *cmd_str, module_type dst_mod )
{
#if defined(__MTK_TARGET__) && defined(MTK_SLEEP_ENABLE)
    tst_module_string_inject_struct *tst_inject;
    tst_inject = (tst_module_string_inject_struct *)
                construct_local_para((kal_uint16)sizeof(tst_module_string_inject_struct), TD_RESET);

    strcpy(tst_inject->string, cmd_str);
    msg_send5(MOD_L4C, dst_mod, 0, MSG_ID_TST_INJECT_STRING, (local_para_struct*)tst_inject);
    
    return KAL_TRUE;
#else
    return KAL_FALSE;
#endif
}
Esempio n. 5
0
static kal_bool _srv_ies_job_cancel_request(srv_ies_job_handle hJob)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    srv_ies_ilm_job_request *pReq;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    pReq = (srv_ies_ilm_job_request*)construct_local_para(sizeof(srv_ies_ilm_job_request), TD_CTRL);
    ASSERT(NULL != pReq);

    pReq->type              = SRV_IES_JOB_REQUEST_CANCEL;
    pReq->pJob              = hJob;
    pReq->seqNum            = hJob->seqNum;

    return msg_send5(hJob->modID, MOD_IES, MMI_MMI_SAP, MSG_ID_IES_JOB_REQ, (local_para_struct*)pReq);
}
Esempio n. 6
0
static void _ies_task_job_respond(srv_ies_job               *pJob,
                                  kal_uint32                seqNum,
                                  srv_ies_result            result)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    srv_ies_ilm_job_response    *pResp;
    
    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    pResp = (srv_ies_ilm_job_response*)construct_local_para(sizeof(srv_ies_ilm_job_response), TD_CTRL);
    ASSERT(NULL != pResp);

    pResp->pJob           = pJob;
    pResp->seqNum         = seqNum;
    pResp->result         = result;

    msg_send5(MOD_IES, pJob->modID, MMI_MMI_SAP, MSG_ID_IES_JOB_RSP, (local_para_struct*)pResp);

}
/*****************************************************************************
* FUNCTION
*  	rmmi_general_command_parsing()
* DESCRIPTION
*   	This function should parse general proprietary AT command request.
*     Each owner should maintain and modify the code.
* PARAMETERS
*   	kal_uint32 op 
*	kal_uint32 data_len 
*	kal_uint8 *data_str
* RETURNS
*	KAL_TRUE or KAL_FALSE
*****************************************************************************/
kal_bool rmmi_general_command_parsing(kal_uint32 op, 
												kal_uint32 data_len, 
												kal_uint8 *data_str)
{
	kal_bool ret_val = KAL_FALSE;
	
#ifndef L4_NOT_PRESENT

	switch(op)
	{
		
		case 2: /* add by stanley 2006-07-03*/
		{
#if  defined(__BTMTK__)
			bt_test_cmd_req_struct  *param_ptr;
			param_ptr = (bt_test_cmd_req_struct *)construct_local_para(
															(kal_uint16)sizeof(bt_test_cmd_req_struct),
															TD_CTRL);   

			kal_mem_cpy(param_ptr->test_cmd_content, data_str, data_len);
			rmmi_send_msg_to_bt(MSG_ID_BT_TEST_CMD_REQ, param_ptr);	 
			ret_val = KAL_TRUE;
#endif /* __BTMTK__ */
      break;
		}
        
    case 6:
    {
#ifdef __UMTS_RAT__
        kal_char *pp, *strModuleName, *strTstInject, *tt;
        kal_uint32 module_enum = 0, input_str_data_len = 0;

        input_str_data_len = strlen((kal_char*)data_str);


        if( input_str_data_len > 0 && input_str_data_len < 255)
        {

        strModuleName = (kal_char*) kal_strtok_r((kal_char*)data_str, "_", &pp);

	tt = (kal_char*) kal_strtok_r(NULL, "", &pp);
	if(NULL != tt)
	{
		strTstInject = tt;
	}
	else
	{
		strTstInject = "";
	}

        /* Length of module name should be less than 8 bytes and Length of TST inject string shall be less than 128 bytes */
        if((CUSTOM_MAX_MOD_NAME > strlen(strModuleName)) && (128 > strlen(strTstInject)))
        {
            kal_uint8 idx;
            static const module_name_enum_map_struct mod_map[MAX_MODULE_MAP_SIZE] = 
                {
                        {"MEME", MOD_MEME},//0                    
                        {"CSE", MOD_CSE},
                        {"CSCE", MOD_CSCE},
                        {"SIBE", MOD_SIBE}, 
                        {"USIME", MOD_USIME},
                        {"RRCE", MOD_RRCE},//5
                        {"SLCE", MOD_SLCE},
                        {"ADR", MOD_ADR},
                        {"URR", MOD_URR}, 
                        {"URLC", MOD_URLC},
                        {"UMAC", MOD_UMAC},//10
                        {"UL2", MOD_UL2},                    
                        {"MM", MOD_MM},
                        {"CC", MOD_CC}, 
                        {"CISS", MOD_CISS},
                        {"SMS", MOD_SMS},//15
                        {"SIM", MOD_SIM},
                        {"L4C", MOD_L4C},
                        {"TCM", MOD_TCM}, 
                        {"SMSAL", MOD_SMSAL},
                        {"UEM", MOD_UEM},//20
                        {"RAC", MOD_RAC},
                        {"SMU", MOD_SMU},
                        {"USAT", MOD_USAT}, 
                        {"CSM", MOD_CSM},
                        {"ENG", MOD_ENG},//25
                        {"PHB", MOD_PHB},
                        {"RRM", MOD_RRM},
                        {"RLC", MOD_RLC}, 
                        {"MAC", MOD_MAC},
                        {"LAPDM", MOD_LAPDM}, //30
                        {"MPAL", MOD_MPAL},
                        {"SNDCP", MOD_SNDCP},
                        {"SM", MOD_SM}, 
                        {"LLC", MOD_LLC}//34
                    };

            for(idx = 0; idx < MAX_MODULE_MAP_SIZE; idx++)
            {
                if(strcmp(strModuleName, mod_map[idx].ModuleName) == 0)
                {
                    module_enum = mod_map[idx].ModuleEnum;
                    break;
                }
            }

            if(idx != MAX_MODULE_MAP_SIZE)
            {
                /* The target module is found, and send the TST to the module */
                tst_module_string_inject_struct *tst_inject;
                tst_inject = (tst_module_string_inject_struct *)
                                        construct_local_para((kal_uint16)sizeof(tst_module_string_inject_struct), TD_RESET);
                strcpy((kal_char*)tst_inject->string, strTstInject);
                tst_inject->index = data_len;

                {
                    msg_send5(MOD_L4C, (module_type)module_enum, 0, MSG_ID_TST_INJECT_STRING, (local_para_struct*)tst_inject);
                }
            }
        }
        	
	ret_val = KAL_TRUE;
        }
#endif /* __UMTS_RAT__ */
    }
    break;

    #if defined(__AGPS_CONTROL_PLANE__)            
        case 14:
        {
            l4c_agps_reset_positioning_lind();
            ret_val = KAL_TRUE;
            break;
        }
    #endif

/************************sample code begin************************/			
//		case op: /*owner_date: purpose*/
//		{
//			/*call proprietary parsing function here and AT will give result  */
//			/*code OK/ERROR according to return value of parsing function*/	
//
//			break;
//		}
/************************sample code end*************************/
    #ifdef __CTP_GOODIX_GT818_TRUE_MULTIPLE__
        case 15:
        case 16:
        case 17:
        case 18:
        case 19:
        case 20:
        case 21:
        case 22:
        case 23:
        case 24:
        {
            ret_val = process_gt818_ctp_cmd( (kal_uint8)(op - 15), data_len, data_str );
            break;
        }   
    #endif

#if defined(__AGPS_SUPPORT__)
        /* below codes are for auto-test */
        case 25:
        case 26:
        {
            /*agps_auto_test_ind_struct *param_ptr = construct_local_para(
            (kal_uint16)sizeof(agps_auto_test_ind_struct), TD_RESET);

            param_ptr->mode = (op == 25)? 1 : 0;*/

            /* Send the message to the module in AP */
            //ret_val = custom_send_agps_autotest_ipc(IPC_MSG_ID_AGPS_AUTO_TEST_IND, param_ptr);
            agps_md_auto_test_ind data;
            data.mode = (op == 25)? 1 : 0;
            rmmi_lbs_send_data(AGPS_MD_TYPE_AUTO_TEST_IND, (kal_uint8*)&data, sizeof(data));
            break;
        }
        case 27:
        case 28:
        case 29:
        case 30:
        case 31:
        case 32:
        {
            /*agps_cp_up_status_ind_struct *param_ptr = construct_local_para(
            (kal_uint16)sizeof(agps_cp_up_status_ind_struct), TD_RESET);

            param_ptr->mode = (op-27);*/

            /* Send the message to the module in AP */
            //ret_val = custom_send_agps_autotest_ipc(IPC_MSG_ID_AGPS_CP_UP_STATUS_IND, param_ptr);
            agps_md_auto_cp_up_status_ind data;
            data.mode = (op-27);
            rmmi_lbs_send_data(AGPS_MD_TYPE_AUTO_CP_UP_STATUS_IND, (kal_uint8*)&data, sizeof(data));
            break;
        }
        case 33:
        case 34:
        {
            /* Send the message to the module in AP */
            //ret_val = custom_send_agps_autotest_ipc(IPC_MSG_ID_AGPS_MOLR_START_IND+(op-33), NULL);
            rmmi_lbs_send_data(AGPS_MD_TYPE_AUTO_MOLR_START_IND+(op-33), NULL, 0);
            break;
        }
        case 35:
        case 36:
        {
            /*agps_mtlr_response_ind_struct *param_ptr = construct_local_para(
            (kal_uint16)sizeof(agps_mtlr_response_ind_struct), TD_RESET);

            param_ptr->response = (op-35);*/
            /* Send the message to the module in AP */
            //ret_val = custom_send_agps_autotest_ipc(IPC_MSG_ID_AGPS_MTLR_RESPONSE_IND, param_ptr);
            agps_md_auto_mtlr_response_ind data;
            data.response = (op-35);
            rmmi_lbs_send_data(AGPS_MD_TYPE_AUTO_MTLR_RESPONSE_IND, (kal_uint8*)&data, sizeof(data));
            break;
        }
#endif
        /* Sleep Mode Stress Test */
        case 37:
        {
            ret_val = custom_send_sm_stress_inject_msg( "2GStressEnable", MOD_L1);
            break;
        }
#ifdef __UMTS_FDD_MODE__
        case 38:
        {
            ret_val = custom_send_sm_stress_inject_msg( "3GStressEnable", MOD_UL1);
            break;
        }
#endif
        case 39:
        {
            ret_val = custom_send_sm_stress_inject_msg( "RTOSStressEnable", MOD_L1);
            break;
        }
        case 40:
        {
            ret_val = custom_send_sm_stress_inject_msg( "2GStressDisable", MOD_L1);
            break;
        }
#ifdef __UMTS_FDD_MODE__
        case 41:
        {
            ret_val = custom_send_sm_stress_inject_msg( "3GStressDisable", MOD_UL1);
            break;
        }
#endif
        case 42:
        {
            ret_val = custom_send_sm_stress_inject_msg( "RTOSStressDisable", MOD_L1);
            break;
        }
		/*Re  Calibration Stress */
        case 43:
        {
            ret_val = custom_send_sm_stress_inject_msg( "ReKEnable", MOD_L1);
            break;
        }
        case 44:
        {
            ret_val = custom_send_sm_stress_inject_msg( "ReKDisable", MOD_L1);
            break;
        }
        case 48:
        {
            ret_val = custom_send_sm_stress_inject_msg( "2GSleepEnable", MOD_L1);
            break;
        }
        case 49:
        {
            ret_val = custom_send_sm_stress_inject_msg( "2GSleepDisable", MOD_L1);
            break;
        }
#ifdef __UMTS_FDD_MODE__
        case 50:
        {
            ret_val = custom_send_sm_stress_inject_msg( "3GSleepEnable", MOD_UL1);
            break;
        }
        case 51:
        {
            ret_val = custom_send_sm_stress_inject_msg( "3GSleepDisable", MOD_UL1);
            break;
        }
#endif
        case 54:
        {
            ret_val = custom_send_sm_stress_inject_msg( "OSTDSleepEnable", MOD_L1);
            break;
        }
        case 55:
        {
            ret_val = custom_send_sm_stress_inject_msg( "OSTDSleepDisable", MOD_L1);
            break;
        }

		default:
			break;	
	}
#endif // L4_NOT_PRESENT

	return ret_val;
}