84 dsmDP3((
"\nsiQueryStart()\n"));
85 dsmAssert((idp != NULL));
86 dsmAssert((pQueryData != NULL));
87 dsmAssert((pResult != NULL));
89 dsmDP4((
"lastPID=%d lpStored=%d, lastAssocTag=%d\n",
90 idp->lastPID, idp->lastPIDResultStored, idp->lastAssociationTag));
91 dsmDP4((
"kind=%d stored=%d, AssocTag=%d\n",
92 pQueryData->kind, idp->setup.storeSIQueryResults, pQueryData->data.association_tag));
95 if ((idp->setup.storeSIQueryResults) &&
96 (pQueryData->kind == SIQUERY_PID) &&
97 (idp->lastPIDResultStored) &&
98 (pQueryData->serviceId == idp->lastServiceId) &&
99 (pQueryData->associationTag == idp->lastAssociationTag))
102 pResult->kind = SIQUERY_PID;
103 pResult->data.pid = idp->lastPID;
106 else if (pQueryData->kind == SIQUERY_SSU_PID)
109 pResult->kind = SIQUERY_SSU_PID;
110 pResult->data.carouselInfo.pid = pQueryData->serviceId;
111 pResult->data.carouselInfo.carouselId = INVALID_CAROUSEL_ID;
112 pResult->data.carouselInfo.associationTag = INVALID_ASSOCIATION_TAG;
113 idp->lastServiceId = pQueryData->serviceId;
114 idp->lastAssociationTag = (U16BIT)INVALID_ASSOCIATION_TAG;
115 idp->lastPID = pResult->data.carouselInfo.pid;
116 idp->lastPIDResultStored = TRUE;
121 err = siQueryCreate( idp, &pSiQueryRef );
124 dsmDP3((
"pSiQueryRef = %p\n", pSiQueryRef));
125 dsmDP4((
"pQueryData->kind = %s\n",
126 pQueryData->kind == SIQUERY_PID ?
"SIQUERY_PID" :
127 pQueryData->kind == SIQUERY_BOOT_CAROUSEL ?
"SIQUERY_BOOT_CAROUSEL" :
128 pQueryData->kind == SIQUERY_FIND_CAROUSEL ?
"SIQUERY_FIND_CAROUSEL" :
129 pQueryData->kind == SIQUERY_CAROUSEL_INFO ?
"SIQUERY_CAROUSEL_INFO" :
130 pQueryData->kind == SIQUERY_SSU_CAROUSEL ?
"SIQUERY_SSU_CAROUSEL" :
131 pQueryData->kind == SIQUERY_SSU_PID ?
"SIQUERY_SSU_PID" :
132 pQueryData->kind == SIQUERY_CAROUSEL ?
"SIQUERY_CAROUSEL" :
133 pQueryData->kind == SIQUERY_PIDLIST ?
"SIQUERY_PIDLIST" :
134 pQueryData->kind == SIQUERY_DEFERRED_SERVICE ?
"SIQUERY_DEFERRED_SERVICE" :
137 if (pQueryData->kind == SIQUERY_PID)
139 pOrigSiQueryRef = FindPendingPIDQuery( idp, pQueryData->serviceId, pQueryData->associationTag );
143 pOrigSiQueryRef = NULL;
146 if (pOrigSiQueryRef == NULL)
148 dsmDP3((
"siQueryStart() pSiQueryRef=%p target=%p\n", pSiQueryRef, queryTarget));
149 err = idp->setup.startSIQueryFunc( idp->setup.siqInstance,
150 pQueryData, (H_SIQueryRef) pSiQueryRef,
151 idp->generation.ptr, pResult );
156 dsmDP2((
"kind=%d target=%p qhdl=%p\n", pResult->kind, queryTarget, pResult->data.queryHandle));
157 dsmAssert((pResult->kind == SIRESULT_PENDING));
159 pSiQueryRef->query = *pQueryData;
160 pSiQueryRef->target = queryTarget;
161 pSiQueryRef->state = SIQS_PENDING;
162 pSiQueryRef->original = TRUE;
163 pSiQueryRef->queryHandle = pResult->data.queryHandle;
164 pResult->data.queryHandle = pSiQueryRef;
167 LLInsertHead( idp->llcCurrSiQueries, pSiQueryRef );
171 if (pQueryData->kind != pResult->kind)
173 dsmDP1((
"kind=%d %d\n", pQueryData->kind, pResult->kind));
175 dsmAssert((pQueryData->kind == pResult->kind));
176 dsmDP4((
"lastPID=%d lpStored=%d, lastAssocTag=%d\n",
177 idp->lastPID, idp->lastPIDResultStored, idp->lastAssociationTag));
178 switch (pQueryData->kind)
182 idp->lastServiceId = pQueryData->serviceId;
183 idp->lastAssociationTag = pQueryData->associationTag;
184 idp->lastPID = pResult->data.pid;
185 idp->lastPIDResultStored = TRUE;
186 dsmDP3((
"data.PID = %x\n", pResult->data.pid));
189 case SIQUERY_PIDLIST:
194 case SIQUERY_CAROUSEL:
195 case SIQUERY_CAROUSEL_INFO:
196 case SIQUERY_FIND_CAROUSEL:
197 case SIQUERY_BOOT_CAROUSEL:
198 case SIQUERY_SSU_CAROUSEL:
199 case SIQUERY_SSU_PID:
205 idp->lastServiceId = pQueryData->serviceId;
206 idp->lastAssociationTag = (U16BIT)pResult->data.carouselInfo.associationTag;
207 idp->lastPID = pResult->data.carouselInfo.pid;
208 idp->lastPIDResultStored = TRUE;
210 dsmDP3((
"data.carouselInfo.PID = %x\n", pResult->data.carouselInfo.pid));
211 dsmDP3((
"data.carouselInfo.component_tag = %x\n", pResult->data.carouselInfo.associationTag));
214 case SIQUERY_DEFERRED_SERVICE:
222 dsmDP4((
"NEW lastPID=%d lpStored=%d, lastAssocTag=%d\n",
223 idp->lastPID, idp->lastPIDResultStored, idp->lastAssociationTag));
228 siQueryDestroy( idp, pSiQueryRef );
234 pSiQueryRef->query = *pQueryData;
235 pSiQueryRef->target = queryTarget;
236 pSiQueryRef->state = SIQS_PENDING;
237 pSiQueryRef->original = FALSE;
239 pResult->kind = SIRESULT_PENDING;
240 pResult->data.queryHandle = pSiQueryRef;
242 dsmAssert((pOrigSiQueryRef->original == TRUE));
244 if (pOrigSiQueryRef->llcDuplSiQuerys == NULL)
247 err = LLCreate( idp, pOrigSiQueryRef, DUPLICATE_SI_QUERY_LIST,
248 &pOrigSiQueryRef->llcDuplSiQuerys );
251 siQueryDestroy( idp, pSiQueryRef );
255 LLInsertTail( pOrigSiQueryRef->llcDuplSiQuerys, pSiQueryRef );
261 LLInsertTail( pOrigSiQueryRef->llcDuplSiQuerys, pSiQueryRef );
268 DEBUG_CHK((err == CLDSM_OK || err == CLDSM_PENDING || err == CLDSM_ERR_SI_QUERY_FAILED),
269 dsmDP1((
"ERROR: siQueryStart: %u\n", err)));
270 dsmDP3((
"exit siQueryStart -> rtn: %u\n", err));
285 dsmDP3((
"siQueryStop()\n"));
286 dsmAssert((idp != NULL));
287 dsmAssert((pSiQueryRef != NULL));
288 dsmAssert((pSiQueryRef->magic == SI_QUERY_MAGIC));
290 dsmDP2((
"siQueryStop(idp,pSiQueryRef=%p) state=%d target=%p\n", pSiQueryRef, pSiQueryRef->state, pSiQueryRef->target));
292 if (pSiQueryRef->original == TRUE)
294 switch (pSiQueryRef->state)
304 dsmAssert((pSiQueryRef->llcDuplSiQuerys == NULL));
307 idp->setup.stopSIQueryFunc( idp->setup.siqInstance, pSiQueryRef->queryHandle,
308 (H_SIQueryRef) pSiQueryRef );
320 dsmDP1((
"ERROR: Illegal SI query status = %u\n", pSiQueryRef->state));
323 if (idp->setup.errorFunc)
325 idp->setup.errorFunc( CLDSM_ERR_INTERNAL, NULL);
331 LLRemove( pSiQueryRef, CURR_SI_QUERY_LIST );
337 siQueryDestroy( idp, pSiQueryRef );
339 dsmDP3((
"exit siQueryStop\n"));
354 BOOLEAN duplicateQuery;
355 BOOLEAN duplicateListEmpty;
358 dsmDP3((
"siQueryAbortPending()\n"));
359 dsmAssert((idp != NULL));
360 dsmAssert((pSiQueryRef != NULL));
361 dsmAssert((pSiQueryRef->magic == SI_QUERY_MAGIC));
363 pExtSiQueryRefToStop = NULL;
365 switch (pSiQueryRef->state)
378 pSiQueryRef->state = SIQS_ABORTED;
380 if (pSiQueryRef->original == TRUE)
382 duplicateQuery = FALSE;
384 if (pSiQueryRef->llcDuplSiQuerys != NULL)
390 pSiQueryRef->state = SIQS_EXPIRED;
395 pExtSiQueryRefToStop = pSiQueryRef;
405 duplicateQuery = TRUE;
407 pOrigSiQueryRef = LLParent( pSiQueryRef, DUPLICATE_SI_QUERY_LIST );
410 dsmAssert((pOrigSiQueryRef != NULL));
412 duplicateListEmpty = LLRemove( pSiQueryRef, DUPLICATE_SI_QUERY_LIST );
414 if (duplicateListEmpty == TRUE)
417 LLDestroy( idp, &pOrigSiQueryRef->llcDuplSiQuerys );
419 if (pOrigSiQueryRef->state == SIQS_EXPIRED)
421 pExtSiQueryRefToStop = pOrigSiQueryRef;
428 if (duplicateQuery == TRUE)
431 dsmAssert((pExtSiQueryRefToStop != pSiQueryRef));
437 if (pExtSiQueryRefToStop != NULL)
442 pSiQueryRef = pExtSiQueryRefToStop;
443 queryHandle = pSiQueryRef->queryHandle;
445 idp->setup.stopSIQueryFunc( idp->setup.siqInstance, queryHandle,
446 (H_SIQueryRef) pExtSiQueryRefToStop );
456 dsmDP1((
"ERROR: Illegal SI query status = %u\n",
457 pSiQueryRef->state));
461 if (idp->setup.errorFunc)
463 idp->setup.errorFunc( CLDSM_ERR_INTERNAL, NULL);
474 dsmDP3((
"exit siQueryAbortPending\n"));
484 siQueryData.kind = SIQUERY_PIDLIST;
485 siQueryData.service_id = idp->curr_service_id;
487 err =
siQueryStart( idp, &siQueryData, (
void *) 0x91D, &siQueryResult );
489 dsmDP1((
"(%d) SI query status = %u\n", err, siQueryStatus));
526 E_DscError err = CLDSM_OK;
530 dsmAssert((idp != NULL));
531 dsmAssert((pSiQueryRef != NULL));
533 dsmDP2((
"siQueryProcessResult(idp,pSiQueryRef=%p,kind=%d) target=%p\n", pSiQueryRef, pResult->kind, pSiQueryRef->target));
535 switch (pSiQueryRef->state)
538 dsmAssert((pResult != NULL));
539 if (pSiQueryRef->query.kind == pResult->kind)
543 dsmDP2((
"lastPID=%d lpStored=%d, lastAssocTag=%d\n",
544 idp->lastPID, idp->lastPIDResultStored, idp->lastAssociationTag));
546 switch (pSiQueryRef->query.kind)
551 idp->lastServiceId = pSiQueryRef->query.serviceId;
552 idp->lastAssociationTag = pSiQueryRef->query.associationTag;
553 idp->lastPID = pResult->data.pid;
554 idp->lastPIDResultStored = TRUE;
558 dsmAssert((pSectionFilter != NULL));
559 dsmAssert((pSectionFilter->status == SFA_PENDING));
560 pSectionFilter->filter.pid = pResult->data.pid;
562 err = DSC_SectionFilterCommit( idp, pSectionFilter );
568 DSC_SectionFilterAbortDependants( idp, pSectionFilter );
572 case SIQUERY_CAROUSEL:
573 case SIQUERY_CAROUSEL_INFO:
574 case SIQUERY_FIND_CAROUSEL:
575 case SIQUERY_BOOT_CAROUSEL:
576 case SIQUERY_SSU_CAROUSEL:
577 case SIQUERY_SSU_PID:
579 dsmAssert((pSiQueryRef->llcDuplSiQuerys == NULL));
586 idp->lastServiceId = pSiQueryRef->query.serviceId;
587 idp->lastAssociationTag =
588 (U16BIT)pResult->data.carouselInfo.associationTag;
589 idp->lastPID = pResult->data.carouselInfo.pid;
590 idp->lastPIDResultStored = TRUE;
597 if (status == SIQUERY_BOOT_CAROUSEL)
598 siQueryGetPIDList( idp );
602 pRC->pPendingSiQueryRef = NULL;
606 DSC_RootCrslAbortLoadRequest( idp, pRC );
611 case SIQUERY_PIDLIST:
615 case SIQUERY_DEFERRED_SERVICE:
617 DSC_StrmObjectStoreDeferred( idp, pSiQueryRef->target, pResult->data.deferredService );
622 dsmDP1((
"ERROR: Illegal SI query kind = %u\n",
623 pSiQueryRef->query.kind));
625 err = CLDSM_ERR_INTERNAL;
629 else if (pResult->kind == SIRESULT_FAILURE)
631 switch (pSiQueryRef->query.kind)
636 dsmAssert((pSectionFilter != NULL));
639 pSectionFilter->u.pPendingSiQueryRef = NULL;
642 DSC_SectionFilterAbortDependants( idp, pSectionFilter );
645 case SIQUERY_CAROUSEL_INFO:
646 case SIQUERY_BOOT_CAROUSEL:
647 case SIQUERY_CAROUSEL:
648 case SIQUERY_SSU_CAROUSEL:
649 case SIQUERY_SSU_PID:
651 dsmAssert((pSiQueryRef->llcDuplSiQuerys == NULL));
658 pRC->pPendingSiQueryRef = NULL;
660 DSC_RootCrslAbortLoadRequest( idp, pRC );
670 case SIQUERY_DEFERRED_SERVICE:
671 DSC_StrmObjectStoreDeferred( idp, pSiQueryRef->target, idp->dvbLocator );
675 dsmDP1((
"ERROR: Illegal SI query kind = %u\n",
676 pSiQueryRef->query.kind));
678 err = CLDSM_ERR_INTERNAL;
684 dsmDP1((
"ERROR: Illegal SI query status %u\n", pResult->kind));
686 err = CLDSM_ERR_INVALID_SIQUERY_STATUS;
688 dsmDP2((
"NEW lastPID=%d lpStored=%d, lastAssocTag=%d\n",
689 idp->lastPID, idp->lastPIDResultStored, idp->lastAssociationTag));
692 pSiQueryRef->state = SIQS_COMPLETED;
701 dsmAssert((pSiQueryRef->original == TRUE));
708 dsmAssert((pSiQueryRef->original == TRUE));
712 dsmDP1((
"ERROR: Illegal SI query ref state = %u\n", pSiQueryRef->state));
714 err = CLDSM_ERR_INTERNAL;
719 DEBUG_CHK( err == CLDSM_OK, dsmDP1((
"ERROR: siQueryProcessResult: %u\n", err)));
720 dsmDP3((
"exit siQueryProcessResult -> rtn: %u \n", err));
780 dsmAssert((pSiQuery->llData[CURR_SI_QUERY_LIST].pLLCtrl == NULL));
781 dsmAssert((pSiQuery->llData[DUPLICATE_SI_QUERY_LIST].pLLCtrl == NULL));
788 pSiQuery->state = SIQS_INITIAL;
789 pSiQuery->queryHandle = NULL;
790 pSiQuery->target = NULL;
792 pSiQuery->query.serviceId = 0;
793 pSiQuery->query.kind = SIQUERY_PID;
794 pSiQuery->query.associationTag = 0;
796 pSiQuery->original = FALSE;
797 dsmAssert((pSiQuery->llcDuplSiQuerys == NULL));
801 DSC_CmMemRelease( idp, pSiQuery );
803 dsmDP3((
"exit siQueryDestroy\n"));
816 listId = LListId( idp->llcCurrSiQueries );
817 pQueryFromList = LLHead( idp->llcCurrSiQueries );
821 while (pQueryFromList)
823 if ((pQueryFromList->query.kind == SIQUERY_PID) &&
824 (pQueryFromList->query.serviceId == service_id) &&
825 (pQueryFromList->query.associationTag == assoc_tag) &&
826 (pQueryFromList->state == SIQS_PENDING))
830 dsmAssert((pQueryFromList->original == TRUE));
833 pQueryFromList = LLNext( pQueryFromList, listId );
835 return pQueryFromList;
General include file for clDsm library internal definitions.
E_DscError siQueryProcessResult(P_DsmCoreInst idp, P_SiQuery pSiQueryRef, P_SIQueryResult pResult)
Processes and stops the specified SI Query.
Header to the loadMgr module.
Header to the linkList module - Functions/methods for managing linked lists of items created in manag...
Header to the cacheMgr module.
E_DscError DSC_RootCrslBootCarousel(P_DsmCoreInst idp, P_RootCarousel pRC, P_CarouselInfo pCarouselInfo)
Request DSI for booting carousel, since info is available.
void siQueryAbortPending(P_DsmCoreInst idp, P_SiQuery pSiQueryRef)
Aborts the specified SI Query before completion. Stops/destroys duplicate queries. For original queries or duplicate queries that have expired parents (and no further duplicates) calls stop SI Query callback on relevant query.
Header to the sectionFilter module.
Header to the objectCarousel module.
E_DscError siQueryStart(P_DsmCoreInst idp, P_SIQueryRequest pQueryData, void *queryTarget, P_SIQueryResult pResult)
Starts an SI Query. First tests if we have already made this query and the results are stored or stil...
Header to siQuery module - functions for managing SI queries.
void siQueryStop(P_DsmCoreInst idp, P_SiQuery pSiQueryRef)
Stops the specified SI Query. Removes from any lists it is in and destroys associated memory object...