Ejemplo n.º 1
0
void SoftGemini_SenseIndicationCB( TI_HANDLE hSoftGemini, char* str, TI_UINT32 strLen )
{
	SoftGemini_t	*pSoftGemini = (SoftGemini_t *)hSoftGemini;

	if (pSoftGemini->SoftGeminiEnable == SG_DISABLE) {
		return;
	}

	if ( (SENSE_MODE_ENABLE == *str) && (!pSoftGemini->bDriverEnabled) )
	{
			SoftGemini_EnableDriver(hSoftGemini);
	}
	else if ( (SENSE_MODE_DISABLE == *str) && (pSoftGemini->bDriverEnabled) )
	{
			SoftGemini_DisableDriver(hSoftGemini);
	}
}
Ejemplo n.º 2
0
void SoftGemini_SenseIndicationCB( TI_HANDLE hSoftGemini, char* str, TI_UINT32 strLen )
{
	SoftGemini_t	*pSoftGemini = (SoftGemini_t *)hSoftGemini;

	if (pSoftGemini->SoftGeminiEnable == SG_DISABLE) {
TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_WARNING, ": SG is disabled, existing");
		return;
	}

	if ( (SENSE_MODE_ENABLE == *str) && (!pSoftGemini->bDriverEnabled) )
	{
			SoftGemini_EnableDriver(hSoftGemini);
	}
	else if ( (SENSE_MODE_DISABLE == *str) && (pSoftGemini->bDriverEnabled) )
	{
			SoftGemini_DisableDriver(hSoftGemini);
	}
}
Ejemplo n.º 3
0
/***************************************************************************
*					SoftGemini_setEnableParam					    	       *
****************************************************************************
* DESCRIPTION:	The function sets the  appropriate Enable value,
*				configures SCR , POWER MGR , DATA CTRL , FW.   
*
* INPUTS:		pSoftGemini - the object		
***************************************************************************/
static TI_STATUS SoftGemini_setEnableParam(TI_HANDLE hSoftGemini, ESoftGeminiEnableModes SoftGeminiEnable, TI_BOOL recovery)
{
	SoftGemini_t *pSoftGemini = (SoftGemini_t *)hSoftGemini;
	TTwdParamInfo	param;
	TI_STATUS return_value = TI_OK;

TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_INFORMATION, "  setSoftGeminiEnableParam() - Old value = , New value = \n");


    /*
     * PsPoll work around is active. Just save the value and configure it later
     */
    if ( pSoftGemini->bPsPollFailureActive )
    {
        TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_INFORMATION, "  setSoftGeminiEnableParam() - while PsPollFailure is active\n");

        pSoftGemini->PsPollFailureLastEnableValue = SoftGeminiEnable;
        return TI_OK;
    }

	/**********************************/
	/* Sanity check on enable values */
	/********************************/

	/*				Old Value						New Value		    */        
	/*					|							    |			    */        
	/*			  	   \|/							   \|/			    */        

	if ((pSoftGemini->SoftGeminiEnable == SoftGeminiEnable) && !recovery)
	{
TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_ERROR, "   - setting same value \n");
		return TI_NOK;
	}

	/*******************************/
	/* Make the necessary actions */
	/*****************************/
	
	switch (SoftGeminiEnable)
	{
	case SG_PROTECTIVE:
	case SG_OPPORTUNISTIC:
		
		/* set FW with SG_ENABLE */ 
		param.paramType = TWD_SG_ENABLE_PARAM_ID;
		param.content.SoftGeminiEnable = SoftGeminiEnable;
		return_value = TWD_SetParam (pSoftGemini->hTWD, &param);

		break;

	case SG_DISABLE:
		
		/* set FW with SG_DISABLE */
		param.paramType = TWD_SG_ENABLE_PARAM_ID;
		param.content.SoftGeminiEnable = SG_DISABLE;
		return_value = TWD_SetParam (pSoftGemini->hTWD, &param);

		if (pSoftGemini->bDriverEnabled)
		{	
			SoftGemini_DisableDriver(hSoftGemini);
		}
		
		break;

	default:
TRACE1(pSoftGemini->hReport, REPORT_SEVERITY_ERROR, " defualt :%d\n",SoftGeminiEnable);
		return TI_NOK;
	}

	/* Pass to the new enable state */
	pSoftGemini->SoftGeminiEnable = SoftGeminiEnable;

	if (TI_OK != return_value)
	{
TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_ERROR, " can't configure enable param to FW :\n");
	}
	
	return return_value;
}
Ejemplo n.º 4
0
/***************************************************************************
*					SoftGemini_setEnableParam					    	       *
****************************************************************************
* DESCRIPTION:	The function sets the  appropriate Enable value,
*				configures SCR , POWER MGR , DATA CTRL , FW.   
*
* INPUTS:		pSoftGemini - the object		
***************************************************************************/
static TI_STATUS SoftGemini_setEnableParam(TI_HANDLE hSoftGemini, ESoftGeminiEnableModes SoftGeminiEnable, TI_BOOL recovery)
{
	SoftGemini_t *pSoftGemini = (SoftGemini_t *)hSoftGemini;
	TTwdParamInfo	param;
	TI_STATUS return_value = TI_OK;



    /*
     * PsPoll work around is active. Just save the value and configure it later
     */
    if ( pSoftGemini->bPsPollFailureActive )
    {

        pSoftGemini->PsPollFailureLastEnableValue = SoftGeminiEnable;
        return TI_OK;
    }

	/**********************************/
	/* Sanity check on enable values */
	/********************************/

	/*				Old Value						New Value		    */        
	/*					|							    |			    */        
	/*			  	   \|/							   \|/			    */        

	if ((pSoftGemini->SoftGeminiEnable == SoftGeminiEnable) && !recovery)
	{
		return TI_NOK;
	}

	/*******************************/
	/* Make the necessary actions */
	/*****************************/
	
	switch (SoftGeminiEnable)
	{
	case SG_PROTECTIVE:
	case SG_OPPORTUNISTIC:
		
		/* set FW with SG_ENABLE */ 
		param.paramType = TWD_SG_ENABLE_PARAM_ID;
		param.content.SoftGeminiEnable = SoftGeminiEnable;
		return_value = TWD_SetParam (pSoftGemini->hTWD, &param);

		break;

	case SG_DISABLE:
		
		/* set FW with SG_DISABLE */
		param.paramType = TWD_SG_ENABLE_PARAM_ID;
		param.content.SoftGeminiEnable = SG_DISABLE;
		return_value = TWD_SetParam (pSoftGemini->hTWD, &param);

		if (pSoftGemini->bDriverEnabled)
		{	
			SoftGemini_DisableDriver(hSoftGemini);
		}
		
		break;

	default:
		return TI_NOK;
	}

	/* Pass to the new enable state */
	pSoftGemini->SoftGeminiEnable = SoftGeminiEnable;
	
	return return_value;
}