Lines Matching refs:discovery

52 #include <dev/pms/RefTisa/discovery/api/dm.h>
53 #include <dev/pms/RefTisa/discovery/api/dmapi.h>
54 #include <dev/pms/RefTisa/discovery/api/tddmapi.h>
79 * Purpose: This function is called to send a transport dependent discovery
81 * completion of discovery.
121 then, if status is right, start the discovery
171 /* start SAS discovery */
182 /* complete discovery */
357 TI_DBG1(("tiINIGetDeviceHandles: forth, discovery failed, pid %d\n", onePortContext->id));
369 TI_DBG1(("tiINIGetDeviceHandles: discovery not completed\n"));
371 onePortContext->discovery.forcedOK = agTRUE;
618 TI_DBG1(("tiINIGetDeviceHandlesForWinIOCTL: forth, discovery failed, pid %d\n", onePortContext->id));
630 TI_DBG1(("tiINIGetDeviceHandlesForWinIOCTL: discovery not completed\n"));
632 onePortContext->discovery.forcedOK = agTRUE;
913 * following the discovery.
1289 * Purpose: This function is called to trigger topology discovery within a
1295 * \param type: Type of discovery. It can be SAS or SATA.
1296 * \param option: discovery option. It can be Full or Incremental discovery.
1319 TI_DBG1(("tdsaDiscover: aborting discovery\n"));
1328 onePortContext->discovery.type = TDSA_DISCOVERY_OPTION_FULL_START;
1336 if (onePortContext->discovery.status == DISCOVERY_SAS_DONE)
1345 onePortContext->discovery.type = TDSA_DISCOVERY_OPTION_INCREMENTAL_START;
1354 if (onePortContext->discovery.status == DISCOVERY_SAS_DONE)
1379 * Purpose: This function is called to trigger full SAS topology discovery
1408 TI_DBG1(("tdsaSASFullDiscover: aborting discovery\n"));
1543 TI_DBG1(("tdsaSASUpStreamDiscoverStart: aborting discovery\n"));
1549 1. update discovery state to UP_STREAM
1554 onePortContext->discovery.status = DISCOVERY_UP_STREAM;
1583 * find information for discovery and calls
1610 TI_DBG1(("tdsaSASUpStreamDiscovering: aborting discovery\n"));
1621 if (TDLIST_EMPTY(&(onePortContext->discovery.discoveringExpanderList)))
1629 TDLIST_DEQUEUE_FROM_HEAD(&ExpanderList, &(onePortContext->discovery.discoveringExpanderList));
1631 TDLIST_ENQUEUE_AT_HEAD(&(oneNextExpander->linkNode), &(onePortContext->discovery.discoveringExpanderList));
1681 TI_DBG1(("tdsaSASDownStreamDiscoverStart: aborting discovery\n"));
1692 /* set discovery status */
1693 onePortContext->discovery.status = DISCOVERY_DOWN_STREAM;
1710 onePortContext->discovery.RootExp = oneExpander;
1728 onePortContext->discovery.RootExp = oneExpander;
1749 * find information for discovery and calls
1779 TI_DBG1(("tdsaSASDownStreamDiscovering: aborting discovery\n"));
1785 if (TDLIST_EMPTY(&(onePortContext->discovery.discoveringExpanderList)))
1793 TDLIST_DEQUEUE_FROM_HEAD(&ExpanderList, &(onePortContext->discovery.discoveringExpanderList));;
1795 TDLIST_ENQUEUE_AT_HEAD(&(NextExpander->linkNode), &(onePortContext->discovery.discoveringExpanderList));;
1806 NextExpander, onePortContext->discovery.status));
1808 switch (onePortContext->discovery.status)
1810 /* If the discovery status is DISCOVERY_DOWN_STREAM */
1816 /* If the discovery status is DISCOVERY_CONFIG_ROUTING */
1820 /* set discovery status */
1821 onePortContext->discovery.status = DISCOVERY_DOWN_STREAM;
1823 TI_DBG3(("tdsaSASDownStreamDiscovering: pPort->discovery.status=DISCOVERY_CONFIG_ROUTING, nake it DOWN_STREAM\n"));
1843 TI_DBG3(("tdsaSASDownStreamDiscovering: *** Unknown pPort->discovery.status=0x%x\n", onePortContext->discovery.status));
1860 * Purpose: This function cleans up expander data structures after discovery
1893 if (!TDLIST_EMPTY(&(tmpOnePortContext->discovery.discoveringExpanderList)))
1896 ExpanderList = tmpOnePortContext->discovery.discoveringExpanderList.flink;
1897 while (ExpanderList != &(tmpOnePortContext->discovery.discoveringExpanderList))
1907 if (TDLIST_EMPTY(&(tmpOnePortContext->discovery.discoveringExpanderList)))
1916 ExpanderList = tmpOnePortContext->discovery.discoveringExpanderList.flink;
1928 TDLIST_INIT_HDR(&(tmpOnePortContext->discovery.UpdiscoveringExpanderList));
1972 if (!TDLIST_EMPTY(&(tmpOnePortContext->discovery.discoveringExpanderList)))
1975 ExpanderList = tmpOnePortContext->discovery.discoveringExpanderList.flink;
1976 while (ExpanderList != &(tmpOnePortContext->discovery.discoveringExpanderList))
1986 if (TDLIST_EMPTY(&(tmpOnePortContext->discovery.discoveringExpanderList)))
1995 ExpanderList = tmpOnePortContext->discovery.discoveringExpanderList.flink;
2007 TDLIST_INIT_HDR(&(tmpOnePortContext->discovery.UpdiscoveringExpanderList));
2015 * in the device list. This is used only in incremental discovery.
2206 if (onePortContext->discovery.forcedOK == agTRUE && added == agFALSE && removed == agFALSE)
2209 onePortContext->discovery.forcedOK = agFALSE;
2231 * devices. This function is called in case of incremental discovery
2341 /* needs to clean up devices which were not removed in ossaDeregisterDeviceHandleCB() since port was in valid (discovery error) */
2524 changes valid and valid2 based on discovery type
2566 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_INCREMENTAL_START)
2568 TI_DBG3(("tdssInternalRemovals: incremental discovery\n"));
2573 TI_DBG3(("tdssInternalRemovals: full discovery\n"));
2688 * Purpose: This function aborts on-going discovery.
2700 /* this called when discovery is aborted
2961 TI_DBG1(("tdsaCTLSet: discovery not completed\n"));
3012 * Purpose: This function called to finish up SAS discovery.
3040 /* Set discovery status */
3041 onePortContext->discovery.status = DISCOVERY_SAS_DONE;
3059 /* call back to notify discovery is done */
3062 if (onePortContext->discovery.SeenBC == agTRUE)
3070 onePortContext->discovery.SeenBC = agFALSE;
3072 onePortContext->discovery.ResetTriggerred == agTRUE)
3091 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
3112 TI_DBG1(("tdsaSASDiscoverDone: discovery failed\n"));
3155 TI_DBG3(("tdsaSASDiscoverDone: calling SATA discovery\n"));
3161 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
3163 TI_DBG3(("tdsaSASDiscoverDone: calling FULL SATA discovery\n"));
3173 TI_DBG3(("tdsaSASDiscoverDone: calling INCREMENTAL SATA discovery\n"));
3190 onePortContext->discovery.SeenBC = agFALSE;
3244 tdsaDiscovery_t *discovery;
3251 discovery = &(onePortContext->discovery);
3262 TI_DBG2(("tdsaReportManInfoRespRcvd: discovery retries %d\n", discovery->retries));
3263 discovery->retries++;
3265 if (discovery->retries >= DISCOVERY_RETRIES)
3268 discovery->retries = 0;
3269 /* failed the discovery */
3357 tdsaDiscovery_t *discovery;
3392 discovery = &(onePortContext->discovery);
3396 TI_DBG1(("tdsaReportGeneralRespRcvd: aborting discovery\n"));
3420 discovery->retries++;
3421 if (discovery->retries >= DISCOVERY_RETRIES)
3424 discovery->retries = 0;
3425 /* failed the discovery */
3437 discovery->retries = 0;
3443 TI_DBG1(("tdsaReportGeneralRespRcvd: SMP failed; fn result 0x%x; stopping discovery\n", frameHeader->smpFunctionResult));
3536 tdsaDiscovery_t *discovery;
3548 discovery = &(onePortContext->discovery);
3555 TI_DBG1(("tdsaDiscoverRespRcvd: aborting discovery\n"));
3559 ptdSMPDiscoverResp = &(discovery->SMPDiscoverResp);
3582 if ( onePortContext->discovery.status == DISCOVERY_UP_STREAM)
3586 else if ( onePortContext->discovery.status == DISCOVERY_DOWN_STREAM)
3590 else if (onePortContext->discovery.status == DISCOVERY_CONFIG_ROUTING)
3611 if ( onePortContext->discovery.status == DISCOVERY_UP_STREAM)
3615 else if ( onePortContext->discovery.status == DISCOVERY_DOWN_STREAM)
3619 else if (onePortContext->discovery.status == DISCOVERY_CONFIG_ROUTING)
3678 TI_DBG1(("tdsaSASUpStreamDiscoverExpanderPhy: aborting discovery\n"));
3733 /* discovery error */
3734 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
3736 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
3738 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
3740 /* (2.1.3) discovery done */
3759 /* incremental discovery */
3784 /* TODO: discovery error, callback */
3786 /* call back to notify discovery error */
3787 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
3789 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
3791 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
3792 /* discovery done */
3829 /* TODO: loop found, discovery error, callback */
3831 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
3833 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
3835 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
3836 /* discovery done */
3862 /* incremental discovery */
3863 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
3880 /* incremental discovery */
3906 /* incremental discovery */
3907 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
3924 /* incremental discovery */
4015 if (onePortContext->discovery.status == DISCOVERY_UP_STREAM)
4020 /* continue discovery for the next phy */
4035 TI_DBG3(("tdsaSASUpStreamDiscoverExpanderPhy: onePortContext->discovery.status not in DISCOVERY_UP_STREAM; status %d\n", onePortContext->discovery.status));
4106 if (onePortContext->discovery.status == DISCOVERY_UP_STREAM)
4111 /* continue discovery for the next phy */
4126 TI_DBG3(("tdsaSASUpStreamDiscoverExpanderPhySkip: onePortContext->discovery.status not in DISCOVERY_UP_STREAM; status %d\n", onePortContext->discovery.status));
4192 * Purpose: This function prints out all expanders seen by discovery.
4224 if (TDLIST_EMPTY(&(tmpOnePortContext->discovery.discoveringExpanderList)))
4234 ExpanderList = tmpOnePortContext->discovery.discoveringExpanderList.flink;
4235 while (ExpanderList != &(tmpOnePortContext->discovery.discoveringExpanderList))
4272 * Purpose: This function prints out all upstream expanders seen by discovery.
4432 if (TDLIST_EMPTY(&(tmpOnePortContext->discovery.discoveringExpanderList)))
4511 TI_DBG1(("tdsaSASDownStreamDiscoverExpanderPhy: aborting discovery\n"));
4586 /* incremental discovery */
4604 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4606 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4608 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4631 /* TODO: discovery error, callback */
4633 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4635 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4637 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4638 /* discovery done */
4654 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
4671 /* incremental discovery */
4697 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
4714 /* incremental discovery */
4773 /* TODO: discovery error, callback */
4775 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4777 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4779 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4780 /* discovery done */
4812 /* discovery done */
4818 if ( onePortContext->discovery.status == DISCOVERY_DOWN_STREAM)
4872 /* discovery done */
4886 /* TODO: discovery error, callback */
4888 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4890 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4892 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4893 /* discovery done */
4903 /* TODO: discovery error, callback */
4905 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4907 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4909 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4910 /* discovery done */
4921 /* (2.3.3.2.1.1) TODO: discovery error, callback */
4923 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4925 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4927 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4928 /* discovery done */
4947 /* TODO: discovery error, callback */
4949 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4951 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4953 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4954 /* discovery done */
4974 /* TODO: discovery error, callback */
4976 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressLo
4978 onePortContext->discovery.sasAddressIDDiscoverError.sasAddressHi
4980 onePortContext->discovery.sasAddressIDDiscoverError.phyIdentifier = oneExpander->discoveringPhyId;
4981 /* discovery done */
4989 if ( onePortContext->discovery.status == DISCOVERY_DOWN_STREAM)
5037 } /* if (onePortContext->discovery.status == DISCOVERY_DOWN_STREAM) */
5038 /* incremental discovery */
5039 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_INCREMENTAL_START)
5123 /* If the discovery status is DISCOVERY_DOWN_STREAM */
5124 if ( onePortContext->discovery.status == DISCOVERY_DOWN_STREAM )
5130 /* continue discovery for the next phy */
5146 TI_DBG3(("tdsaSASDownStreamDiscoverExpanderPhy: onePortContext->discovery.status not in DISCOVERY_DOWN_STREAM; status %d\n", onePortContext->discovery.status));
5187 /* If the discovery status is DISCOVERY_DOWN_STREAM */
5188 if ( onePortContext->discovery.status == DISCOVERY_DOWN_STREAM )
5194 /* continue discovery for the next phy */
5210 TI_DBG3(("tdsaSASDownStreamDiscoverExpanderPhySkip: onePortContext->discovery.status not in DISCOVERY_DOWN_STREAM; status %d\n", onePortContext->discovery.status));
5279 onePortContext->discovery.status = DISCOVERY_CONFIG_ROUTING;
5370 TI_DBG1(("tdsaConfigRoutingInfoRespRcvd: aborting discovery\n"));
5411 /* traversing up till discovery Root onePortContext->discovery.RootExp */
5464 onePortContext->discovery.status = DISCOVERY_DOWN_STREAM;
5470 /* continue discovery for the next phy */
5654 TI_DBG1(("tdsaReportPhySataRcvd: aborting discovery\n"));
5690 no longer, discovery sends sata identify device command
5932 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
5934 TI_DBG3(("tdsaPortSASDeviceFind: Full discovery\n"));
5955 /* incremental discovery */
5956 TI_DBG3(("tdsaPortSASDeviceFind: Incremental discovery\n"));
6268 * Purpose: This function called to finish up SATA discovery.
6273 * \param flag: status of discovery (success or failure).
6293 if (onePortContext->discovery.SeenBC == agTRUE)
6301 onePortContext->discovery.SeenBC = agFALSE;
6303 onePortContext->discovery.ResetTriggerred == agTRUE)
6322 if (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START)
6432 * Purpose: This function is called to trigger full SATA topology discovery
6466 TI_DBG1(("tdsaSATAFullDiscover: aborting discovery\n"));
6528 /* no longer, discovery sends sata identify device command */
6748 * SATA discovery.
6785 ((onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_FULL_START &&
6787 (onePortContext->discovery.type == TDSA_DISCOVERY_OPTION_INCREMENTAL_START &&
6796 //send ID in every discovery? No
6825 TI_DBG3(("tdsaDiscoveringStpSATADevice: No More Device; SATA discovery finished\n"));
6836 * Purpose: This function is called to trigger incremental SAS topology discovery
6864 TI_DBG1(("tdsaSASIncrementalDiscover: aborting discovery\n"));
6937 * Purpose: This function is called to trigger incremental SATA topology discovery
6972 TI_DBG1(("tdsaSATAIncrementalDiscover: aborting discovery\n"));
7034 /* no longer, discovery sends sata identify device command */
7147 onePortContext->discovery.pendingSMP++;
7460 /* only for discovery related SMPs*/
7485 /* discovery failure or task management failure */
7548 * Purpose: This function sets timers for configuring routing of discovery and
7573 tdsaDiscovery_t *discovery;
7578 discovery = &(onePortContext->discovery);
7582 TI_DBG1(("tdsaConfigureRouteTimer: discovery %p \n", discovery));
7584 TI_DBG1(("tdsaConfigureRouteTimer: pid %d configureRouteRetries %d\n", onePortContext->id, discovery->configureRouteRetries));
7586 TI_DBG1(("tdsaConfigureRouteTimer: discovery->status %d\n", discovery->status));
7588 if (discovery->configureRouteTimer.timerRunning == agTRUE)
7592 &discovery->configureRouteTimer
7601 &discovery->configureRouteTimer,
7612 &discovery->configureRouteTimer
7649 tdsaDiscovery_t *discovery;
7657 discovery = &(onePortContext->discovery);
7661 TI_DBG1(("tdsaConfigureRouteTimerCB: discovery %p\n", discovery));
7663 TI_DBG1(("tdsaConfigureRouteTimerCB: pid %d configureRouteRetries %d\n", onePortContext->id, discovery->configureRouteRetries));
7665 TI_DBG1(("tdsaConfigureRouteTimerCB: discovery.status %d\n", discovery->status));
7667 discovery->configureRouteRetries++;
7668 if (discovery->configureRouteRetries >= DISCOVERY_RETRIES)
7671 discovery->configureRouteRetries = 0;
7672 /* failed the discovery */
7674 if (discovery->configureRouteTimer.timerRunning == agTRUE)
7678 &discovery->configureRouteTimer
7685 if (onePortContext->discovery.status == DISCOVERY_DOWN_STREAM)
7689 discovery->configureRouteRetries = 0;
7699 &discovery->configureRouteTimer,
7710 &discovery->configureRouteTimer
7720 * Purpose: This function sets timers for discovery and its callback
7743 tdsaDiscovery_t *discovery;
7748 discovery = &(onePortContext->discovery);
7750 if (discovery->discoveryTimer.timerRunning == agTRUE)
7754 &discovery->discoveryTimer
7763 &discovery->discoveryTimer,
7774 &discovery->discoveryTimer
7783 * Purpose: This function is callback function for discovery timer.
7812 TI_DBG1(("tdsaDiscoveryTimerCB: resumes discovery\n"));
7822 * Purpose: This function sets timers for device registration in discovery
7844 tdsaDiscovery_t *discovery;
7849 discovery = &(onePortContext->discovery);
7851 if (discovery->deviceRegistrationTimer.timerRunning == agTRUE)
7855 &discovery->deviceRegistrationTimer
7864 &discovery->deviceRegistrationTimer,
7875 &discovery->deviceRegistrationTimer
7907 tdsaDiscovery_t *discovery;
7913 discovery = &(onePortContext->discovery);
7917 discovery->deviceRetistrationRetries++;
7918 if (discovery->deviceRetistrationRetries >= DISCOVERY_RETRIES)
7921 discovery->deviceRetistrationRetries = 0;
7922 /* failed the discovery */
7924 if (discovery->deviceRegistrationTimer.timerRunning == agTRUE)
7928 &discovery->deviceRegistrationTimer
7941 /* go ahead; continue the discovery */
7942 discovery->deviceRetistrationRetries = 0;
7974 tdsaDiscovery_t *discovery;
7979 discovery = &(onePortContext->discovery);
7981 if (discovery->SMPBusyTimer.timerRunning == agTRUE)
7985 &discovery->SMPBusyTimer
7991 &discovery->SMPBusyTimer,
8002 &discovery->SMPBusyTimer
8041 tdsaDiscovery_t *discovery;
8053 discovery = &(onePortContext->discovery);
8055 discovery->SMPRetries++;
8057 if (discovery->SMPRetries < SMP_BUSY_RETRIES)
8072 discovery->SMPRetries = 0;
8073 if (discovery->SMPBusyTimer.timerRunning == agTRUE)
8077 &discovery->SMPBusyTimer
8083 discovery->SMPRetries = 0;
8085 if (discovery->SMPBusyTimer.timerRunning == agTRUE)
8089 &discovery->SMPBusyTimer
8095 if (discovery->SMPRetries >= SMP_BUSY_RETRIES)
8099 discovery->SMPRetries = 0;
8101 if (discovery->SMPBusyTimer.timerRunning == agTRUE)
8105 &discovery->SMPBusyTimer
8145 tdsaDiscovery_t *discovery;
8150 discovery = &(onePortContext->discovery);
8152 if (discovery->BCTimer.timerRunning == agTRUE)
8156 &discovery->BCTimer
8164 &discovery->BCTimer,
8175 &discovery->BCTimer
8209 tdsaDiscovery_t *discovery;
8214 discovery = &(onePortContext->discovery);
8216 discovery->ResetTriggerred = agFALSE;
8227 if (discovery->BCTimer.timerRunning == agTRUE)
8231 &discovery->BCTimer
8241 * Purpose: This function sets timers for sending discovery-related SMP
8265 tdsaDiscovery_t *discovery;
8271 discovery = &(onePortContext->discovery);
8273 if (discovery->DiscoverySMPTimer.timerRunning == agTRUE)
8277 &discovery->DiscoverySMPTimer
8282 &discovery->DiscoverySMPTimer,
8293 &discovery->DiscoverySMPTimer
8332 tdsaDiscovery_t *discovery;
8345 if discovery related SMP, fail the discovery
8352 discovery = &(onePortContext->discovery);
8367 if (discovery->DiscoverySMPTimer.timerRunning == agTRUE)
8371 &discovery->DiscoverySMPTimer
8379 TI_DBG1(("tdsaDiscoverySMPTimerCB: failing discovery, SMP function 0x%x\n", SMPFunction));
8383 TI_DBG1(("tdsaDiscoverySMPTimerCB: failing discovery, SMP function SMP_REPORT_PHY_SATA\n"));
8392 if (onePortContext->discovery.SeenBC == agTRUE)