Lines Matching refs:pCmdQueue
65 static void cmdQueue_PrintQueue(TCmdQueue *pCmdQueue);
88 TCmdQueue *pCmdQueue;
90 pCmdQueue = os_memoryAlloc (hOs, sizeof(TCmdQueue));
91 if (pCmdQueue == NULL)
98 os_memoryZero (hOs, pCmdQueue, sizeof(TCmdQueue));
99 pCmdQueue->hOs = hOs;
101 return pCmdQueue;
118 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
121 os_memoryFree (pCmdQueue->hOs, pCmdQueue, sizeof(TCmdQueue));
147 TCmdQueue* pCmdQueue = (TCmdQueue*) hCmdQueue;
149 pCmdQueue->head = 0;
150 pCmdQueue->tail = 0;
151 pCmdQueue->uNumberOfCommandInQueue = 0;
152 pCmdQueue->uMaxNumberOfCommandInQueue = 0;
153 pCmdQueue->state = CMDQUEUE_STATE_IDLE;
154 pCmdQueue->fCmdCompleteCb = NULL;
155 pCmdQueue->hCmdCompleteCb = NULL;
156 pCmdQueue->fFailureCb = NULL;
157 pCmdQueue->hFailureCb = NULL;
158 pCmdQueue->hReport = hReport;
159 pCmdQueue->hCmdMBox = hCmdMbox;
160 pCmdQueue->hTwIf = hTwIf;
161 pCmdQueue->bErrorFlag = TI_FALSE;
162 pCmdQueue->bMboxEnabled = TI_FALSE;
163 pCmdQueue->bAwake = TI_FALSE;
193 TCmdQueue *pCmdQueue = (TCmdQueue*)hCmdQueue;
201 switch (pCmdQueue->state)
207 pCmdQueue->state = CMDQUEUE_STATE_WAIT_FOR_COMPLETION;
209 pHead = &pCmdQueue->aCmdQueue[pCmdQueue->head];
212 TRACE4(pCmdQueue->hReport, REPORT_SEVERITY_CONSOLE, "cmdQueue_SM: Send Cmd: CmdType = %d(%d) Len = %d, NumOfCmd = %d", pHead->cmdType, (pHead->aParamsBuf) ? *(TI_UINT16 *)pHead->aParamsBuf:0, pHead->uParamsLen, pCmdQueue->uNumberOfCommandInQueue);
218 pHead->uParamsLen, pCmdQueue->uNumberOfCommandInQueue));
222 pCmdQueue->uCmdSendCounter++;
230 if (pCmdQueue->bAwake == TI_FALSE)
233 twIf_Awake(pCmdQueue->hTwIf);
234 pCmdQueue->bAwake = TI_TRUE;
258 rc = cmdMbox_SendCommand (pCmdQueue->hCmdMBox,
270 TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR, "cmdQueue_SM: ** ERROR ** No such event (%d) for state CMDQUEUE_STATE_IDLE\n",eCmdQueueEvent);
294 pHead = &pCmdQueue->aCmdQueue[pCmdQueue->head];
307 pCmdQueue->head ++;
308 if (pCmdQueue->head >= CMDQUEUE_QUEUE_DEPTH)
309 pCmdQueue->head = 0;
310 pCmdQueue->uNumberOfCommandInQueue --;
313 pCmdQueue->uCmdCompltCounter++;
317 status = cmdMbox_GetStatus (pCmdQueue->hCmdMBox, &cmdStatus);
324 pCmdQueue->bErrorFlag = TI_FALSE;
329 TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR, "cmdQueue_SM: ** ERROR ** Mbox status error %d, set bErrorFlag !!!!!\n", cmdStatus);
330 pCmdQueue->bErrorFlag = TI_TRUE;
335 pCmdQueue->bErrorFlag = TI_FALSE;
344 cmdMbox_GetCmdParams(pCmdQueue->hCmdMBox, pCb);
357 if (pCmdQueue->fCmdCompleteCb)
359 pCmdQueue->fCmdCompleteCb (pCmdQueue->hCmdCompleteCb, cmdType, uParam, status);
364 if (pCmdQueue->uNumberOfCommandInQueue > 0)
367 pCmdQueue->state = CMDQUEUE_STATE_IDLE;
373 twIf_Sleep(pCmdQueue->hTwIf);
374 pCmdQueue->bAwake = TI_FALSE;
375 pCmdQueue->state = CMDQUEUE_STATE_IDLE;
384 TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR, "cmdQueue_SM: ** ERROR ** No such event (%d) for state CMDQUEUE_STATE_IDLE\n",eCmdQueueEvent);
428 TCmdQueue *pCmdQueue = (TCmdQueue*)hCmdQueue;
431 if (pCmdQueue->bErrorFlag)
434 status = cmdQueue_Push (pCmdQueue,
470 TCmdQueue *pCmdQueue = (TCmdQueue*)hCmdQueue;
473 if (!pCmdQueue->bMboxEnabled)
480 if (pCmdQueue->uNumberOfCommandInQueue == CMDQUEUE_QUEUE_DEPTH)
482 TRACE0(pCmdQueue->hReport, REPORT_SEVERITY_ERROR, "cmdQueue_Push: ** ERROR ** The Queue is full\n");
489 pCmdQueue->aCmdQueue[pCmdQueue->tail].cmdType = cmdType;
490 pCmdQueue->aCmdQueue[pCmdQueue->tail].uParamsLen = uParamsLen;
491 pCmdQueue->aCmdQueue[pCmdQueue->tail].fCb = fCb;
492 pCmdQueue->aCmdQueue[pCmdQueue->tail].hCb = hCb;
494 os_memoryCopy (pCmdQueue->hOs,
495 pCmdQueue->aCmdQueue[pCmdQueue->tail].aParamsBuf,
499 pCmdQueue->aCmdQueue[pCmdQueue->tail].pInterrogateBuf = (TI_UINT8 *)pCb;
502 pCmdQueue->tail++;
503 if (pCmdQueue->tail == CMDQUEUE_QUEUE_DEPTH)
504 pCmdQueue->tail = 0;
507 pCmdQueue->uNumberOfCommandInQueue++;
510 if (pCmdQueue->uMaxNumberOfCommandInQueue < pCmdQueue->uNumberOfCommandInQueue)
512 pCmdQueue->uMaxNumberOfCommandInQueue = pCmdQueue->uNumberOfCommandInQueue;
522 uParamsLen, pCmdQueue->uNumberOfCommandInQueue));
526 if (pCmdQueue->uNumberOfCommandInQueue == 1)
528 return cmdQueue_SM (pCmdQueue, CMDQUEUE_EVENT_RUN);
550 TCmdQueue *pCmdQueue = (TCmdQueue*)hCmdQueue;
552 return cmdQueue_SM (pCmdQueue, CMDQUEUE_EVENT_COMPLETE);
570 TCmdQueue* pCmdQueue = (TCmdQueue*) hCmdQueue;
572 TI_UINT32 first = pCmdQueue->head;
579 pCmdQueue->state = CMDQUEUE_STATE_IDLE;
580 pCmdQueue->bAwake = TI_FALSE;
582 TRACE0(pCmdQueue->hReport, REPORT_SEVERITY_INFORMATION, "cmdQueue_Clean: Cleaning aCmdQueue Queue");
590 pCmdQueue->uNumberOfRecoveryNodes = 0;
591 pRecoveryNode = &pCmdQueue->aRecoveryQueue[pCmdQueue->uNumberOfRecoveryNodes];
594 uCurrentCmdIndex < pCmdQueue->uNumberOfCommandInQueue;
597 pHead = &pCmdQueue->aCmdQueue[first];
605 pCmdQueue->uNumberOfRecoveryNodes++;
606 pRecoveryNode = &pCmdQueue->aRecoveryQueue[pCmdQueue->uNumberOfRecoveryNodes];
616 pCmdQueue->head = 0;
617 pCmdQueue->tail = 0;
618 pCmdQueue->uNumberOfCommandInQueue = 0;
637 TCmdQueue* pCmdQueue = (TCmdQueue*) hCmdQueue;
641 for (uCbIndex = 0; uCbIndex < pCmdQueue->uNumberOfRecoveryNodes; uCbIndex++)
643 pHead = &pCmdQueue->aRecoveryQueue[uCbIndex];
655 pCmdQueue->uNumberOfRecoveryNodes = 0;
675 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
679 TRACE0(pCmdQueue->hReport, REPORT_SEVERITY_ERROR, "cmdQueue_RegisterCmdCompleteGenericCB: NULL parameter\n");
683 pCmdQueue->fCmdCompleteCb = (TCmdQueueGenericCb)fCb;
684 pCmdQueue->hCmdCompleteCb = hCb;
704 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
708 TRACE0(pCmdQueue->hReport, REPORT_SEVERITY_ERROR, "cmdQueue_RegisterForErrorCB: NULL parameters\n");
712 pCmdQueue->hFailureCb = hCb;
713 pCmdQueue->fFailureCb = (TCmdQueueCb)fCb;
731 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
733 pCmdQueue->bMboxEnabled = TI_TRUE;
751 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
753 pCmdQueue->bMboxEnabled = TI_FALSE;
771 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
775 TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR , "cmdQueue_Error: Unknown Cmd (%d)\n", command);
779 TRACE4(pCmdQueue->hReport, REPORT_SEVERITY_CONSOLE,"cmdQueue_Error: Unknown IE, cmdType : %d (%d) IE: %d (%d)\n", command, command, (param) ? *(TI_UINT16 *) param : 0, *((TI_UINT16 *) param));
789 TRACE1(pCmdQueue->hReport, REPORT_SEVERITY_ERROR , "cmdQueue_Error: CmdMbox status is %d\n", status);
796 TCmdQueueNode* pHead = &pCmdQueue->aCmdQueue[pCmdQueue->head];
797 TI_UINT32 TimeStamp = os_timeStampMs(pCmdQueue->hOs);
806 pCmdQueue->uNumberOfCommandInQueue,
810 cmdQueue_PrintHistory(pCmdQueue, CMDQUEUE_HISTORY_DEPTH);
815 if (pCmdQueue->fFailureCb)
817 pCmdQueue->fFailureCb (pCmdQueue->hFailureCb, TI_NOK);
838 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
840 return pCmdQueue->uMaxNumberOfCommandInQueue;
864 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
868 WLAN_OS_REPORT(("state = %d\n", pCmdQueue->state));
870 pCmdQueue->uMaxNumberOfCommandInQueue));
872 pCmdQueue->uNumberOfCommandInQueue));
874 pCmdQueue->uCmdSendCounter));
876 pCmdQueue->uCmdCompltCounter));
878 cmdQueue_PrintQueue (pCmdQueue);
885 * \param pCmdQueue - Pointer to TCmdQueue
893 static void cmdQueue_PrintQueue (TCmdQueue *pCmdQueue)
896 TI_UINT32 first = pCmdQueue->head;
898 TI_UINT32 NumberOfCommand = pCmdQueue->uNumberOfCommandInQueue;
902 pHead = &pCmdQueue->aCmdQueue[first];
935 TCmdQueue* pCmdQueue = (TCmdQueue*)hCmdQueue;
937 TI_UINT32 first = pCmdQueue->head;
944 pHead = &pCmdQueue->aCmdQueue[first];