Beispiel #1
0
/*****************************************************************************
* FUNCTION
*  rac_init
* DESCRIPTION
*   This function initialize the content of rac.
*
* PARAMETERS
*  none
*
* RETURNS
*  none
* GLOBALS AFFECTED
*   none
*****************************************************************************/
kal_bool rac_init(void)
{
   rac_context_struct * rac_ptr_g;
#ifdef __GEMINI__   
   kal_uint8 i;
#endif

#ifndef __GEMINI__
   rac_ptr_g = & rac_context;
   rac_ptr_global = rac_ptr_g;


   //MAUI_02914482 [RAC] use evshed_create to replace new_evshed
   rac_ptr_g->event_scheduler_ptr = evshed_create("RAC_Base_Timer", MOD_RAC, 0, 255);

#else

   for (i=0; i< MAX_SIM_NUM; i++)
   {
      rac_ptr_g  = & rac_context[i];
      rac_ptr_global = rac_ptr_g;
      rac_ptr_g->sim_interface = i;

      //MAUI_02914482 [RAC] use evshed_create to replace new_evshed
      rac_ptr_g->event_scheduler_ptr = evshed_create("RAC_Base_Timer", (module_type)RAC_MODULE_ID, 0, 255);
   }
   
#endif
   return  rac_reset();
}
/*****************************************************************************
 * FUNCTION
 *  avk_mytimer_init
 * DESCRIPTION
 *  mytimer proc for EVT_ID_MMI_TIMER_INIT_EXT
 * PARAMETERS
 *  evt : [IN] mmi timer event pointer in fact
 * RETURNS
 *  0 : callback manager will continue to deliver this event
 *  non-zero : callback manager will stop deliver this event
 *****************************************************************************/
extern "C" mmi_ret avk_mytimer_init(mmi_event_struct *evt)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    g_mytimer_base_cntx = (avk_mytimer_base_struct *)evshed_create("MyTimerDemo", MOD_MMI, 0, 0);
    evshed_set_index(g_mytimer_base_cntx, AVK_MYTIMER_BASE_ID);
    return 0;
}
Beispiel #3
0
/*****************************************************************************
 * FUNCTION
 *  l4c_init
 * DESCRIPTION
 *  This is l4c_init function of L4C module.
 *  will be called when stack init
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
kal_bool l4c_init()
{
    kal_bool ret_val = KAL_FALSE;
    kal_int8 i = 1;

    for (i = L4_MAX_SIM_NUM-1; i >= 0; i--)
    {
        l4c_ptr_g = &l4c_cntxt_g[i];
        kal_mem_set((kal_uint8*) L4C_PTR, (kal_uint32) 0, (kal_uint32) sizeof(l4c_context_struct));
        l4c_current_mod_id = L4_MODULE(MOD_L4C, i);

    #if !defined(__MMI_FMI__) && defined(__GEMINI__)
        l4c_ptr_g->dual_sim_mode_setting_command = RMMI_EDSIM_NORMAL; // for AT+EDSIM set mode
    #endif /* no __MMI_FMI__ */
        
        ret_val = l4c_init_context();

    #ifdef __HOMEZONE_SUPPORT__
        HZ_PTR = &l4c_hz_cntxt_g[i];

        kal_mem_set((kal_uint8*) HZ_PTR, (kal_uint32) 0, (kal_uint32) sizeof(l4c_hz_context_struct));

        l4c_hz_init_context();
    #endif 

        L4C_PTR->event_scheduler_ptr = evshed_create("L4CTIMER", l4c_current_mod_id, 0, 0);  //evshed_create, mtk02285, 20110328
    }

    /* For GPRS_FLC_UT MAUI_02419672 mtk02126 */
    #if 0
    #if !defined(__MTK_TARGET__) && defined(__RMMI_UT__) && defined(__MOD_TCM__)    
/* under construction !*/
/* under construction !*/
    #endif /*~ __MOD_TCM__*/
    #endif

    l4c_comm_ptr_g = &l4c_comm_cntxt_g;
    ret_val = l4c_init_common_context();

#if defined(__GEMINI__)
    l4c_root_ptr_g = &l4c_root_cntxt_g;    
    ret_val = l4c_init_root_context();
#endif

#if defined(__MTK_TARGET__) && defined(DRV_GPIO_FOR_LED_AND_15_SEGMENT)
    gpio_led_init();
    gpio_15_segment_led_init();
