Lines Matching refs:pMeasurementSRV
63 measurementSRV_t* pMeasurementSRV;
66 pMeasurementSRV = os_memoryAlloc( hOS, sizeof(measurementSRV_t));
67 if ( NULL == pMeasurementSRV )
74 os_memoryZero( hOS, pMeasurementSRV, sizeof(measurementSRV_t));
77 pMeasurementSRV->hOS = hOS;
80 if ( TI_OK != fsm_Create( hOS, &(pMeasurementSRV->SM), MSR_SRV_NUM_OF_STATES, MSR_SRV_NUM_OF_EVENTS ))
82 pMeasurementSRV->SM = NULL;
84 MacServices_measurementSRV_destroy( pMeasurementSRV );
88 return (TI_HANDLE)pMeasurementSRV;
109 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
113 pMeasurementSRV->hReport = hReport;
114 pMeasurementSRV->hCmdBld = hCmdBld;
115 pMeasurementSRV->hEventMbox = hEventMbox;
116 pMeasurementSRV->hPowerSaveSRV = hPowerSaveSRV;
117 pMeasurementSRV->hTimer = hTimer;
123 pMeasurementSRV->hStartStopTimer = tmr_CreateTimer (pMeasurementSRV->hTimer);
124 if (pMeasurementSRV->hStartStopTimer == NULL)
126 TRACE0(pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, "MacServices_measurementSRV_init(): Failed to create hStartStopTimer!\n");
129 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
133 pMeasurementSRV->hRequestTimer[i] = tmr_CreateTimer (pMeasurementSRV->hTimer);
134 if (pMeasurementSRV->hRequestTimer[i] == NULL)
136 TRACE0(pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, "MacServices_measurementSRV_init(): Failed to create hRequestTimer!\n");
139 pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
146 eventMbox_RegisterEvent (pMeasurementSRV->hEventMbox,
150 eventMbox_UnMaskEvent (pMeasurementSRV->hEventMbox, TWD_OWN_EVENT_MEASUREMENT_START, NULL, NULL);
156 eventMbox_RegisterEvent (pMeasurementSRV->hEventMbox,
160 eventMbox_UnMaskEvent (pMeasurementSRV->hEventMbox, TWD_OWN_EVENT_MEASUREMENT_COMPLETE, NULL, NULL);
163 eventMbox_RegisterEvent (pMeasurementSRV->hEventMbox,
167 eventMbox_UnMaskEvent (pMeasurementSRV->hEventMbox, TWD_OWN_EVENT_AP_DISCOVERY_COMPLETE, NULL, NULL);
182 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
186 if (pMeasurementSRV->bStartStopTimerRunning)
188 tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
189 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
193 if (pMeasurementSRV->bRequestTimerRunning[i])
195 tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
196 pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
203 pMeasurementSRV->SMState = MSR_SRV_STATE_IDLE;
206 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
209 pMeasurementSRV->bRequestTimerRunning[ i ] = TI_FALSE;
224 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
234 if ( NULL != pMeasurementSRV->SM )
236 fsm_Unload( pMeasurementSRV->hOS, pMeasurementSRV->SM );
242 if (pMeasurementSRV->hRequestTimer[i])
244 tmr_DestroyTimer (pMeasurementSRV->hRequestTimer[i]);
247 if (pMeasurementSRV->hStartStopTimer)
249 tmr_DestroyTimer (pMeasurementSRV->hStartStopTimer);
253 os_memoryFree( pMeasurementSRV->hOS, (TI_HANDLE)pMeasurementSRV, sizeof(measurementSRV_t));
279 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)((MacServices_t*)hMacServices)->hMeasurementSRV;
283 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Received measurement request.\n");
284 measurementSRVPrintRequest( (TI_HANDLE)pMeasurementSRV, pMsrRequest );
285 TRACE3( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "time to expiry: %d ms, cmd response CB: 0x%x, cmd response handle: 0x%x\n", timeToRequestExpiryMs, cmdResponseCBFunc, cmdResponseCBObj);
286 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "cmd complete CB: 0x%x, cmd complete handle: 0x%x\n", cmdCompleteCBFunc, cmdCompleteCBObj);
290 pMeasurementSRV->bInRequest = TI_TRUE;
294 pMeasurementSRV->bSendNullDataWhenExitPs = TI_TRUE;
297 pMeasurementSRV->returnStatus = TI_OK;
300 os_memoryCopy (pMeasurementSRV->hOS,
301 (void *)&pMeasurementSRV->msrRequest,
306 pMeasurementSRV->requestRecptionTimeStampMs = os_timeStampMs( pMeasurementSRV->hOS );
307 pMeasurementSRV->timeToRequestExpiryMs = timeToRequestExpiryMs;
310 pMeasurementSRV->commandResponseCBFunc = cmdResponseCBFunc;
311 pMeasurementSRV->commandResponseCBObj = cmdResponseCBObj;
312 pMeasurementSRV->measurmentCompleteCBFunc = cmdCompleteCBFunc;
313 pMeasurementSRV->measurementCompleteCBObj = cmdCompleteCBObj;
316 pMeasurementSRV->msrReply.numberOfTypes = pMsrRequest->numberOfTypes;
319 pMeasurementSRV->msrReply.msrTypes[ i ].msrType = pMeasurementSRV->msrRequest.msrTypes[ i ].msrType;
320 pMeasurementSRV->msrReply.msrTypes[ i ].status = TI_OK;
324 pMeasurementSRV->pendingParamCBs = 0;
327 measurementSRVSM_SMEvent( (TI_HANDLE)pMeasurementSRV, &(pMeasurementSRV->SMState),
331 pMeasurementSRV->bInRequest = TI_FALSE;
333 return pMeasurementSRV->returnStatus;
353 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)((MacServices_t*)hMacServices)->hMeasurementSRV;
355 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Received measurement stop request.\n");
356 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "Send null data:, cmd response CB: 0x%x, cmd response handle: 0x%x\n", cmdResponseCBFunc, cmdResponseCBObj);
359 pMeasurementSRV->commandResponseCBFunc = cmdResponseCBFunc;
360 pMeasurementSRV->commandResponseCBObj = cmdResponseCBObj;
363 pMeasurementSRV->bSendNullDataWhenExitPs = bSendNullData;
366 pMeasurementSRV->returnStatus = TI_OK;
369 pMeasurementSRV->bInRequest = TI_TRUE;
372 measurementSRVSM_SMEvent( (TI_HANDLE)pMeasurementSRV, &(pMeasurementSRV->SMState),
376 pMeasurementSRV->bInRequest = TI_FALSE;
378 return pMeasurementSRV->returnStatus;
391 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)((MacServices_t*)hMacServices)->hMeasurementSRV;
394 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Received FW reset indication.\n");
397 if (pMeasurementSRV->bStartStopTimerRunning)
399 tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
400 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
404 if (pMeasurementSRV->bRequestTimerRunning[i])
406 tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
407 pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
412 pMeasurementSRV
427 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
429 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Power save SRV CB called. PS mode:%d status: %d\n", PSMode, psStatus);
434 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": PS successful.\n");
437 measurementSRVSM_SMEvent( (TI_HANDLE)pMeasurementSRV, &(pMeasurementSRV->SMState),
443 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": PS failed, status %d.\n", psStatus);
446 pMeasurementSRV->returnStatus = (TI_STATUS)psStatus;
449 measurementSRVSM_SMEvent( (TI_HANDLE)pMeasurementSRV, &(pMeasurementSRV->SMState),
465 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
467 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure start CB called.\n");
470 tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
471 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
474 pMeasurementSRV->commandResponseCBFunc = NULL;
475 pMeasurementSRV->commandResponseCBObj = NULL;
477 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
492 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
494 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": measure complete CB called.\n");
497 tmr_StopTimer (pMeasurementSRV->hStartStopTimer);
498 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
500 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
516 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
518 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": AP Discovery complete CB called.\n");
533 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
536 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": FW guard timer expired.\n");
539 pMeasurementSRV->bStartStopTimerRunning = TI_FALSE;
544 if (pMeasurementSRV->bRequestTimerRunning[i])
546 tmr_StopTimer (pMeasurementSRV->hRequestTimer[i]);
547 pMeasurementSRV->bRequestTimerRunning[i] = TI_FALSE;
552 pMeasurementSRV->SMState = MSR_SRV_STATE_IDLE;
555 pMeasurementSRV->failureEventFunc(pMeasurementSRV->failureEventObj ,MEASUREMENT_FAILURE);
569 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
577 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": Request timer expired and request index from findMinDuration is -1?!?");
581 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": request timer expired, request index: %d.\n", requestIndex);
584 pMeasurementSRV->bRequestTimerRunning[ requestIndex ] = TI_FALSE;
587 switch (pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].msrType)
606 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": measure type %d not supported for request %d\n", pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].msrType, requestIndex);
614 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
630 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
635 if ( MSR_TYPE_BEACON_MEASUREMENT == pMeasurementSRV->msrRequest.msrTypes[ i ].msrType )
655 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
663 for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
665 if ( TI_TRUE == pMeasurementSRV->bRequestTimerRunning[ i ] )
668 (pMeasurementSRV->msrRequest.msrTypes[ i ].duration < minValue))
670 minValue = pMeasurementSRV->msrRequest.msrTypes[ i ].duration;
699 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
703 TRACE0(pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Sending AP Discovery Stop to the HAL...");
706 status = cmdBld_CmdApDiscoveryStop (pMeasurementSRV->hCmdBld, NULL, NULL);
709 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": status %d received from cmdBld_CmdApDiscoveryStop\n", status);
725 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
733 tTwdParam.content.interogateCmdCBParams.pCb = (TI_UINT8*)(&(pMeasurementSRV->mediumOccupancyResults));
734 status = cmdBld_GetParam (pMeasurementSRV->hCmdBld, &tTwdParam);
738 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": whalCtrl_GetParam returned status %d\n", status);
741 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
748 pMeasurementSRV->pendingParamCBs |= MSR_SRV_WAITING_CHANNEL_LOAD_RESULTS;
764 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
772 os_memoryZero( pMeasurementSRV->hOS, &(pNoiseHistParams.ranges[0]), MEASUREMENT_NOISE_HISTOGRAM_NUM_OF_RANGES );
775 status = cmdBld_CmdNoiseHistogram (pMeasurementSRV->hCmdBld, &pNoiseHistParams, NULL, NULL);
779 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": whalCtrl_NoiseHistogramCmd returned status %d\n", status);
782 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
791 tTwdParam.content.interogateCmdCBParams.pCb = (TI_UINT8*)&pMeasurementSRV->noiseHistogramResults;
792 status = cmdBld_GetParam (pMeasurementSRV->hCmdBld, &tTwdParam);
797 pMeasurementSRV->pendingParamCBs |= MSR_SRV_WAITING_NOISE_HIST_RESULTS;
799 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": sent noise histogram stop command.\n");
803 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": whalCtrl_GetParam returned status %d\n", status);
806 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
825 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
836 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Channel load CB called, status:%d\n", status);
837 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "result address (reported): 0x%x, result address (assumed): 0x%x, results (reported):\n", CB_buf, &(pMeasurementSRV->mediumOccupancyResults));
838 TRACE_INFO_HEX( pMeasurementSRV->hReport, CB_buf, sizeof(TMediumOccupancy));
841 pMeasurementSRV->pendingParamCBs &= ~MSR_SRV_WAITING_CHANNEL_LOAD_RESULTS;
848 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": request index from measurementSRVFindIndexByType is -1?!?");
852 if ( (TI_OK == status) && (0 != pMeasurementSRV->mediumOccupancyResults.Period))
855 mediumUsageInMs = pMeasurementSRV->mediumOccupancyResults.MediumUsage / 1000;
856 periodInMs = pMeasurementSRV->mediumOccupancyResults.Period / 1000;
858 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": MediumUsage = %d Period = %d\n",mediumUsageInMs, periodInMs);
860 if ( periodInMs <= pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].duration )
862 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.CCABusyFraction =
863 ( 255 * pMeasurementSRV->mediumOccupancyResults.MediumUsage ) /
864 pMeasurementSRV->mediumOccupancyResults.Period;
868 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.CCABusyFraction =
869 ( 255 * pMeasurementSRV->mediumOccupancyResults.MediumUsage ) /
870 (pMeasurementSRV->msrRequest.msrTypes[ requestIndex ].duration * 1000);
875 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": channel load failed. Status=%d, period=%d\n", status, pMeasurementSRV->mediumOccupancyResults.Period);
878 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
886 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
904 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*) hMeasurementSRV;
906 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Dummy Channel Load callback called (status = %d)\n", status);
923 measurementSRV_t *pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
928 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": noise histogram CB called, status: %d\n", status);
929 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, "result address (reported): 0x%x, result address (assumed): 0x%x, results (reported):\n", CB_buf, &(pMeasurementSRV->noiseHistogramResults));
930 TRACE_INFO_HEX( pMeasurementSRV->hReport, CB_buf, sizeof(TNoiseHistogramResults));
933 pMeasurementSRV->pendingParamCBs &= ~MSR_SRV_WAITING_NOISE_HIST_RESULTS;
940 TRACE0( pMeasurementSRV->hReport, REPORT_SEVERITY_ERROR, ": request index from measurementSRVFindIndexByType is -1?!?");
946 sumOfSamples = pMeasurementSRV->noiseHistogramResults.numOfLostCycles;
949 TRACE4( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": numOfLostCycles = %d numOfTxHwGenLostCycles = %d numOfRxLostCycles = %d numOfExceedLastThresholdLostCycles = %d\n", pMeasurementSRV->noiseHistogramResults.numOfLostCycles, pMeasurementSRV->noiseHistogramResults.numOfTxHwGenLostCycles, pMeasurementSRV->noiseHistogramResults.numOfRxLostCycles, pMeasurementSRV->noiseHistogramResults.numOfLostCycles - (pMeasurementSRV->noiseHistogramResults.numOfTxHwGenLostCycles + pMeasurementSRV->noiseHistogramResults.numOfRxLostCycles));
953 sumOfSamples += pMeasurementSRV->noiseHistogramResults.counters[ index ];
956 TRACE2( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Counter #%d = %x\n", index, pMeasurementSRV->noiseHistogramResults.counters[index]);
960 if ( (sumOfSamples - pMeasurementSRV->noiseHistogramResults.numOfLostCycles) <
963 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_WARNING, ": noise histogram CB, rejecting request because %d samples received.\n", sumOfSamples - pMeasurementSRV->noiseHistogramResults.numOfLostCycles);
966 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
972 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ index ] =
973 ( 255 * pMeasurementSRV->noiseHistogramResults.counters[ index ]) / sumOfSamples;
976 TRACE8( pMeasurementSRV->hReport, REPORT_SEVERITY_INFORMATION, ": Valid noise histogram reply. RPIDensity: %d %d %d %d %d %d %d %d\n", pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 0 ], pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 1 ], pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 2 ], pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 3 ], pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 4 ], pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 5 ], pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 6 ], pMeasurementSRV->msrReply.msrTypes[ requestIndex ].replyValue.RPIDensity[ 7 ]);
981 TRACE1( pMeasurementSRV->hReport, REPORT_SEVERITY_WARNING, ": noise histogram CB with status: %d, rejecting request.\n", status);
983 pMeasurementSRV->msrReply.msrTypes[ requestIndex ].status = TI_NOK;
991 measurementSRVSM_SMEvent( hMeasurementSRV, &(pMeasurementSRV->SMState),
1008 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
1012 for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
1014 if ( TI_TRUE == pMeasurementSRV->bRequestTimerRunning[ i ] )
1021 if ( 0 != (pMeasurementSRV->pendingParamCBs &
1042 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
1045 for ( i = 0; i < pMeasurementSRV->msrRequest.numberOfTypes; i++ )
1047 if ( type == pMeasurementSRV->msrRequest.msrTypes[ i ].msrType )
1074 measurementSRV_t* pMeasurementSRV = (measurementSRV_t*)hMeasurementSRV;
1076 pMeasurementSRV->failureEventFunc = (TFailureEventCb)failureEventCB;
1077 pMeasurementSRV->failureEventObj = hFailureEventObj;