kal_bool sim_queryGet9000WhenSelect(SIM_ICC_APPLICATION application)
{
	Sim_Card *SimCard;
	kal_uint32 simInterface;

	simInterface = sim_get_logicalNum_from_app(application);
	SimCard = GET_SIM_CB(simInterface);

	return SimCard->get9000WhenSelect;
}
/*following are pure SW query, no matter of different driver solutions*/
sim_card_speed_type L1sim_Get_CardSpeedType(SIM_ICC_APPLICATION application)
{
	Sim_Card *SimCard;
	kal_uint32 simInterface;

	simInterface = sim_get_logicalNum_from_app(application);

	SimCard = GET_SIM_CB(simInterface);

   return SimCard->sim_card_speed;
}
sim_status L1sim_Cmd_All(kal_uint8  *txData,kal_uint32  *txSize,kal_uint8  *rxData, kal_uint32  *rxSize, SIM_ICC_APPLICATION application)
{
	sim_ctrlDriver *simDriver;
	sim_status status;

	kal_uint32 simInterface;
   sim_HW_cb *hw_cb;
#if defined(__SIM_HOT_SWAP_POLL_TIMER__) && defined(__SIM_HOT_SWAP_SUPPORT__)
	Sim_Card *SimCard;
	usim_dcb_struct *usim_dcb;
#endif
	simInterface = sim_get_logicalNum_from_app(application);
	hw_cb = (sim_HW_cb *)(hwCbArray[simInterface]);	
#if defined (LPWR_SLIM)
	L1SM_SleepDisable(hw_cb->smHandler); //lock sleep mode		
#endif

	if(DRV_SIM_MAX_LOGICAL_INTERFACE <= simInterface)
		ASSERT(0);

	if(KAL_TRUE == sim_physicalSlotChanged)
		simInterface = 1-simInterface;


	if(0x0 == txData || 0x0 == txSize || 0x0 == rxSize)
		ASSERT(0);

	/*find out the hooked function table*/
	simDriver = sim_driverTable[simInterface];
	ASSERT(0 != simDriver);
	simDriver->addMessage(SIM_AL_ACTION_COMMAND, simInterface, (kal_uint32)kal_get_current_thread_ID(), 0);
	status = simDriver->command(txData, txSize, rxData, rxSize, (sim_HW_cb *)(hwCbArray[simInterface]));
	simDriver->addMessage(SIM_AL_ACTION_EOC, simInterface, 0, 0);
	simDriver->EOC((sim_HW_cb *)(hwCbArray[simInterface]));
#if defined (LPWR_SLIM)
	L1SM_SleepEnable(hw_cb->smHandler);  //unlock sleep mode 	
#endif	
#if defined(__SIM_HOT_SWAP_POLL_TIMER__) && defined(__SIM_HOT_SWAP_SUPPORT__)
	SimCard = GET_SIM_CB(hw_cb->simInterface);
	usim_dcb = GET_USIM_CB(hw_cb->simInterface);
	if(SimCard->poll_sim_2s || usim_dcb->poll_sim_2s) 
	{
		sim_hot_swap_poll_timer_rollback(application);
		SimCard->poll_sim_2s = KAL_FALSE;
		usim_dcb->poll_sim_2s = KAL_FALSE;
#if	!defined( __MAUI_BASIC__)
       tst_sys_trace("[SIM DRV]stop timer\n\r");
#else
	   dbg_print("[SIM DRV]stop timer\n\r");
#endif
		if(status == 0x0000)
		{
#ifdef __SIM_HOT_SWAP_SUPPORT__
			iccHotPlugTable[simInterface].plugOutcb(simInterface);
#endif
#if	!defined( __MAUI_BASIC__)
       tst_sys_trace("[SIM DRV]real hot plug\n\r");
#else
	   dbg_print("[SIM DRV]real hot plug\n\r");
#endif
		}
	}
#endif

	return status;
}