Example #1
0
INT32 wmt_dbg_dsns_ctrl(INT32 par1, INT32 par2, INT32 par3)
{
    if (0 == par1)
    {
        mtk_wcn_wmt_dsns_ctrl(WMTDSNS_FM_DISABLE);
        WMT_INFO_FUNC("disalbe FM dsns function\n");
    }
    else
    {
        mtk_wcn_wmt_dsns_ctrl(WMTDSNS_FM_ENABLE);
        WMT_INFO_FUNC("enable FM dsns function\n");
    }
    return 0;
}
Example #2
0
/***********************************************************************
*  Frequency Avoidance
*
***********************************************************************/
int MT6620_MCU_Freq_Avoid(uint16_t freq, int *freqavoid)
{
    int ret = 0;
    int mcuDsense = FM_MCU_DESENSE_DISABLE;
    uint16_t len = 0;
    uint16_t indx = 0;
    static uint16_t FreqList[] ={780, 794, 832, 926, 960, 1040};

    FM_LOG_DBG(D_MAIN,"+%s, [freq=%d]\n", __func__, (int)freq);
    FM_COM_ASSERT(op_cb->read);
    FM_COM_ASSERT(op_cb->write);

    *freqavoid = 0;
    
    len = sizeof(FreqList)/sizeof(FreqList[0]);
    indx = 0;
    while((indx < len) && (mcuDsense != FM_MCU_DESENSE_ENABLE)){
        if(FreqList[indx] == freq){
            mcuDsense = FM_MCU_DESENSE_ENABLE;
            *freqavoid = 1;
        }
        indx++;
    }

	if(mcuDsense == FM_MCU_DESENSE_DISABLE){
		if(mtk_wcn_wmt_dsns_ctrl(WMTDSNS_FM_DISABLE)){
			ret = 0;
		}else{
			ret = -ERR_STP;
		}
	}else if(mcuDsense == FM_MCU_DESENSE_ENABLE){
		if(mtk_wcn_wmt_dsns_ctrl(WMTDSNS_FM_ENABLE)){
			ret = 0;
		}else{
			ret = -ERR_STP;
		}
	}else{
		FM_LOG_ERR(D_MAIN,"para error!\n");
		ret = -ERR_INVALID_PARA;
	}
    
    FM_LOG_NTC(D_MAIN,"-%s, [mcuDsense=%d][ret=%d]\n", __func__, (int)mcuDsense, ret);
    return ret;
}
INT32 wmt_dbg_dsns_ctrl(INT32 par1, INT32 par2, INT32 par3)
{
    if (WMTDSNS_FM_DISABLE <= par2 && WMTDSNS_MAX > par2 )
    {
        WMT_INFO_FUNC("DSNS type (%d)\n", par2);
        mtk_wcn_wmt_dsns_ctrl(par2);
    }
    else
    {
        WMT_WARN_FUNC("invalid DSNS type\n");
    }
    return 0;
}