#endif

    return ret_val;
}
Beispiel #4
0
kal_bool usbc_cosim_core_task_init(void)
{
    usbc_core_t* pUsbCore;
    kal_char usbc_class_mutex_name[50];

#ifdef IPCORE_NOT_PRESENT
    hmu_boot_init();
#endif

    usbc_set_op_mode(USBC_OP_MODE_NORMAL);
    kal_mem_set(usbc_core_get_instance(), 0, sizeof(usbc_core_t));

    usbc_core_clear_register();
    usbc_core_clear_status();

    pUsbCore = usbc_core_get_instance();
    // create enhance mutex
    sprintf(usbc_class_mutex_name, "USBC_CLASS_REMOTE_WK_MUTEX");
    pUsbCore->usbc_class_remote_wk_mutex = kal_create_enh_mutex(usbc_class_mutex_name);
    sprintf(usbc_class_mutex_name, "USBC_CLASS_RENOTIFY_MUTEX");
    pUsbCore->usbc_class_renotify_mutex = kal_create_enh_mutex(usbc_class_mutex_name);
    sprintf(usbc_class_mutex_name, "USBC_CLASS_FUNC_ACCESS_MUTEX");
    pUsbCore->usbc_class_func_access_mutex = kal_create_enh_mutex(usbc_class_mutex_name);
    if ( NULL == pUsbCore->usbc_class_remote_wk_mutex ||
         NULL == pUsbCore->usbc_class_renotify_mutex ||
         NULL == pUsbCore->usbc_class_func_access_mutex )
    {
        ASSERT(0);
    }

    // initial an evnet scheduler
    pUsbCore->usbc_es_wk_notify_g = evshed_create(
                        "USBC_WK_NOTIFY", /* timer_name: event scheduler name */
                        MOD_USBCORE, /* dest_mod_id: system sends timeout message to this module when event scheduler timeout happens */
                        0, /* fuzz */
                        255); /* max_delay_ticks */
    if (pUsbCore->usbc_es_wk_notify_g) {
        evshed_set_index(pUsbCore->usbc_es_wk_notify_g, USBC_WK_NOTIFY_INDEX);
    } else {
        ASSERT(0);
    }

    usbc_normal_hif_factory();
    usbc_cosim_hif_factory();

    usbc_stack_checkin(USB_CLASS_NUM, NULL);
    return KAL_TRUE;
}
Beispiel #5
0
void tcm_init_timer(void)
{
    kal_uint8 indx;

    /* Poying: Use new EV_SH api. */   
    tcm_ptr_g->tcm_event_scheduler_ptr = evshed_create("TCM_TIMER", (module_type)TCM_MODULE_ID, 0, 255) ;
   
    /* Initialize the context_id for each t3333 timer. */ 
    for(indx = 0; indx < TCM_TOT_CONTEXT; indx++)
    {
        tcm_ptr_g->t3333timer[indx].context_id = 0xff ;
        tcm_ptr_g->t3333timer[indx].event_id = NULL ;
    }

    return;
}
Beispiel #6
0
/*****************************************************************************
 * FUNCTION
 *  med_startup_hdlr
 * DESCRIPTION
 *  This function is handle startup procedure of media task.
 * PARAMETERS
 *  ilm_ptr     [?]     
 * RETURNS
 *  void
 *****************************************************************************/
