TI_STATUS SoftGemini_SetDefaults (TI_HANDLE hSoftGemini, SoftGeminiInitParams_t *pSoftGeminiInitParams) { SoftGemini_t *pSoftGemini = (SoftGemini_t *)hSoftGemini; TI_UINT8 i =0; TI_STATUS status; /*************************************/ /* Getting SoftGemini init Params */ /***********************************/ pSoftGemini->SoftGeminiEnable = pSoftGeminiInitParams->SoftGeminiEnable; for (i =0; i< SOFT_GEMINI_PARAMS_MAX ; i++) { pSoftGemini->SoftGeminiParam.coexParams[i] = pSoftGeminiInitParams->coexParams[i]; } pSoftGemini->SoftGeminiParam.paramIdx = 0xFF; /* signals to FW to config all the paramters */ /* Send the configuration to the FW */ status = SoftGemini_setParamsToFW(hSoftGemini, &pSoftGemini->SoftGeminiParam); /*******************************/ /* register Indication interrupts */ /*****************************/ TWD_RegisterEvent (pSoftGemini->hTWD, TWD_OWN_EVENT_SOFT_GEMINI_SENSE, (void *)SoftGemini_SenseIndicationCB, hSoftGemini); TWD_RegisterEvent (pSoftGemini->hTWD, TWD_OWN_EVENT_SOFT_GEMINI_PREDIC, (void *)SoftGemini_ProtectiveIndicationCB, hSoftGemini); TWD_EnableEvent (pSoftGemini->hTWD, TWD_OWN_EVENT_SOFT_GEMINI_SENSE); TWD_EnableEvent (pSoftGemini->hTWD, TWD_OWN_EVENT_SOFT_GEMINI_PREDIC); /* On system initialization SG is disabled but later calls to SoftGemini_setEnableParam() */ pSoftGemini->bProtectiveMode = TI_FALSE; pSoftGemini->SoftGeminiEnable = SG_DISABLE; pSoftGemini->bDriverEnabled = TI_FALSE; pSoftGemini->bPsPollFailureActive = TI_FALSE; if ((TI_OK == status) && (pSoftGeminiInitParams->SoftGeminiEnable != SG_DISABLE)) { /* called only if different than SG_DISABLE */ status = SoftGemini_setEnableParam(hSoftGemini, pSoftGeminiInitParams->SoftGeminiEnable, TI_FALSE); } if (status == TI_OK) { TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_INIT, " SoftGemini_config() - configured successfully\n"); } else { TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_ERROR, " SoftGemini_config() - Error configuring module \n"); } return status; }
/*************************************************************************** * SoftGemini_handleRecovery * **************************************************************************** * DESCRIPTION: The function reconfigures WHAL with the SG parameters. * * INPUTS: pSoftGemini - the object ***************************************************************************/ TI_STATUS SoftGemini_handleRecovery(TI_HANDLE hSoftGemini) { SoftGemini_t *pSoftGemini = (SoftGemini_t *)hSoftGemini; ESoftGeminiEnableModes realSoftGeminiEnableMode; realSoftGeminiEnableMode = pSoftGemini->SoftGeminiEnable; /* Disable the SG */ SoftGemini_setEnableParam(hSoftGemini, SG_DISABLE, TI_TRUE); pSoftGemini->SoftGeminiEnable = realSoftGeminiEnableMode; /* Set enable param */ SoftGemini_setEnableParam(hSoftGemini, pSoftGemini->SoftGeminiEnable, TI_TRUE); /* Config the params to FW */ SoftGemini_setParamsToFW(hSoftGemini, &pSoftGemini->SoftGeminiParam); /*SoftGemini_printParams(hSoftGemini);*/ return TI_OK; }
/*********************************************************************** * SoftGemini_setParam *********************************************************************** DESCRIPTION: SoftGemini set param function, called by the following: - config mgr in order to set a parameter receiving from the OS abstraction layer. - From inside the driver INPUT: hSoftGemini - SoftGemini handle. pParam - Pointer to the parameter OUTPUT: RETURN: TI_OK on success, TI_NOK otherwise ************************************************************************/ TI_STATUS SoftGemini_setParam(TI_HANDLE hSoftGemini, paramInfo_t *pParam) { SoftGemini_t *pSoftGemini = (SoftGemini_t *)hSoftGemini; TI_STATUS return_value = TI_OK; TRACE1(pSoftGemini->hReport, REPORT_SEVERITY_INFORMATION, " SoftGemini_setParam() (0x%x)\n", pParam->paramType); switch(pParam->paramType) { case SOFT_GEMINI_SET_ENABLE: return_value = SoftGemini_setEnableParam(hSoftGemini,pParam->content.SoftGeminiEnable, TI_FALSE); break; case SOFT_GEMINI_SET_CONFIG: /* copy new params to SoftGemini module */ SoftGemini_setConfigParam(hSoftGemini,pParam->content.SoftGeminiParamArray); /* set new params to FW */ return_value = SoftGemini_setParamsToFW(hSoftGemini, &(pSoftGemini->SoftGeminiParam)); if (pSoftGemini->bProtectiveMode == TI_TRUE) { /* set new configurations of scan to scancncn */ scanCncn_SGconfigureScanParams(pSoftGemini->hScanCncn,TI_TRUE, (TI_UINT8)pSoftGemini->SoftGeminiParam.coexParams[SOFT_GEMINI_AUTO_SCAN_PROBE_REQ], pSoftGemini->SoftGeminiParam.coexParams[SOFT_GEMINI_HV3_MAX_OVERRIDE], pSoftGemini->SoftGeminiParam.coexParams[SOFT_GEMINI_ACTIVE_SCAN_DURATION_FACTOR_HV3]); } break; default: TRACE1(pSoftGemini->hReport, REPORT_SEVERITY_ERROR, " SoftGemini_setParam(), Params is not supported, %d\n\n", pParam->paramType); return PARAM_NOT_SUPPORTED; } return return_value; }
/*************************************************************************** * SoftGemini_handleRecovery * **************************************************************************** * DESCRIPTION: The function reconfigures WHAL with the SG parameters. * * INPUTS: pSoftGemini - the object ***************************************************************************/ TI_STATUS SoftGemini_handleRecovery(TI_HANDLE hSoftGemini) { SoftGemini_t *pSoftGemini = (SoftGemini_t *)hSoftGemini; ESoftGeminiEnableModes realSoftGeminiEnableMode; realSoftGeminiEnableMode = pSoftGemini->SoftGeminiEnable; /* Disable the SG */ SoftGemini_setEnableParam(hSoftGemini, SG_DISABLE, TI_TRUE); TRACE0(pSoftGemini->hReport, REPORT_SEVERITY_INFORMATION, "Disable SG \n"); pSoftGemini->SoftGeminiEnable = realSoftGeminiEnableMode; /* Set enable param */ SoftGemini_setEnableParam(hSoftGemini, pSoftGemini->SoftGeminiEnable, TI_TRUE); TRACE1(pSoftGemini->hReport, REPORT_SEVERITY_INFORMATION, "Set SG to-%d\n", pSoftGemini->SoftGeminiEnable); /* Config the params to FW */ SoftGemini_setParamsToFW(hSoftGemini, &pSoftGemini->SoftGeminiParam); /*SoftGemini_printParams(hSoftGemini);*/ return TI_OK; }