Lines Matching refs:pMeasurementSRV
68 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
137 pMeasurementSRV->SMState = MSR_SRV_STATE_IDLE;
140 return fsm_Config( pMeasurementSRV->SM, (fsm_Matrix_t)smMatrix,
142 (fsm_eventActivation_t)measurementSRVSM_SMEvent, pMeasurementSRV->hOS );
159 measurementSRV_t *pMeasurementSRV = (measurementSRV_t *)hMeasurementSrv;
164 status = fsm_GetNextState( pMeasurementSRV->SM, (TI_UINT8)*currentState, (TI_UINT8)event, &nextState );
167 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "measurementSRVSM_SMEvent: State machine error, failed getting next state\n");
172 TRACE3( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "measurementSRVSM_SMEvent: <currentState = %d, event = %d> --> nextState = %d\n", currentState, event, nextState);
175 return fsm_Event( pMeasurementSRV->SM, (TI_UINT8*)currentState, (TI_UINT8)event, hMeasurementSrv );
189 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
195 cmdBld_GetParam (pMeasurementSRV->hCmdBld, ¶mInfo);
198 if ( paramInfo.content.halCtrlCurrentChannel == pMeasurementSRV->msrRequest.channel )
201 PSStatus = powerSrv_ReservePS( pMeasurementSRV->hPowerSaveSRV, POWER_SAVE_KEEP_CURRENT,
207 PSStatus = powerSrv_ReservePS( pMeasurementSRV->hPowerSaveSRV, POWER_SAVE_ON,
214 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Driver mode entered successfully\n");
216 return measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
221 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Driver mode pending\n");
225 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Error %d when requesting driver mode\n",PSStatus);
228 pMeasurementSRV->returnStatus = PSStatus;
231 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
250 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
253 TI_UINT32 currentTime = os_timeStampMs( pMeasurementSRV->hOS );
256 if ( (pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs)
261 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": request time has expired, request expiry time:%d, current time:%d\n", pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs, currentTime);
264 for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
266 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
270 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
276 pMeasurementCmd.channel = pMeasurementSRV->msrRequest.channel;
277 pMeasurementCmd.band = pMeasurementSRV->msrRequest.band;
279 pMeasurementCmd.eTag = pMeasurementSRV->msrRequest.eTag;
288 cmdBld_GetParam (pMeasurementSRV->hCmdBld, ¶mInfo);
293 if ( paramInfo.content.halCtrlCurrentChannel == pMeasurementSRV->msrRequest.channel )
313 status = cmdBld_CmdMeasurement (pMeasurementSRV->hCmdBld,
316 pMeasurementSRV);
320 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Failed to send measurement start command, statud=%d,\n", status);
323 pMeasurementSRV->returnStatus = status;
326 return measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
330 TRACE6( pMeasurementSRV
333 pMeasurementSRV->bStartStopTimerRunning = TI_TRUE;
334 tmr_StartTimer (pMeasurementSRV->hStartStopTimer,
336 (TI_HANDLE)pMeasurementSRV,
354 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
361 TI_UINT32 currentTime = os_timeStampMs( pMeasurementSRV->hOS );
364 if ( (pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs)
369 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": request time has expired, request expiry time:%d, current time:%d\n", pMeasurementSRV->requestRecptionTimeStampMs + pMeasurementSRV->timeToRequestExpiryMs, currentTime);
372 for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
374 pMeasurementSRV->msrReply.msrTypes[ i ].status = MSR_REJECT_MAX_DELAY_PASSED;
378 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
386 for ( requestIndex = 0; requestIndex < pMeasurementSRV->msrRequest.numberOfTypes ; requestIndex++ )
388 switch (pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].msrType)
396 (TI_UINT8*)&pMeasurementSRV->mediumOccupancyResults;
397 status = cmdBld_GetParam (pMeasurementSRV->hCmdBld, &tTwdParam);
400 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Medium Usage has been nullified, starting timer.\n");
403 tmr_StartTimer (pMeasurementSRV->hRequestTimer[requestIndex],
405 (TI_HANDLE)pMeasurementSRV,
406 pMeasurementSRV->msrRequest.msrTypes[requestIndex].duration,
408 pMeasurementSRV->bRequestTimerRunning[requestIndex] = TI_TRUE;
412 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_GetParam (for channel load) returned status %d\n", status);
421 os_memoryZero( pMeasurementSRV->hOS, &(pNoiseHistParams.ranges[0]), MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES );
428 /* rangeUpperBound = TWD_convertRSSIToRxLevel( pMeasurementSRV->hTWD, -87); */
445 TRACE8(pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ":Noise histogram Measurement Ranges:\n%d %d %d %d %d %d %d %d\n", (TI_INT8) pNoiseHistParams.ranges[0], (TI_INT8) pNoiseHistParams.ranges[1], (TI_INT8) pNoiseHistParams.ranges[2], (TI_INT8) pNoiseHistParams.ranges[3], (TI_INT8) pNoiseHistParams.ranges[4], (TI_INT8) pNoiseHistParams.ranges[5], (TI_INT8) pNoiseHistParams.ranges[6], (TI_INT8) pNoiseHistParams.ranges[7]);
448 status = cmdBld_CmdNoiseHistogram (pMeasurementSRV->hCmdBld, &pNoiseHistParams, NULL, NULL);
453 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Sent noise histogram command. Starting timer\n");
456 tmr_StartTimer (pMeasurementSRV->hRequestTimer[requestIndex],
458 (TI_HANDLE)pMeasurementSRV,
459 pMeasurementSRV->msrRequest.msrTypes[requestIndex].duration,
461 pMeasurementSRV->bRequestTimerRunning[requestIndex] = TI_TRUE;
465 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_NoiseHistogramCmd returned status %d\n", status);
471 pApDiscoveryParams.scanDuration = pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].duration * 1000; /* TODO change this to an infinite value (was 0) */
476 pApDiscoveryParams.txPowerDbm = pMeasurementSRV->msrRequest.txPowerDbm;
483 if ( MSR_SCAN_MODE_PASSIVE == pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].scanMode )
489 status = cmdBld_CmdApDiscovery (pMeasurementSRV->hCmdBld, &pApDiscoveryParams, NULL, NULL);
493 TRACE7( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": AP discovery command sent. Params:\n scanDuration=%d, scanOptions=%d, numOfProbRqst=%d, txdRateSet=%d, txPowerDbm=%d, configOptions=%d, filterOptions=%d\n Starting timer...\n", pApDiscoveryParams.scanDuration, pApDiscoveryParams.scanOptions, pApDiscoveryParams.numOfProbRqst, pApDiscoveryParams.txdRateSet, pApDiscoveryParams.txPowerDbm, pApDiscoveryParams.ConfigOptions, pApDiscoveryParams.FilterOptions);
496 tmr_StartTimer (pMeasurementSRV->hRequestTimer[requestIndex],
498 (TI_HANDLE)pMeasurementSRV,
499 pMeasurementSRV->msrRequest.msrTypes[requestIndex].duration,
501 pMeasurementSRV->bRequestTimerRunning[ requestIndex ] = TI_TRUE;
505 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_ApDiscoveryCmd returned status %d\n", status);
512 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Measurement type %d is not supported\n", pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].msrType);
522 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
540 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
545 if (pMeasurementSRV->bStartStopTimerRunning)
547 tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
548 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
552 status = cmdBld_CmdMeasurementStop (pMeasurementSRV->hCmdBld,
553 (void *)pMeasurementSRV->commandResponseCBFunc,
554 pMeasurementSRV->commandResponseCBObj);
556 pMeasurementSRV->commandResponseCBFunc = NULL;
557 pMeasurementSRV->commandResponseCBObj = NULL;
561 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Failed to send measurement stop command, statud=%d,\n", status);
564 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState), MSR_SRV_EVENT_STOP_COMPLETE );
568 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure stop command sent.\n");
571 pMeasurementSRV->bStartStopTimerRunning = TI_TRUE;
572 tmr_StartTimer (pMeasurementSRV->hStartStopTimer,
574 (TI_HANDLE)pMeasurementSRV,
592 measurementSRV_t *pMeasurementSRV = (measurementSRV_t *)hMeasurementSRV;
595 powerSrv_ReleasePS( pMeasurementSRV->hPowerSaveSRV, pMeasurementSRV->bSendNullDataWhenExitPs, NULL, NULL );
598 if ( NULL != pMeasurementSRV->commandResponseCBFunc )
600 pMeasurementSRV->commandResponseCBFunc( pMeasurementSRV->commandResponseCBObj, TI_OK );
604 if ( NULL != pMeasurementSRV->measurmentCompleteCBFunc )
606 pMeasurementSRV->measurmentCompleteCBFunc( pMeasurementSRV->measurementCompleteCBObj,
607 &(pMeasurementSRV->msrReply));
624 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
627 powerSrv_ReleasePS( pMeasurementSRV->hPowerSaveSRV, pMeasurementSRV->bSendNullDataWhenExitPs, NULL, NULL );
630 if ( TI_FALSE == pMeasurementSRV->bInRequest )
632 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": stop from wait for driver mode: not within a request context?!? \n");
636 if ( NULL != pMeasurementSRV->commandResponseCBFunc )
638 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": stop from wait for driver mode: command response CB is not NULL?!? \n");
639 pMeasurementSRV->commandResponseCBFunc( pMeasurementSRV->commandResponseCBObj, TI_OK );
641 pMeasurementSRV->commandResponseCBFunc = NULL;
642 pMeasurementSRV->commandResponseCBObj = NULL;
645 if ( NULL != pMeasurementSRV->measurmentCompleteCBFunc )
651 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
654 pMeasurementSRV->measurmentCompleteCBFunc( pMeasurementSRV->measurementCompleteCBObj,
655 &(pMeasurementSRV->msrReply));
659 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": stop from wait for driver mode and response CB is NULL!!!\n");
669 if ( NULL != pMeasurementSRV->commandResponseCBFunc )
673 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": stop from wait for driver mode - within request context and command response is not NULL?!?\n");
675 cmdBld_CmdMeasurementStop (pMeasurementSRV->hCmdBld,
676 (void *)pMeasurementSRV->commandResponseCBFunc,
677 pMeasurementSRV->commandResponseCBObj);
679 pMeasurementSRV->commandResponseCBFunc = NULL;
680 pMeasurementSRV->commandResponseCBObj = NULL;
682 if ( NULL != pMeasurementSRV->measurmentCompleteCBFunc )
689 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
692 pMeasurementSRV->measurmentCompleteCBFunc( pMeasurementSRV->measurementCompleteCBObj,
693 &(pMeasurementSRV->msrReply));
712 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
716 for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
718 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
739 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
745 for (i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++)
747 if (pMeasurementSRV->bRequestTimerRunning[i])
750 tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
751 pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
754 switch ( pMeasurementSRV->msrRequest.msrTypes[ i ].msrType )
758 status = cmdBld_CmdApDiscoveryStop (pMeasurementSRV->hCmdBld, NULL, NULL);
761 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_ApDiscoveryStop returned status %d\n", status);
769 os_memoryZero( pMeasurementSRV->hOS, &(pNoiseHistParams.ranges[ 0 ]), MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES );
772 status = cmdBld_CmdNoiseHistogram (pMeasurementSRV->hCmdBld, &pNoiseHistParams, NULL, NULL);
776 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": TWD_NoiseHistogramCmd returned status %d\n", status);
786 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": unsupported measurement type: %d\n", pMeasurementSRV->msrRequest.msrTypes[ i ].msrType);
791 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
796 status = cmdBld_CmdMeasurementStop (pMeasurementSRV->hCmdBld,
797 (void *)pMeasurementSRV->commandResponseCBFunc,
798 pMeasurementSRV->commandResponseCBObj);
800 pMeasurementSRV->commandResponseCBFunc = NULL;
801 pMeasurementSRV->commandResponseCBObj = NULL;
805 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Failed to send measurement stop command, statud=%d,\n", status);
808 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
813 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure stop command sent.\n");
816 pMeasurementSRV->bStartStopTimerRunning = TI_TRUE;
817 tmr_StartTimer (pMeasurementSRV->hStartStopTimer,
819 (TI_HANDLE)pMeasurementSRV,
837 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
849 if ( TI_FALSE == pMeasurementSRV->bInRequest )
852 if ( NULL != pMeasurementSRV->commandResponseCBFunc )
854 pMeasurementSRV->commandResponseCBFunc( pMeasurementSRV->commandResponseCBObj, TI_NOK );
858 if ( NULL != pMeasurementSRV->measurmentCompleteCBFunc )
864 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
867 pMeasurementSRV->measurmentCompleteCBFunc( pMeasurementSRV->measurementCompleteCBObj,
868 &(pMeasurementSRV->msrReply));
872 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": driver mode failure and complete CB is NULL!!!\n");
890 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
899 powerSrv_ReleasePS( pMeasurementSRV->hPowerSaveSRV, pMeasurementSRV->bSendNullDataWhenExitPs, NULL, NULL );
903 if ( TI_FALSE == pMeasurementSRV->bInRequest )
906 if ( NULL != pMeasurementSRV->commandResponseCBFunc )
908 pMeasurementSRV->commandResponseCBFunc( pMeasurementSRV->commandResponseCBObj, TI_NOK );
912 if ( NULL != pMeasurementSRV->measurmentCompleteCBFunc )
918 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_NOK;
921 pMeasurementSRV->measurmentCompleteCBFunc( pMeasurementSRV->measurementCompleteCBObj,
922 &(pMeasurementSRV->msrReply));
926 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Start measurement failure and response and complete CBs are NULL!!!\n");
936 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
939 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS = %d\n", uMboxStatus);
943 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS_SUCCESS!\n");
945 if ( NULL != pMeasurementSRV->commandResponseCBFunc )
947 pMeasurementSRV->commandResponseCBFunc( pMeasurementSRV->commandResponseCBObj, TI_OK );
954 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS_REJECT_MEAS_SG_ACTIVE!\n");
957 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": FW has responded with CMD_STATUS NOK!!!\n");
961 if ( TI_TRUE == pMeasurementSRV->bStartStopTimerRunning )
963 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "***** STOP TIMER 8 *****\n");
964 tmr_StopTimer( pMeasurementSRV->hStartStopTimer );
965 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
969 if ( TI_TRUE == pMeasurementSRV->bRequestTimerRunning[ i ] )
971 tmr_StopTimer( pMeasurementSRV->hRequestTimer[ i ] );
972 pMeasurementSRV->bRequestTimerRunning[ i ] = TI_FALSE;
976 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
993 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSrv;
995 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_WARNING, ": sending unnecessary stop measurement command to FW...\n");
998 cmdBld_CmdMeasurementStop (pMeasurementSRV->hCmdBld,
999 (void *)pMeasurementSRV->commandResponseCBFunc,
1000 pMeasurementSRV->commandResponseCBObj);
1002 pMeasurementSRV->commandResponseCBFunc = NULL;
1003 pMeasurementSRV->commandResponseCBObj = NULL;
1019 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSrv;
1022 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_SM, ": measurement SRV state machine error, unexpected Event\n");
1024 if (pMeasurementSRV->bStartStopTimerRunning)
1026 tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
1027 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
1032 if (pMeasurementSRV->bRequestTimerRunning[i])
1034 tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
1035 pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
1041 pMeasurementSRV->commandResponseCBFunc = NULL;
1042 pMeasurementSRV->commandResponseCBObj = NULL;
1045 pMeasurementSRV->returnStatus = TI_NOK;