void med_startup_hdlr(ilm_struct *ilm_ptr)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    
    med_context_p->event_scheduler_ptr = evshed_create("MED base timer", MOD_MED, 0, 0 );

    aud_startup_hdlr(ilm_ptr);

    /* start to read nvram data for media task */
    aud_startup_read_nvram_data();

}
Beispiel #7
0
void bmt_timer_init(void)
{
	bmt_event_scheduler_ptr = evshed_create("BMT Timer",MOD_BMT,0,255);
	evshed_set_index(bmt_event_scheduler_ptr,BMT_TIMER_INDEX);
}
Beispiel #8
0
/*****************************************************************************
* FUNCTION
*  smu_init
* DESCRIPTION
*  This function is to initialize the sim context.
*
* PARAMETERS
*  none 
* RETURNS
*  none
* GLOBALS AFFECTED
*  none
*****************************************************************************/
kal_bool smu_init( void )
{
#if defined(__SATCE__) && !defined(__RSAT__)
   kal_uint8   CH;
#endif
   kal_uint8 i=0;

   for (i=0; i<MAX_SIM_NUM; i++)
   {
        this_smu = &smu_context_g[i];
        this_smu->smu_current_mod = SMU_MODULE(MOD_SMU, i);
        this_smu->security_status=0;
        this_smu->pending_password_id=ID_READY;
        this_smu->is_puk_unlock=KAL_FALSE;
        this_smu->is_exception_reset=KAL_FALSE;
        this_smu->is_phone_lock_verified=KAL_FALSE;
        this_smu->is_mmi_security_ind_recv = KAL_FALSE;
        this_smu->is_mmrr_ready_ind_recv=KAL_FALSE;
        this_smu->is_mmrr_ready_ind_sent=KAL_FALSE;
        this_smu->dn_type = TYPE_NONE;
        this_smu->plmn_sel_info.plmn_ptr=NULL;
        this_smu->uplmn_wact_info.plmn_ptr = NULL;
        this_smu->oplmn_wact_info.plmn_ptr = NULL;
        this_smu->hplmn_wact_info.plmn_ptr = NULL;
        this_smu->cipher_ind = SMU_CI_NONE;
        this_smu->is_simcard_replaced = KAL_TRUE;
        this_smu->is_sim_card_inserted = SMU_SIM_UNKNOWN;
        this_smu->sim_status = SMU_SIM_NOT_READY; // [MAUI_00632199]
        kal_mem_set(this_smu->imsi,0x00,9);
        this_smu->is_personalization_done=KAL_FALSE;       
    #ifdef __SIM_ME_LOCK__
        this_smu->is_sml_refresh = KAL_FALSE;
        this_smu->cphs_lock_count=5;
        this_smu->l4csmu_set_sml_cnf_ptr = NULL;       
        this_smu->is_autolock_enable = KAL_FALSE;
        this_smu->is_autolock_success = KAL_FALSE;
        this_smu->autolock_remain_count = 0;
        this_smu->is_masterkey_unlocked = KAL_FALSE;       
    #endif
    #if defined(__SATCE__) && !defined(__RSAT__)
        this_smu->sate_app_id = 0;

        for (CH=0; CH<MAX_SUPPORT_SATE_CHANNEL+1; CH++)
        {
            /* Register timer expiry message */
            this_smu->sate_channel[CH].smu_timer_context.smu_timer_ilm.dest_mod_id = SMU_MODULE(MOD_SMU, i);
            this_smu->sate_channel[CH].smu_timer_context.smu_timer_ilm.src_mod_id = MOD_TIMER;
            this_smu->sate_channel[CH].smu_timer_context.smu_timer_ilm.msg_id = MSG_ID_TIMER_EXPIRY;
            this_smu->sate_channel[CH].smu_timer_context.smu_timer_ilm.local_para_ptr = NULL;
            this_smu->sate_channel[CH].smu_timer_context.smu_timer_ilm.peer_buff_ptr = NULL;

            /* Create an Event Scheduler */
            this_smu->sate_channel[CH].smu_timer_context.smu_event_scheduler_ptr1 = evshed_create("SMU_BASE_TIMER", SMU_MODULE(MOD_SMU, i), 0, 255);

            this_smu->sate_channel[CH].is_cmd_modified = KAL_FALSE;
            this_smu->sate_channel[CH].bearer = 0x00;
            this_smu->sate_channel[CH].buffer_size = 0;
            this_smu->sate_channel[CH].avail_buf_size = 0;
            this_smu->sate_channel[CH].satce_buf_hd = 0;
            this_smu->sate_channel[CH].satce_buffer = NULL;
            this_smu->sate_channel[CH].channel_id = SAT_NO_CHANNEL;
            this_smu->sate_channel[CH].channel_data_len = 0;
            this_smu->sate_channel[CH].soc_fd = -1;		/* SOC_ERROR */
            this_smu->sate_channel[CH].channel_status[0]=0x00;
            this_smu->sate_channel[CH].channel_status[1]=0x00;
            this_smu->sate_channel[CH].no_apn = 0;
            this_smu->sate_channel[CH].apn = NULL;
            this_smu->sate_channel[CH].no_local_addr = 0;
            this_smu->sate_channel[CH].local_addr = NULL;
            this_smu->sate_channel[CH].no_dest_addr = 0;
            this_smu->sate_channel[CH].dest_addr = NULL;
            this_smu->sate_channel[CH].no_username = 0;
            this_smu->sate_channel[CH].username = NULL;
            this_smu->sate_channel[CH].no_passwd = 0;
            this_smu->sate_channel[CH].passwd = NULL;
        }
    #endif // __SATCE__
   }   

   return KAL_TRUE;
}