Lines Matching +full:timer +full:-

2 *Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved. 
50 * \return -void-
57 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData); in saTimerTick()
68 /* (1) Acquire timer list lock */ in saTimerTick()
72 pTimer = (agsaTimerDesc_t *) saLlistGetHead(&(saRoot->validTimers)); in saTimerTick()
75 /* (2.1) Find the first timer is timeout */ in saTimerTick()
76 if ( pTimer->timeoutTick == saRoot->timeTick ) in saTimerTick()
78 /* (2.1.1) remove the timer from valid timer list */ in saTimerTick()
79 saLlistRemove(&(saRoot->validTimers), &(pTimer->linkNode)); in saTimerTick()
80 /* (2.1.2) Invalid timer */ in saTimerTick()
81 pTimer->valid = agFALSE; in saTimerTick()
82 /* (2.1.3) Get timer event and param */ in saTimerTick()
83 Event = pTimer->Event; in saTimerTick()
84 pParm = pTimer->pParm; in saTimerTick()
85 /* (2.1.4) Release timer list lock */ in saTimerTick()
88 /* (2.1.5) Timer Callback */ in saTimerTick()
89 pTimer->pfnTimeout(agRoot, Event, pParm); in saTimerTick()
91 /* (2.1.6) Acquire timer list lock again */ in saTimerTick()
93 /* (2.1.7) return the timer to free timer list */ in saTimerTick()
94 saLlistAdd(&(saRoot->freeTimers), &(pTimer->linkNode)); in saTimerTick()
96 /* (2.2) the first timer is not timeout */ in saTimerTick()
101 pTimer = (agsaTimerDesc_t *) saLlistGetHead(&(saRoot->validTimers)); in saTimerTick()
105 saRoot->timeTick ++; in saTimerTick()
107 if( saRoot->ResetFailed ) in saTimerTick()
109 SA_DBG1(("saTimerTick: siChipResetV saRoot->ResetFailed\n")); in saTimerTick()
113 if (saRoot->BunchStarts_Enable && in saTimerTick()
114 saRoot->BunchStarts_Pending) in saTimerTick()
129 for ( i = 0; i < saRoot->QueueConfig.numOutboundQueues; i++ ) in saTimerTick()
131 circularQ = &saRoot->outboundQueue[i]; in saTimerTick()
132 OSSA_READ_LE_32(circularQ->agRoot, &circularQ->producerIdx, circularQ->piPointer, 0); in saTimerTick()
133 if(circularQ->producerIdx != circularQ->consumerIdx) in saTimerTick()
135 … if( saRoot->OldCi[i] == circularQ->consumerIdx && saRoot->OldPi[i] >= circularQ->producerIdx) in saTimerTick()
140 if( ++saRoot->OldFlag[i] > 1 ) in saTimerTick()
142 saRoot->CheckAll++; in saTimerTick()
145 saRoot->OldFlag[i], in saTimerTick()
146 circularQ->producerIdx, in saTimerTick()
147 circularQ->consumerIdx, in saTimerTick()
148->producerIdx > circularQ->consumerIdx ? (circularQ->producerIdx - circularQ->consumerIdx) : (ci… in saTimerTick()
149 saRoot->CheckAll, in saTimerTick()
150 saRoot->sysIntsActive )); in saTimerTick()
155 saRoot->CheckAll, in saTimerTick()
160 saRoot->OurInterrupt(agRoot,i) in saTimerTick()
166 saRoot->CheckAll, in saTimerTick()
169 saRoot->OurInterrupt(agRoot,i) in saTimerTick()
174 if( saRoot->CheckAll > 1) in saTimerTick()
182 saRoot->OldFlag[i] = 0; in saTimerTick()
185 saRoot->OldPi[i] = circularQ->producerIdx; in saTimerTick()
186 saRoot->OldCi[i] = circularQ->consumerIdx; in saTimerTick()
193 /* (4) Release timer list lock */ in saTimerTick()
196 if(saRoot->CheckAll ) in saTimerTick()
201 if (saRoot->interruptVecIndexBitMap[a] & (1 << a)) in saTimerTick()
213 /*! \brief add a timer
215 * add a timer
218 * \param pTimer the pointer to the timer being added
224 * \return If the timer is added successfully
225 * - \e AGSA_RC_SUCCESS timer is added successfully
226 * - \e AGSA_RC_FAILURE cannot add new timer, run out of resource
237 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData); in siTimerAdd()
242 /* (1) Acquire timer list lock */ in siTimerAdd()
245 /* (2) Get a free timer */ in siTimerAdd()
246 pTimer = (agsaTimerDesc_t *) saLlistGetHead(&(saRoot->freeTimers)); in siTimerAdd()
248 /* (3) If the timer is availble */ in siTimerAdd()
251 saLlistRemove(&(saRoot->freeTimers), &(pTimer->linkNode)); in siTimerAdd()
253 /* (3.1) Setup timer */ in siTimerAdd()
254 saLlinkInitialize(&(pTimer->linkNode)); in siTimerAdd()
255 /*--------------------------------------** in siTimerAdd()
257 **--------------------------------------*/ in siTimerAdd()
262 pTimer->valid = agTRUE; in siTimerAdd()
263 pTimer->timeoutTick = saRoot->timeTick + timeout; in siTimerAdd()
264 pTimer->pfnTimeout = pfnTimeout; in siTimerAdd()
265 pTimer->Event = Event; in siTimerAdd()
266 pTimer->pParm = pParm; in siTimerAdd()
268 /* (3.2) Add timer the timer to valid timer list */ in siTimerAdd()
269 pValidTimer = (agsaTimerDesc_t *) saLlistGetHead(&(saRoot->validTimers)); in siTimerAdd()
270 /* (3.3) for each timer in the valid timer list */ in siTimerAdd()
274 if ( pTimer->timeoutTick > saRoot->timeTick ) in siTimerAdd()
277 if ( pValidTimer->timeoutTick < saRoot->timeTick ) in siTimerAdd()
279 saLlistInsert(&(saRoot->validTimers), &(pValidTimer->linkNode), &(pTimer->linkNode)); in siTimerAdd()
285 if ( pValidTimer->timeoutTick > pTimer->timeoutTick ) in siTimerAdd()
287 saLlistInsert(&(saRoot->validTimers), &(pValidTimer->linkNode), &(pTimer->linkNode)); in siTimerAdd()
296 if ( pValidTimer->timeoutTick < saRoot->timeTick ) in siTimerAdd()
298 if ( pValidTimer->timeoutTick > pTimer->timeoutTick ) in siTimerAdd()
300 saLlistInsert(&(saRoot->validTimers), &(pValidTimer->linkNode), &(pTimer->linkNode)); in siTimerAdd()
305 /* (3.3.3) Continue to the next valid timer */ in siTimerAdd()
306 …pValidTimer = (agsaTimerDesc_t *) saLlistGetNext(&(saRoot->validTimers), &(pValidTimer->linkNode)); in siTimerAdd()
309 /* (3.4) No timers in the validtimer list is greater than this timer */ in siTimerAdd()
312 saLlistAdd(&(saRoot->validTimers), &(pTimer->linkNode)); in siTimerAdd()
316 /* (4) Release timer list lock */ in siTimerAdd()
324 /*! \brief remove a valid timer
326 * remove a timer
329 * \param pTimer the timer to be removed
331 * \return -void-
339 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData); in siTimerRemove()
341 /* (1) Acquire timer list lock */ in siTimerRemove()
345 /* (2) If the timer is still valid */ in siTimerRemove()
346 if ( agTRUE == pTimer->valid ) in siTimerRemove()
348 /* (2.1) remove from the valid timer list */ in siTimerRemove()
349 saLlistRemove(&(saRoot->validTimers), &(pTimer->linkNode)); in siTimerRemove()
350 /* (2.2) Invalid the timer */ in siTimerRemove()
351 pTimer->valid = agFALSE; in siTimerRemove()
352 /* (2.3) return the timer to the free timer list */ in siTimerRemove()
353 saLlistAdd(&(saRoot->freeTimers), &(pTimer->linkNode)); in siTimerRemove()
355 /* (3) Release timer list lock */ in siTimerRemove()
363 /*! \brief remove all valid timer
365 * remove all timer
369 * \return -void-
376 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData); in siTimerRemoveAll()
381 /* (1) Acquire timer list lock */ in siTimerRemoveAll()
384 /* (2) Get a valid timer */ in siTimerRemoveAll()
385 pTimer = (agsaTimerDesc_t *) saLlistGetHead(&(saRoot->validTimers)); in siTimerRemoveAll()
387 /* (3) If the timer is valid */ in siTimerRemoveAll()
390 /* (3.1) remove from the valid timer list */ in siTimerRemoveAll()
391 saLlistRemove(&(saRoot->validTimers), &(pTimer->linkNode)); in siTimerRemoveAll()
393 /* (3.2) Invalid timer */ in siTimerRemoveAll()
394 pTimer->valid = agFALSE; in siTimerRemoveAll()
396 /* (3.3) return the timer to the free timer list */ in siTimerRemoveAll()
397 saLlistAdd(&(saRoot->freeTimers), &(pTimer->linkNode)); in siTimerRemoveAll()
399 /* (3.4) get next valid timer */ in siTimerRemoveAll()
400 pTimer = (agsaTimerDesc_t *) saLlistGetHead(&(saRoot->validTimers)); in siTimerRemoveAll()
403 /* (4) Release timer list lock */ in siTimerRemoveAll()