69 DM_DBG3((
"dmDiscover: start\n"));
72 if (onePortContext ==
agNULL)
74 DM_DBG1((
"dmDiscover: onePortContext is NULL!!!\n"));
80 DM_DBG1((
"dmDiscover: invalid port!!!\n"));
86 DM_DBG1((
"dmDiscover: Registration failed!!!\n"));
93 DM_DBG3((
"dmDiscover: full, pid %d\n", onePortContext->
id));
99 DM_DBG3((
"dmDiscover: incremental, pid %d\n", onePortContext->
id));
105 DM_DBG3((
"dmDiscover: abort\n"));
119 DM_DBG3((
"dmDiscover: abortInProgress\n"));
130 DM_DBG3((
"dmDiscover: no discovery to abort\n"));
155 DM_DBG1((
"dmFullDiscover: start\n"));
159 DM_DBG1((
"dmFullDiscover: invalid port!!!\n"));
165 DM_DBG1((
"dmFullDiscover: no two instances of discovery allowed!!!\n"));
176 if (oneExpander !=
agNULL)
178 oneExpDeviceData = oneExpander->
dmDevice;
184 if (oneExpander !=
agNULL)
186 oneExpDeviceData = oneExpander->
dmDevice;
190 if (oneExpDeviceData !=
agNULL)
199 DM_DBG1((
"dmFullDiscover:oneExpDeviceData is NULL!!!\n"));
219 DM_DBG1((
"dmIncrementalDiscover: start\n"));
223 DM_DBG1((
"dmIncrementalDiscover: invalid port!!!\n"));
232 DM_DBG1((
"dmIncrementalDiscover: no two instances of discovery allowed!!!\n"));
245 if (oneExpander !=
agNULL)
247 oneExpDeviceData = oneExpander->
dmDevice;
253 if (oneExpander !=
agNULL)
255 oneExpDeviceData = oneExpander->
dmDevice;
259 if (oneExpDeviceData !=
agNULL)
268 DM_DBG1((
"dmIncrementalDiscover:oneExpDeviceData is NULL!!!\n"));
284 bit32 sasAddressHi, sasAddressLo;
288 DM_DBG3((
"dmUpStreamDiscoverStart: start\n"));
291 DM_DBG1((
"dmUpStreamDiscoverStart: invalid port!!!\n"));
300 DM_DBG3((
"dmUpStreamDiscoverStart: Port Remote AddrHi 0x%08x Remote AddrLo 0x%08x\n", sasAddressHi, sasAddressLo));
302 oneDeviceData =
dmDeviceFind(dmRoot, onePortContext, sasAddressHi, sasAddressLo);
307 if (oneDeviceData ==
agNULL)
309 DM_DBG1((
"dmUpStreamDiscoverStart: oneExpander is NULL, wrong!!!\n"));
325 oneExpander =
dmExpFind(dmRoot, onePortContext, sasAddressHi, sasAddressLo);
326 if ( oneExpander ==
agNULL)
330 if ( oneExpander !=
agNULL)
336 DM_DBG1((
"dmUpStreamDiscoverStart: failed to allocate expander or discovey aborted!!!\n"));
346 DM_DBG1((
"dmUpStreamDiscoverStart: oneDeviceData is not an Expander did %d, wrong!!!\n", oneDeviceData->
id));
364 DM_DBG3((
"dmUpStreamDiscovering: start\n"));
368 DM_DBG1((
"dmUpStreamDiscovering: invalid port!!!\n"));
376 DM_DBG3((
"dmUpStreamDiscovering: should be the end\n"));
383 if ( oneNextExpander !=
agNULL)
386 DM_DBG3((
"dmUpStreamDiscovering tdsaSASUpStreamDiscovering: dequeue head\n"));
387 DM_DBG3((
"dmUpStreamDiscovering: expander id %d\n", oneNextExpander->
id));
391 DM_DBG1((
"dmUpStreamDiscovering: oneNextExpander is NULL!!!\n"));
397 if (oneNextExpander !=
agNULL)
403 DM_DBG3((
"dmUpStreamDiscovering: No more expander list\n"));
420 DM_DBG3((
"dmDownStreamDiscoverStart: start\n"));
424 DM_DBG1((
"dmDownStreamDiscoverStart: invalid port or aborted discovery!!!\n"));
443 DM_DBG3((
"dmDownStreamDiscoverStart: Root found pExpander=%p pUpStreamExpander=%p\n",
444 oneExpander, UpStreamExpander));
466 DM_DBG3((
"dmDownStreamDiscoverStart: NO Root pExpander=%p\n", oneExpander));
491 DM_DBG3((
"dmDownStreamDiscovering: start\n"));
495 DM_DBG1((
"dmDownStreamDiscovering: invalid port or aborted discovery!!!\n"));
503 DM_DBG3((
"dmDownStreamDiscovering: should be the end\n"));
510 if ( NextExpander !=
agNULL)
513 DM_DBG3((
"dmDownStreamDiscovering tdsaSASDownStreamDiscovering: dequeue head\n"));
514 DM_DBG3((
"dmDownStreamDiscovering: expander id %d\n", NextExpander->
id));
518 DM_DBG1((
"dmDownStreamDiscovering: NextExpander is NULL!!!\n"));
525 if ( NextExpander !=
agNULL)
527 DM_DBG3((
"dmDownStreamDiscovering: Found pNextExpander=%p discoveryStatus=0x%x\n",
535 DM_DBG3((
"dmDownStreamDiscovering: DownStream pNextExpander=%p\n", NextExpander));
536 DM_DBG3((
"dmDownStreamDiscovering: oneDeviceData %p did %d\n", oneDeviceData, oneDeviceData->
id));
540 DM_DBG3((
"dmDownStreamDiscovering: 2nd oneExpander %p did %d\n", NextExpander, NextExpander->
id));
545 DM_DBG3((
"dmDownStreamDiscovering: wrong!!!\n"));
558 DM_DBG3((
"dmDownStreamDiscovering: pPort->discovery.status=DISCOVERY_CONFIG_ROUTING, make it DOWN_STREAM\n"));
562 DM_DBG3((
"dmDownStreamDiscovering: pNextExpander->discoveringPhyId=0x%x pNextExpander->numOfPhys=0x%x. Send More Discover\n",
570 DM_DBG3((
"dmDownStreamDiscovering: Last Phy, remove expander%p start DownStream=%p\n",
571 NextExpander, NextExpander->
dmDevice));
578 DM_DBG3((
"dmDownStreamDiscovering: *** Unknown pPort->discovery.status=0x%x\n", onePortContext->
discovery.
status));
584 DM_DBG3((
"dmDownStreamDiscovering: No more expander DONE\n"));
603 bit32 attachedSasHi, attachedSasLo;
612 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: start\n"));
616 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: invalid port or aborted discovery!!!\n"));
622 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: wrong!!!\n"));
627 oneDeviceData = oneExpander->
dmDevice;
629 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: Phy #%d of SAS %08x-%08x\n",
634 DM_DBG3((
" Attached device: %s\n",
642 DM_DBG3((
" SAS address : %08x-%08x\n",
659 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: !!! Incorrect SMP response !!!\n"));
671 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: SA_SAS_DEV_TYPE_FANOUT_EXPANDER\n"));
674 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: **** Topology Error subtractive routing on fanout expander device!!!\n"));
682 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
694 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: SA_SAS_DEV_TYPE_EDGE_EXPANDER\n"));
717 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: SA_SAS_ROUTING_SUBTRACTIVE\n"));
733 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: **** Topology Error subtractive routing error - inconsistent SAS address!!!\n"));
740 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
758 AttachedDevice =
dmPortSASDeviceFind(dmRoot, onePortContext, attachedSasLo, attachedSasHi, oneDeviceData);
760 if ( AttachedDevice !=
agNULL)
762 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: Seen This Device Before\n"));
767 AttachedExpander = AttachedDevice->
dmExpander;
781 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: **** Topology Error loop detection!!!\n"));
787 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
799 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy, *** Attached Device is not Edge. Confused!!!\n"));
806 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: New device\n"));
811 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: link rate 0x%x\n", onePortContext->
LinkRate));
813 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: connectionRate 0x%x\n", connectionRate));
825 dmAllShared->itNexusTimeout,
842 if (AttachedDevice ==
agNULL)
850 dmAllShared->itNexusTimeout,
871 dmAllShared->itNexusTimeout,
888 if (AttachedDevice ==
agNULL)
896 dmAllShared->itNexusTimeout,
907 if ( AttachedDevice !=
agNULL)
916 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: Found SSP/SMP SAS %08x-%08x\n",
917 attachedSasHi, attachedSasLo));
921 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: Found a SAS STP device.\n"));
934 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: Found expander=%p\n", AttachedExpander));
936 if ( AttachedExpander !=
agNULL)
946 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: Failed to allocate expander data structure!!!\n"));
953 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: Found end device\n"));
961 DM_DBG1((
"dmUpStreamDiscoverExpanderPhy: Failed to add a device!!!\n"));
981 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: DISCOVERY_UP_STREAM find more ...\n"));
987 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: DISCOVERY_UP_STREAM last phy continue upstream..\n"));
999 DM_DBG3((
"dmUpStreamDiscoverExpanderPhy: onePortContext->discovery.status not in DISCOVERY_UP_STREAM; status %d\n", onePortContext->
discovery.
status));
1020 bit8 connectionRate;
1021 bit32 attachedSasHi, attachedSasLo;
1026 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: start\n"));
1030 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: invalid port or aborted discovery!!!\n"));
1036 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: wrong!!!\n"));
1041 oneDeviceData = oneExpander->
dmDevice;
1043 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: Phy #%d of SAS %08x-%08x\n",
1048 DM_DBG2((
" Attached device: %s\n",
1056 DM_DBG2((
" SAS address : %08x-%08x\n",
1072 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: !!! Incorrect SMP response !!!\n"));
1084 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: SA_SAS_DEV_TYPE_FANOUT_EXPANDER\n"));
1087 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: **** Topology Error subtractive routing on fanout expander device!!!\n"));
1095 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1107 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: SA_SAS_DEV_TYPE_EDGE_EXPANDER\n"));
1131 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: SA_SAS_ROUTING_SUBTRACTIVE\n"));
1147 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: **** Topology Error subtractive routing error - inconsistent SAS address!!!\n"));
1154 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1173 AttachedDevice =
dmPortSASDeviceFind(dmRoot, onePortContext, attachedSasLo, attachedSasHi, oneDeviceData);
1175 if ( AttachedDevice !=
agNULL)
1177 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: Seen This Device Before\n"));
1182 AttachedExpander = AttachedDevice->
dmExpander;
1196 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: **** Topology Error loop detection!!!\n"));
1202 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1214 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy, *** Attached Device is not Edge. Confused!!!\n"));
1221 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: New device\n"));
1226 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: link rate 0x%x\n", onePortContext->
LinkRate));
1228 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: connectionRate 0x%x\n", connectionRate));
1241 dmAllShared->itNexusTimeout,
1258 if (AttachedDevice ==
agNULL)
1266 dmAllShared->itNexusTimeout,
1287 dmAllShared->itNexusTimeout,
1304 if (AttachedDevice ==
agNULL)
1312 dmAllShared->itNexusTimeout,
1323 if ( AttachedDevice !=
agNULL)
1332 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: Found SSP/SMP SAS %08x-%08x\n",
1333 attachedSasHi, attachedSasLo));
1337 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: Found a SAS STP device.\n"));
1350 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: Found expander=%p\n", AttachedExpander));
1352 if ( AttachedExpander !=
agNULL)
1362 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy, Failed to allocate expander data structure!!!\n"));
1369 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: Found end device\n"));
1377 DM_DBG1((
"dmUpStreamDiscover2ExpanderPhy, Failed to add a device!!!\n"));
1392 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: DISCOVERY_UP_STREAM find more ...\n"));
1398 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: DISCOVERY_UP_STREAM last phy continue upstream..\n"));
1410 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhy: onePortContext->discovery.status not in DISCOVERY_UP_STREAM; status %d\n", onePortContext->
discovery.
status));
1430 bit32 attachedSasHi, attachedSasLo;
1434 bit8 connectionRate, negotiatedPhyLinkRate;
1435 bit32 configSASAddressHi;
1436 bit32 configSASAddressLo;
1446 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: start\n"));
1450 DM_ASSERT(dmRoot,
"(dmDownStreamDiscoverExpanderPhy) dmRoot NULL");
1451 DM_ASSERT(onePortContext,
"(dmDownStreamDiscoverExpanderPhy) pPort NULL");
1452 DM_ASSERT(oneExpander,
"(dmDownStreamDiscoverExpanderPhy) pExpander NULL");
1453 DM_ASSERT(pDiscoverResp,
"(dmDownStreamDiscoverExpanderPhy) pDiscoverResp NULL");
1455 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: onePortContxt=%p oneExpander=%p\n", onePortContext, oneExpander));
1459 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: invalid port or aborted discovery!!!\n"));
1465 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: wrong!!!\n"));
1469 oneDeviceData = oneExpander->
dmDevice;
1471 DM_ASSERT(oneDeviceData,
"(dmDownStreamDiscoverExpanderPhy) pDevice NULL");
1474 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Phy #%d of SAS %08x-%08x\n",
1479 DM_DBG3((
" Attached device: %s\n",
1488 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: !!! Incorrect SMP response !!!\n"));
1497 DM_DBG3((
" SAS address : %08x-%08x\n",
1546 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error direct routing can't connect to expander!!!\n"));
1552 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1567 AttachedDevice =
dmPortSASDeviceFind(dmRoot, onePortContext, attachedSasLo, attachedSasHi, oneDeviceData);
1569 if ( AttachedDevice ==
agNULL)
1578 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: Deferred!!! **** Topology Error subtractive routing error - inconsistent SAS address!!!\n"));
1584 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1600 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: connectionRate 0x%x\n", connectionRate));
1611 dmAllShared->itNexusTimeout,
1628 if (AttachedDevice ==
agNULL)
1636 dmAllShared->itNexusTimeout,
1656 dmAllShared->itNexusTimeout,
1673 if (AttachedDevice ==
agNULL)
1681 dmAllShared->itNexusTimeout,
1691 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: newDevice pDevice=%p\n", AttachedDevice));
1693 if ( AttachedDevice !=
agNULL)
1700 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Report a new SAS device !!\n"));
1709 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Found an STP or SATA device.\n"));
1713 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Found Other type of device.\n"));
1719 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: AttachedDevice %p did %d\n", AttachedDevice, AttachedDevice->
id));
1722 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: oneDeviceData %p did %d\n", oneDeviceData, oneDeviceData->
id));
1732 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error two table routing phys are connected!!!\n"));
1738 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1750 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Found a EDGE exp device.%p\n", AttachedExpander));
1752 if ( AttachedExpander !=
agNULL)
1770 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: Failed to allocate expander data structure!!!\n"));
1779 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 1st before\n"));
1785 if (ConfigurableExpander)
1793 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 1st before loc 1\n"));
1799 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 1st before loc 2\n"));
1806 ConfigurableExpander,
1811 if ( ConfigurableExpander && dupConfigSASAddr ==
agFALSE)
1813 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 1st q123\n"));
1819 ConfigurableExpander,
1830 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: Failed to add a device!!!\n"));
1846 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error loop, or end device connects to two expanders!!!\n"));
1852 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1867 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error two subtractive phys!!!\n"));
1873 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1889 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error fan out expander to routing table phy!!!\n"));
1895 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1906 AttachedExpander = AttachedDevice->
dmExpander;
1907 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Found edge expander=%p\n", AttachedExpander));
1918 SAS2SAS11Check =
dmSAS2SAS11ErrorCheck(dmRoot, onePortContext, AttachedExpander, oneExpander, oneExpander);
1919 if (SAS2SAS11Check ==
agTRUE)
1921 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error SAS2 and SAS1.1!!!\n"));
1925 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error two table routing phys connected (1)!!!\n"));
1932 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1941 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Add edge expander=%p\n", AttachedExpander));
1955 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: **** Topology Error two table routing phys connected (2)!!!\n"));
1961 DM_DBG1((
"dmDownStreamDiscoverExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
1974 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 2nd before\n"));
1981 if (ConfigurableExpander)
1989 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 2nd before loc 1\n"));
1995 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 2nd before loc 2\n"));
2001 ConfigurableExpander,
2005 if ( ConfigurableExpander && dupConfigSASAddr ==
agFALSE)
2007 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 2nd q123 \n"));
2013 ConfigurableExpander,
2027 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: incremental SATA_STP\n"));
2035 dmAllShared->itNexusTimeout,
2045 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: incremental SAS\n"));
2054 dmAllShared->itNexusTimeout,
2069 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: Found Self\n"));
2070 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 3rd before\n"));
2076 ConfigurableExpander,
2081 if ( ConfigurableExpander && dupConfigSASAddr ==
agFALSE)
2083 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: 3rd q123 Setup routing table\n"));
2089 ConfigurableExpander,
2101 DM_DBG2((
"!!!!!!!!!!!!!!!!!!!!! SPIN SATA !!!!!!!!!!!!!!!!!!!!!!!!!!!\n"));
2104 if (negotiatedPhyLinkRate == 0x03)
2107 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: SPIN SATA sent reset\n"));
2128 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: More Phys to discover\n"));
2135 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: No More Phys\n"));
2147 DM_DBG3((
"dmDownStreamDiscoverExpanderPhy: onePortContext->discovery.status not in DISCOVERY_DOWN_STREAM; status %d\n", onePortContext->
discovery.
status));
2169 bit8 downStreamPhyID, upStreamPhyID;
2171 DM_DBG2((
"dmSAS2SAS11ErrorCheck: start\n"));
2173 if (topExpander ==
agNULL)
2175 DM_DBG2((
"dmSAS2SAS11ErrorCheck: topExpander is NULL\n"));
2178 if (bottomExpander ==
agNULL)
2180 DM_DBG2((
"dmSAS2SAS11ErrorCheck: bottomExpander is NULL\n"));
2184 if (currentExpander ==
agNULL)
2186 DM_DBG2((
"dmSAS2SAS11ErrorCheck: currentExpander is NULL\n"));
2190 DM_DBG2((
"dmSAS2SAS11ErrorCheck: topExpander addrHi 0x%08x addrLo 0x%08x\n",
2192 DM_DBG2((
"dmSAS2SAS11ErrorCheck: bottomExpander addrHi 0x%08x addrLo 0x%08x\n",
2194 DM_DBG2((
"dmSAS2SAS11ErrorCheck: currentExpander addrHi 0x%08x addrLo 0x%08x\n",
2201 if (currentExpander->
SAS2 == 1)
2203 if ( downStreamPhyID == upStreamPhyID &&
2206 topExpander->
SAS2 == 0 &&
2207 bottomExpander->
SAS2 == 1
2214 else if (currentExpander->
SAS2 == 0)
2216 if ( downStreamPhyID == upStreamPhyID &&
2219 topExpander->
SAS2 == 1 &&
2220 bottomExpander->
SAS2 == 0
2244 bit8 connectionRate;
2245 bit32 attachedSasHi, attachedSasLo;
2249 bit32 configSASAddressHi;
2250 bit32 configSASAddressLo;
2256 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: start\n"));
2260 DM_ASSERT(dmRoot,
"(dmDownStreamDiscover2ExpanderPhy) dmRoot NULL");
2261 DM_ASSERT(onePortContext,
"(dmDownStreamDiscover2ExpanderPhy) pPort NULL");
2262 DM_ASSERT(oneExpander,
"(dmDownStreamDiscover2ExpanderPhy) pExpander NULL");
2263 DM_ASSERT(pDiscoverResp,
"(dmDownStreamDiscover2ExpanderPhy) pDiscoverResp NULL");
2265 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: onePortContxt=%p oneExpander=%p oneDeviceData=%p\n", onePortContext, oneExpander, oneExpander->
dmDevice));
2269 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: invalid port or aborted discovery!!!\n"));
2275 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: wrong!!!\n"));
2280 oneDeviceData = oneExpander->
dmDevice;
2282 DM_ASSERT(oneDeviceData,
"(dmDownStreamDiscover2ExpanderPhy) pDevice NULL");
2285 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Phy #%d of SAS %08x-%08x\n",
2290 DM_DBG2((
" Attached device: %s\n",
2299 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: !!! Incorrect SMP response !!!\n"));
2308 DM_DBG2((
" SAS address : %08x-%08x\n",
2357 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error direct routing can't connect to expander!!!\n"));
2364 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2379 AttachedDevice =
dmPortSASDeviceFind(dmRoot, onePortContext, attachedSasLo, attachedSasHi, oneDeviceData);
2381 if ( AttachedDevice ==
agNULL)
2386 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error subtractive routing error - inconsistent SAS address!!!\n"));
2392 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2408 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: connectionRate 0x%x\n", connectionRate));
2420 dmAllShared->itNexusTimeout,
2437 if (AttachedDevice ==
agNULL)
2445 dmAllShared->itNexusTimeout,
2465 dmAllShared->itNexusTimeout,
2482 if (AttachedDevice ==
agNULL)
2490 dmAllShared->itNexusTimeout,
2500 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: newDevice pDevice=%p\n", AttachedDevice));
2502 if ( AttachedDevice !=
agNULL)
2509 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Report a new SAS device !!\n"));
2518 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Found an STP or SATA device.\n"));
2522 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Found Other type of device.\n"));
2528 DM_DBG3((
"dmDownStreamDiscover2ExpanderPhy: AttachedDevice %p did %d\n", AttachedDevice, AttachedDevice->
id));
2529 DM_DBG3((
"dmDownStreamDiscover2ExpanderPhy: Attached oneExpander %p did %d\n", AttachedDevice->
dmExpander, AttachedDevice->
dmExpander->
id));
2531 DM_DBG3((
"dmDownStreamDiscover2ExpanderPhy: oneDeviceData %p did %d\n", oneDeviceData, oneDeviceData->
id));
2541 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error two table routing phys are connected!!!\n"));
2547 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2559 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Found a EDGE exp device.%p\n", AttachedExpander));
2561 if ( AttachedExpander !=
agNULL)
2582 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy, Failed to allocate expander data structure!!!\n"));
2597 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Found a EDGE/FANOUT exp device.%p\n", AttachedExpander));
2599 if ( AttachedExpander !=
agNULL)
2618 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy, Failed to allocate expander data structure (2)!!!\n"));
2629 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 1st before\n"));
2635 if (ConfigurableExpander)
2643 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 1st before loc 1\n"));
2649 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 1st before loc 2\n"));
2655 ConfigurableExpander,
2661 if ( ConfigurableExpander && dupConfigSASAddr ==
agFALSE)
2663 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 1st q123\n"));
2669 ConfigurableExpander,
2680 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy, Failed to add a device!!!\n"));
2696 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error loop, or end device connects to two expanders!!!\n"));
2702 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2719 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** two subtractive phys!!! Allowed in SAS2!!!\n"));
2737 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error fan out expander to routing table phy!!!\n"));
2743 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2754 AttachedExpander = AttachedDevice->
dmExpander;
2755 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Found edge expander=%p\n", AttachedExpander));
2777 if (SAS2SAS11Check ==
agTRUE)
2780 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error SAS2 and SAS1.1!!!\n"));
2786 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2795 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: Allowed Table to Table (1)\n"));
2804 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error two table routing phys connected (1)!!!\n"));
2810 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2820 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Add edge expander=%p\n", AttachedExpander));
2835 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: Allowed Table to Table (2)\n"));
2843 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: **** Topology Error two table routing phys connected (2)!!!\n"));
2849 DM_DBG1((
"dmDownStreamDiscover2ExpanderPhy: sasAddressHi 0x%08x sasAddressLo 0x%08x phyid 0x%x\n",
2865 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 2nd before\n"));
2872 if (ConfigurableExpander)
2880 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 2nd before loc 1\n"));
2886 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 2nd before loc 2\n"));
2892 ConfigurableExpander,
2897 if ( ConfigurableExpander && dupConfigSASAddr ==
agFALSE)
2899 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 2nd q123 \n"));
2905 ConfigurableExpander,
2919 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: incremental SATA_STP\n"));
2927 dmAllShared->itNexusTimeout,
2937 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: incremental SAS\n"));
2945 dmAllShared->itNexusTimeout,
2962 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Found Self\n"));
2963 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 3rd before\n"));
2971 ConfigurableExpander,
2976 if ( ConfigurableExpander && dupConfigSASAddr ==
agFALSE)
2978 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: 3rd q123 Setup routing table\n"));
2984 ConfigurableExpander,
3008 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: More Phys to discover\n"));
3015 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: No More Phys\n"));
3023 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: Not sure!!!\n"));
3036 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhy: onePortContext->discovery.status not in DISCOVERY_DOWN_STREAM; status %d\n", onePortContext->
discovery.
status));
3057 DM_DBG2((
"dmDiscoveringUndoAdd: start\n"));
3060 DM_DBG2((
"dmDiscoveringUndoAdd: empty discoveringExpanderList\n"));
3071 if ( tempExpander ==
agNULL)
3073 DM_DBG1((
"dmDiscoveringUndoAdd: tempExpander is NULL!!!\n"));
3078 DM_DBG2((
"dmDiscoveringUndoAdd: match!!! expander id %d\n", tempExpander->
id));
3090 DM_DBG2((
"dmDiscoveringUndoAdd: hitting break\n"));
3093 ExpanderList = ExpanderList->
flink;
3114 DM_DBG1((
"dmHandleZoneViolation: start\n"));
3121 DM_DBG1((
"dmHandleZoneViolation: invalid port or aborted discovery!!!\n"));
3151 DM_DBG3((
"dmUpStreamDiscoverExpanderPhySkip: start\n"));
3153 oneDeviceData = oneExpander->
dmDevice;
3162 DM_DBG3((
"dmUpStreamDiscoverExpanderPhySkip: More Phys to discover\n"));
3168 DM_DBG3((
"dmUpStreamDiscoverExpanderPhySkip: No More Phys\n"));
3180 DM_DBG3((
"dmUpStreamDiscoverExpanderPhySkip: onePortContext->discovery.status not in DISCOVERY_UP_STREAM; status %d\n", onePortContext->
discovery.
status));
3199 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhySkip: start\n"));
3200 oneDeviceData = oneExpander->
dmDevice;
3207 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhySkip: DISCOVERY_UP_STREAM find more ...\n"));
3213 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhySkip: DISCOVERY_UP_STREAM last phy continue upstream..\n"));
3225 DM_DBG2((
"dmUpStreamDiscover2ExpanderPhySkip: onePortContext->discovery.status not in DISCOVERY_UP_STREAM; status %d\n", onePortContext->
discovery.
status));
3242 DM_DBG3((
"dmDownStreamDiscoverExpanderPhySkip: start\n"));
3244 oneDeviceData = oneExpander->
dmDevice;
3257 DM_DBG3((
"dmDownStreamDiscoverExpanderPhySkip: More Phys to discover\n"));
3264 DM_DBG3((
"dmDownStreamDiscoverExpanderPhySkip: No More Phys\n"));
3276 DM_DBG3((
"dmDownStreamDiscoverExpanderPhySkip: onePortContext->discovery.status not in DISCOVERY_DOWN_STREAM; status %d\n", onePortContext->
discovery.
status));
3293 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhySkip: start\n"));
3295 oneDeviceData = oneExpander->
dmDevice;
3305 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhySkip: More Phys to discover\n"));
3312 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhySkip: No More Phys\n"));
3324 DM_DBG2((
"dmDownStreamDiscover2ExpanderPhySkip: onePortContext->discovery.status not in DISCOVERY_DOWN_STREAM; status %d\n", onePortContext->
discovery.
status));
3340 DM_DBG3((
"dmExpanderUpStreamPhyAdd: start, phyid %d\n", phyId));
3359 DM_DBG3((
"dmExpanderUpStreamPhyAdd: AFTER phyid %d numOfUpStreamPhys %d\n", phyId, oneExpander->
numOfUpStreamPhys));
3364 DM_DBG3((
"dmExpanderUpStreamPhyAdd: index %d upstream[index] %d\n", i, oneExpander->
upStreamPhys[i]));
3379 DM_DBG3((
"dmExpanderDownStreamPhyAdd: start, phyid %d\n", phyId));
3403 DM_DBG3((
"dmExpanderDownStreamPhyAdd: index %d downstream[index] %d\n", i, oneExpander->
downStreamPhys[i]));
3418 bit16 extension = 0;
3421 DM_DBG2((
"dmDiscoveryReportMCN: start\n"));
3432 DeviceListList = dmAllShared->MainDeviceList.
flink;
3433 while (DeviceListList != &(dmAllShared->MainDeviceList))
3436 if ( oneDeviceData ==
agNULL)
3438 DM_DBG1((
"dmDiscoveryReportMCN: oneDeviceData is NULL!!!\n"));
3441 DM_DBG3((
"dmDiscoveryReportMCN: loop did %d\n", oneDeviceData->
id));
3444 DM_DBG2((
"dmDiscoveryReportMCN: oneDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3446 DM_DBG2((
"dmDiscoveryReportMCN: MCN 0x%08x PrevMCN 0x%08x\n", oneDeviceData->
MCN, oneDeviceData->
PrevMCN));
3450 DM_DBG2((
"dmDiscoveryReportMCN: FULL_START\n"));
3454 DM_DBG2((
"dmDiscoveryReportMCN: INCREMENTAL_START\n"));
3459 if (oneDeviceData->
MCN != oneDeviceData->
PrevMCN && oneDeviceData->
MCN != 0)
3461 DM_DBG2((
"dmDiscoveryReportMCN: reporting \n"));
3464 extension = extension & 0x7FF;
3466 extension = extension | (oneDeviceData->
MCN << 11);
3471 DM_DBG2((
"dmDiscoveryReportMCN: attached expander case\n"));
3472 oneAttachedExpDeviceData = oneDeviceData->
ExpDevice;
3477 DM_DBG2((
"dmDiscoveryReportMCN: No attached expander case\n"));
3484 DM_DBG2((
"dmDiscoveryReportMCN: No change; no reporting \n"));
3485 if (oneDeviceData->
MCN == 0)
3492 DeviceListList = DeviceListList->
flink;
3509 DM_DBG3((
"dmDiscoveryDumpMCN: start\n"));
3511 DeviceListList = dmAllShared->MainDeviceList.
flink;
3512 while (DeviceListList != &(dmAllShared->MainDeviceList))
3515 if (oneDeviceData ==
agNULL)
3517 DM_DBG1((
"dmDiscoveryDumpMCN: oneDeviceData is NULL!!!\n"));
3520 DM_DBG3((
"dmDiscoveryDumpMCN: loop did %d\n", oneDeviceData->
id));
3523 DM_DBG3((
"dmDiscoveryDumpMCN: oneDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3525 DM_DBG3((
"dmDiscoveryDumpMCN: MCN 0x%08x PrevMCN 0x%08x\n", oneDeviceData->
MCN, oneDeviceData->
PrevMCN));
3527 DeviceListList = DeviceListList->
flink;
3544 DM_DBG2((
"dmDiscoveryResetMCN: start\n"));
3547 DeviceListList = dmAllShared->MainDeviceList.
flink;
3548 while (DeviceListList != &(dmAllShared->MainDeviceList))
3551 if (oneDeviceData ==
agNULL)
3553 DM_DBG1((
"dmDiscoveryResetMCN: oneDeviceData is NULL!!!\n"));
3556 DM_DBG3((
"dmDiscoveryResetMCN: loop did %d\n", oneDeviceData->
id));
3561 DM_DBG2((
"dmDiscoveryResetMCN: resetting oneDeviceData->ExpDevice\n"));
3564 DM_DBG3((
"dmDiscoveryResetMCN: resetting MCN and MCNdone\n"));
3565 oneDeviceData->
MCN = 0;
3568 DM_DBG2((
"dmDiscoveryResetMCN: oneDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3571 DeviceListList = DeviceListList->
flink;
3594 DM_DBG2((
"dmUpdateAllAdjacent: start\n"));
3595 if (oneDeviceData ==
agNULL)
3597 DM_DBG1((
"dmUpdateAllAdjacent: oneDeviceData is NULL!!!\n"));
3603 DM_DBG2((
"dmUpdateAllAdjacent: oneDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3607 DeviceListList = dmAllShared->MainDeviceList.
flink;
3608 while (DeviceListList != &(dmAllShared->MainDeviceList))
3611 if ( tmponeDeviceData ==
agNULL)
3613 DM_DBG1((
"dmUpdateAllAdjacent: tmponeDeviceData is NULL!!!\n"));
3616 DM_DBG3((
"dmUpdateAllAdjacent: loop did %d\n", tmponeDeviceData->
id));
3619 DM_DBG2((
"dmUpdateAllAdjacent: setting MCN DONE\n"));
3620 DM_DBG2((
"dmUpdateAllAdjacent: tmponeDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3625 DM_DBG2((
"dmUpdateAllAdjacent: tmponeDeviceData MCN 0x%x\n", tmponeDeviceData->
MCN));
3626 DM_DBG2((
"dmUpdateAllAdjacent: oneDeviceData MCN 0x%x\n", oneDeviceData->
MCN));
3627 tmponeDeviceData->
MCN =
MIN(oneDeviceData->
MCN, tmponeDeviceData->
MCN);
3631 DeviceListList = DeviceListList->
flink;
3647 DM_DBG2((
"dmUpdateMCN: start\n"));
3649 if (AdjacentDeviceData ==
agNULL)
3651 DM_DBG1((
"dmUpdateMCN: AdjacentDeviceData is NULL!!!\n"));
3655 if (oneDeviceData ==
agNULL)
3657 DM_DBG1((
"dmUpdateMCN: oneDeviceData is NULL!!!\n"));
3661 DM_DBG2((
"dmUpdateMCN: Current sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3664 DM_DBG2((
"dmUpdateMCN: AdjacentDeviceData one sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3669 DM_DBG2((
"dmUpdateMCN: DISCOVERY_UP_STREAM\n"));
3674 DM_DBG2((
"dmUpdateMCN: DISCOVERY_DOWN_STREAM\n"));
3686 AdjacentDeviceData->
MCN++;
3687 DM_DBG2((
"dmUpdateMCN: case 1 oneDeviceData MCN 0x%x\n", oneDeviceData->
MCN));
3688 DM_DBG2((
"dmUpdateMCN: case 1 AdjacentDeviceData MCN 0x%x\n", AdjacentDeviceData->
MCN));
3692 AdjacentDeviceData->
MCN++;
3693 AdjacentDeviceData->
MCN =
MIN(oneDeviceData->
MCN, AdjacentDeviceData->
MCN);
3694 DM_DBG2((
"dmUpdateMCN: case 2 oneDeviceData MCN 0x%x\n", oneDeviceData->
MCN));
3695 DM_DBG2((
"dmUpdateMCN: case 2 AdjacentDeviceData MCN 0x%x\n", AdjacentDeviceData->
MCN));
3716 DM_DBG3((
"dmPortSASDeviceFind: start\n"));
3717 DM_DBG3((
"dmPortSASDeviceFind: sasAddressHi 0x%08x sasAddressLo 0x%08x\n", sasAddrHi, sasAddrLo));
3725 DeviceListList = dmAllShared->MainDeviceList.
flink;
3728 DM_DBG3((
"dmPortSASDeviceFind: Full discovery\n"));
3729 while (DeviceListList != &(dmAllShared->MainDeviceList))
3732 if (oneDeviceData ==
agNULL)
3734 DM_DBG1((
"dmPortSASDeviceFind: oneDeviceData is NULL!!!\n"));
3743 DM_DBG3((
"dmPortSASDeviceFind: Found pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
3746 RetDeviceData = oneDeviceData;
3747 dmUpdateMCN(dmRoot, onePortContext, RetDeviceData, CurrentDeviceData);
3750 DeviceListList = DeviceListList->
flink;
3756 DM_DBG3((
"dmPortSASDeviceFind: Incremental discovery\n"));
3757 while (DeviceListList != &(dmAllShared->MainDeviceList))
3760 if (oneDeviceData ==
agNULL)
3762 DM_DBG1((
"dmPortSASDeviceFind: oneDeviceData is NULL!!!\n"));
3771 DM_DBG3((
"dmPortSASDeviceFind: Found pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
3774 RetDeviceData = oneDeviceData;
3775 dmUpdateMCN(dmRoot, onePortContext, RetDeviceData, CurrentDeviceData);
3778 DeviceListList = DeviceListList->
flink;
3784 return RetDeviceData;
3801 DM_DBG3((
"dmNewEXPorNot: start\n"));
3808 if ( oneExpander ==
agNULL)
3810 DM_DBG1((
"dmNewEXPorNot: oneExpander is NULL!!!\n"));
3813 oneDeviceData = oneExpander->
dmDevice;
3819 DM_DBG3((
"dmNewEXPorNot: Found pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
3823 ExpanderList = ExpanderList->
flink;
3843 DM_DBG3((
"dmNewSASorNot: start\n"));
3846 DeviceListList = dmAllShared->MainDeviceList.
flink;
3847 while (DeviceListList != &(dmAllShared->MainDeviceList))
3850 if (oneDeviceData ==
agNULL)
3852 DM_DBG1((
"dmNewSASorNot: oneDeviceData is NULL!!!\n"));
3861 DM_DBG3((
"dmNewSASorNot: Found pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
3865 DeviceListList = DeviceListList->
flink;
3886 bit8 connectionRate,
3887 bit32 itNexusTimeout,
3888 bit32 firstBurstSize,
3896 bit8 dev_s_rate = 0;
3899 bit8 ExpanderConnectionRate = connectionRate;
3901 bit16 extension = 0;
3902 bit32 current_link_rate = 0;
3904 DM_DBG3((
"dmPortSASDeviceAdd: start\n"));
3905 DM_DBG3((
"dmPortSASDeviceAdd: connectionRate %d\n", connectionRate));
3912 if (oneExpDeviceData !=
agNULL)
3915 DM_DBG3((
"dmPortSASDeviceAdd: ExpanderConnectionRate 0x%x\n", ExpanderConnectionRate));
3917 if (oneExpDeviceData !=
agNULL)
3922 DM_DBG1((
"dmPortSASDeviceAdd: 1st Wrong expander!!!\n"));
3942 if (oneDeviceData ==
agNULL)
3944 DM_DBG1((
"dmPortSASDeviceAdd: no more device, oneDeviceData is null!!!\n"));
3947 if ( oneDeviceData !=
agNULL )
3953 DM_DBG3((
"dmPortSASDeviceAdd: OLD, UP_STREAM\n"));
3957 DM_DBG3((
"dmPortSASDeviceAdd: OLD, DOWN_STREAM\n"));
3962 DM_DBG3((
"dmPortSASDeviceAdd: FULL_START\n"));
3963 oneDeviceData->
MCN++;
3968 DM_DBG3((
"dmPortSASDeviceAdd: INCREMENTAL_START\n"));
3971 oneDeviceData->
MCN++;
3975 DM_DBG3((
"dmPortSASDeviceAdd: oneDeviceData MCN 0x%08x\n", oneDeviceData->
MCN));
3976 DM_DBG3((
"dmPortSASDeviceAdd: oneDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
3998 oneAttachedExpDeviceData = oneDeviceData->
ExpDevice;
3999 if (oneAttachedExpDeviceData !=
agNULL)
4002 DM_DBG3((
"dmPortSASDeviceAdd: 1st connectionRate 0x%x DEVINFO_GET_LINKRATE(&oneAttachedExpDeviceData->agDeviceInfo) 0x%x\n",
4007 DM_DBG3((
"dmPortSASDeviceAdd: 1st oneAttachedExpDeviceData is NULL\n"));
4011 sasorsata = (
bit8)deviceType;
4013 dev_s_rate = dev_s_rate | (sasorsata << 4);
4014 dev_s_rate = dev_s_rate |
MIN(connectionRate, ExpanderConnectionRate);
4017 if (current_link_rate != (
bit32)
MIN(connectionRate, ExpanderConnectionRate))
4019 DM_DBG1((
"dmPortSASDeviceAdd: link rate changed current 0x%x new 0x%x\n", current_link_rate,
MIN(connectionRate, ExpanderConnectionRate)));
4023 oneAttachedExpDeviceData = oneDeviceData->
ExpDevice;
4048 return oneDeviceData;
4064 if (oneDeviceData ==
agNULL)
4066 DM_DBG1((
"dmPortSASDeviceAdd: no more device, oneDeviceData is null !!!\n"));
4070 if ( oneDeviceData !=
agNULL )
4081 DM_DBG3((
"dmPortSASDeviceAdd: NEW, UP_STREAM\n"));
4085 DM_DBG3((
"dmPortSASDeviceAdd: NEW, DOWN_STREAM\n"));
4090 DM_DBG3((
"dmPortSASDeviceAdd: FULL_START\n"));
4091 oneDeviceData->
MCN++;
4096 DM_DBG3((
"dmPortSASDeviceAdd: INCREMENTAL_START\n"));
4099 oneDeviceData->
MCN++;
4102 DM_DBG3((
"dmPortSASDeviceAdd: oneDeviceData MCN 0x%08x\n", oneDeviceData->
MCN));
4103 DM_DBG3((
"dmPortSASDeviceAdd: oneDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
4118 oneAttachedExpDeviceData = oneDeviceData->
ExpDevice;
4119 if (oneAttachedExpDeviceData !=
agNULL)
4122 DM_DBG3((
"dmPortSASDeviceAdd: 2nd connectionRate 0x%x DEVINFO_GET_LINKRATE(&oneAttachedExpDeviceData->agDeviceInfo) 0x%x\n",
4127 DM_DBG3((
"dmPortSASDeviceAdd: 2nd oneAttachedExpDeviceData is NULL\n"));
4131 sasorsata = (
bit8)deviceType;
4132 dev_s_rate = dev_s_rate | (sasorsata << 4);
4133 dev_s_rate = dev_s_rate |
MIN(connectionRate, ExpanderConnectionRate);
4148 DM_DBG3((
"dmPortSASDeviceAdd: did %d\n", oneDeviceData->
id));
4164 extension = (
bit16)(extension | (1 << 8));
4181 DM_DBG3((
"dmPortSASDeviceAdd: attached expander case\n"));
4182 oneAttachedExpDeviceData = oneDeviceData->
ExpDevice;
4194 DM_DBG3((
"dmPortSASDeviceAdd: oneAttachedExpDeviceData addrHi 0x%08x addrLo 0x%08x PhyID 0x%x ext 0x%x\n",
4202 DM_DBG1((
"dmPortSASDeviceAdd: 2nd Wrong expander!!!\n"));
4223 DM_DBG3((
"dmPortSASDeviceAdd: NO attached expander case\n"));
4233 return oneDeviceData;
4248 DM_DBG3((
"dmFindRegNValid: start\n"));
4251 DeviceListList = dmAllShared->MainDeviceList.
flink;
4254 DM_DBG3((
"dmFindRegNValid: Full discovery\n"));
4255 while (DeviceListList != &(dmAllShared->MainDeviceList))
4258 if (oneDeviceData ==
agNULL)
4260 DM_DBG1((
"dmFindRegNValid: oneDeviceData is NULL!!!\n"));
4269 DM_DBG3((
"dmFindRegNValid: Found pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
4275 DeviceListList = DeviceListList->
flink;
4281 DM_DBG3((
"dmFindRegNValid: Incremental discovery\n"));
4282 while (DeviceListList != &(dmAllShared->MainDeviceList))
4285 if (oneDeviceData ==
agNULL)
4287 DM_DBG1((
"dmFindRegNValid: oneDeviceData is NULL!!!\n"));
4296 DM_DBG3((
"dmFindRegNValid: Found pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
4302 DeviceListList = DeviceListList->
flink;
4310 DM_DBG3((
"dmFindRegNValid: end returning NULL\n"));
4315 DM_DBG3((
"dmFindRegNValid: end returning NOT NULL\n"));
4316 return oneDeviceData;
4330 DM_DBG3((
"dmNotifyBC: start\n"));
4332 if (onePortContext ==
agNULL)
4334 DM_DBG1((
"dmNotifyBC: onePortContext is NULL, wrong!!!\n"));
4344 DM_DBG3((
"dmNotifyBC: BROADCAST_CHANGE\n"));
4352 DM_DBG3((
"dmNotifyBC: pid %d BROADCAST_CHANGE; updating SeenBC. Do nothing.\n", onePortContext->
id));
4359 DM_DBG3((
"dmNotifyBC: OSSA_HW_EVENT_BROADCAST_SES\n"));
4363 DM_DBG3((
"dmNotifyBC: OSSA_HW_EVENT_BROADCAST_EXP\n"));
4367 DM_DBG3((
"dmNotifyBC: unspecified broadcast type 0x%x\n", type));
4385 DM_DBG3((
"dmNotifyBC: start\n"));
4392 DM_DBG3((
"dmNotifyBC: BROADCAST_CHANGE; does incremental discovery\n"));
4399 DM_DBG3((
"dmNotifyBC: tdsaBCTimer\n"));
4413 DM_DBG3((
"dmNotifyBC: pid %d BROADCAST_CHANGE; updating SeenBC. Do nothing.\n", onePortContext->
id));
4419 DM_DBG3((
"dmNotifyBC: OSSA_HW_EVENT_BROADCAST_SES\n"));
4423 DM_DBG3((
"dmNotifyBC: OSSA_HW_EVENT_BROADCAST_EXP\n"));
4427 DM_DBG3((
"dmNotifyBC: unspecified broadcast type 0x%x\n", type));
4440 DM_DBG1((
"dmResetFailedDiscovery: start\n"));
4444 if (onePortContext ==
agNULL)
4446 DM_DBG1((
"dmResetFailedDiscovery: onePortContext is NULL, wrong!!!\n"));
4456 DM_DBG1((
"dmResetFailedDiscovery: discovery is NOT DM_DSTATE_COMPLETED_WITH_FAILURE. It is 0x%x\n", onePortContext->
DiscoveryState));
4470 DM_DBG3((
"dmQueryDiscovery: start\n"));
4474 if (onePortContext ==
agNULL)
4476 DM_DBG1((
"dmQueryDiscovery: onePortContext is NULL, wrong!!!\n"));
4512 bit32 sasAddressHi, sasAddressLo;
4516 DM_DBG3((
"dmRegisterDevice: start\n"));
4519 if (onePortContext ==
agNULL)
4521 DM_DBG1((
"dmRegisterDevice: onePortContext is NULL!!!\n"));
4527 DM_DBG1((
"dmRegisterDevice: invalid port!!!\n"));
4562 if (oneDeviceData ==
agNULL)
4564 DM_DBG1((
"dmRegisterDevice: oneDeviceData is NULL!!!\n"));
4584 DM_DBG4((
"dmRegisterDevice: no expander type. default to edge expander\n"));
4591 DM_DBG1((
"dmRegisterDevice: directly attached expander\n"));
4597 DM_DBG1((
"dmRegisterDevice: NOT directly attached expander\n"));
4603 DM_DBG3((
"dmRegisterDevice: DM_DSTATE_NOT_STARTED\n"));
4606 if ( oneExpander !=
agNULL)
4617 DM_DBG1((
"dmRegisterDevice: failed to allocate expander !!!\n"));
4630 DM_DBG3((
"dmRegisterDevice: NOT DM_DSTATE_NOT_STARTED\n"));
4633 DM_DBG3((
"dmRegisterDevice: AddrHi 0x%08x AddrLo 0x%08x\n", sasAddressHi, sasAddressLo));
4634 oneExpander =
dmExpFind(dmRoot, onePortContext, sasAddressHi, sasAddressLo);
4635 if ( oneExpander !=
agNULL)
4641 DM_DBG1((
"dmRegisterDevice: not allowed case, wrong !!!\n"));
4661 DM_DBG3((
"dmDiscoveringExpanderAlloc: start\n"));
4662 DM_DBG3((
"dmDiscoveringExpanderAlloc: did %d\n", oneDeviceData->
id));
4668 DM_DBG1((
"dmDiscoveringExpanderAlloc: invalid port!!!\n"));
4679 if (oneExpander ==
agNULL)
4684 DM_DBG1((
"dmDiscoveringExpanderAlloc: no free expanders pid %d!!!\n", onePortContext->
id));
4700 if (oneExpander !=
agNULL)
4702 DM_DBG1((
"dmDiscoveringExpanderAlloc: pid %d exp id %d \n", onePortContext->
id, oneExpander->
id));
4708 oneExpander->
dmDevice = oneDeviceData;
4720 DM_DBG3((
"dmDiscoveringExpanderAlloc: oneDeviceData %p did %d\n", oneDeviceData, oneDeviceData->
id));
4735 DM_DBG3((
"dmDiscoveringExpanderAdd: start\n"));
4736 DM_DBG3((
"dmDiscoveringExpanderAdd: expander id %d\n", oneExpander->
id));
4742 DM_DBG1((
"dmDiscoveringExpanderAdd: invalid port!!!\n"));
4747 DM_DBG3((
"dmDiscoveringExpanderAdd: UPSTREAM\n"));
4751 DM_DBG3((
"dmDiscoveringExpanderAdd: DOWNSTREAM\n"));
4760 DM_DBG3((
"dmDiscoveringExpanderAdd: ADDED \n"));
4781 DM_DBG3((
"dmFindConfigurableExp: start\n"));
4783 if (oneExpander ==
agNULL)
4785 DM_DBG3((
"dmFindConfigurableExp: NULL expander\n"));
4796 DM_DBG3((
"dmFindConfigurableExp: empty UpdiscoveringExpanderList\n"));
4804 while (tempExpander)
4810 DM_DBG3((
"dmFindConfigurableExp: found configurable expander\n"));
4824 bit32 configSASAddressHi,
4825 bit32 configSASAddressLo
4830 DM_DBG3((
"dmDuplicateConfigSASAddr: start\n"));
4832 if (oneExpander ==
agNULL)
4834 DM_DBG3((
"dmDuplicateConfigSASAddr: NULL expander\n"));
4842 DM_DBG3((
"dmDuplicateConfigSASAddr: unnecessary\n"));
4848 DM_DBG3((
"dmDuplicateConfigSASAddr: configsasAddressHi 0x%08x\n", configSASAddressHi));
4849 DM_DBG3((
"dmDuplicateConfigSASAddr: configsasAddressLo 0x%08x\n", configSASAddressLo));
4857 DM_DBG3((
"dmDuplicateConfigSASAddr: FOUND\n"));
4865 DM_DBG3((
"dmDuplicateConfigSASAddr: adding configSAS Addr\n"));
4886 DM_DBG3((
"dmFindCurrentDownStreamPhyIndex: start\n"));
4888 if (oneExpander ==
agNULL)
4890 DM_DBG1((
"dmFindCurrentDownStreamPhyIndex: wrong, oneExpander is NULL!!!\n"));
4896 if (DownStreamExpander ==
agNULL)
4898 DM_DBG1((
"dmFindCurrentDownStreamPhyIndex: wrong, DownStreamExpander is NULL!!!\n"));
4910 DM_DBG3((
"dmFindCurrentDownStreamPhyIndex: phyId %d\n", phyId));
4920 DM_DBG3((
"dmFindCurrentDownStreamPhyIndex: index %d\n",
index));
4937 DM_DBG3((
"dmFindDiscoveringExpander: start\n"));
4944 DM_DBG3((
"dmFindDiscoveringExpander: empty discoveringExpanderList\n"));
4951 if (tempExpander == oneExpander)
4953 if (tempExpander !=
agNULL)
4955 DM_DBG3((
"dmFindDiscoveringExpander: match, expander id %d\n", tempExpander->
id));
4963 ExpanderList = ExpanderList->
flink;
4981 DM_DBG3((
"dmDiscoveringExpanderRemove: start\n"));
4982 DM_DBG3((
"dmDiscoveringExpanderRemove: expander id %d\n", oneExpander->
id));
4986 DM_DBG3((
"dmDiscoveringExpanderRemove: BEFORE\n"));
4995 DM_DBG3((
"dmDiscoveringExpanderRemove: oneExpander %p did %d\n", oneExpander, oneExpander->
id));
4999 DM_DBG3((
"dmDiscoveringExpanderRemove: before !!! wrong !!!\n"));
5009 DM_DBG3((
"dmDiscoveringExpanderRemove: DISCOVERY_UP_STREAM\n"));
5026 DM_DBG3((
"dmDiscoveringExpanderRemove: after !!! wrong !!!\n"));
5032 DM_DBG1((
"dmDiscoveringExpanderRemove: !!! problem !!!\n"));
5035 DM_DBG3((
"dmDiscoveringExpanderRemove: AFTER\n"));
5060 DM_DBG3((
"dmExpMainListFind: start\n"));
5065 DM_DBG1((
"dmExpMainListFind: empty mainExpanderList\n"));
5073 ExpanderList = dmAllShared->mainExpanderList.
flink;
5074 while (ExpanderList != &(dmAllShared->mainExpanderList))
5077 if (tempExpander ==
agNULL)
5079 DM_DBG1((
"dmExpMainListFind: tempExpander is NULL!!!\n"));
5082 DM_DBG3((
"dmExpMainListFind: expander id %d\n", tempExpander->
id));
5090 DM_DBG3((
"dmExpMainListFind: found expander id %d\n", tempExpander->
id));
5093 return tempExpander;
5095 ExpanderList = ExpanderList->
flink;
5115 DM_DBG3((
"dmExpFind: start\n"));
5120 DM_DBG3((
"dmExpFind tdsaDumpAllExp: empty discoveringExpanderList\n"));
5132 if (tempExpander ==
agNULL)
5134 DM_DBG1((
"dmExpFind: tempExpander is NULL!!!\n"));
5137 DM_DBG3((
"dmExpFind: expander id %d\n", tempExpander->
id));
5145 DM_DBG3((
"dmExpFind: found\n"));
5146 return tempExpander;
5148 ExpanderList = ExpanderList->
flink;
5159 DM_DBG3((
"dmDiscoverCheck: start\n"));
5161 if (onePortContext ==
agNULL)
5163 DM_DBG1((
"dmDiscoverCheck: onePortContext is NULL!!!\n"));
5168 DM_DBG1((
"dmDiscoverCheck: invalid port!!!\n"));
5175 DM_DBG1((
"dmDiscoverCheck: aborted discovery!!!\n"));
5196 DM_DBG1((
"dmDiscoverAbort: start\n"));
5201 DM_DBG1((
"dmDiscoverAbort: not allowed case!!! onePortContext->DiscoveryState 0x%x onePortContext->discovery.status 0x%x\n",
5232 DM_DBG3((
"dmCleanAllExp: start\n"));
5233 DM_DBG3((
"dmCleanAllExp: pid %d\n", onePortContext->
id));
5235 DM_DBG3((
"dmCleanAllExp: before all clean up\n"));
5239 DM_DBG3((
"dmCleanAllExp: clean discoveringExpanderList\n"));
5246 if (tempExpander ==
agNULL)
5248 DM_DBG1((
"dmCleanAllExp: tempExpander is NULL!!!\n"));
5253 DM_DBG3((
"dmCleanAllExp: exp id %d\n", tempExpander->
id));
5259 if (oneExpander ==
agNULL)
5261 DM_DBG3((
"dmCleanAllExp: moving\n"));
5262 DM_DBG3((
"dmCleanAllExp: moving, exp id %d\n", tempExpander->
id));
5282 DM_DBG3((
"dmCleanAllExp: in mainExpanderList; skippig\n"));
5283 ExpanderList = ExpanderList->
flink;
5289 DM_DBG3((
"dmCleanAllExp: empty discoveringExpanderList\n"));
5296 DM_DBG3((
"dmCleanAllExp: clean UpdiscoveringExpanderList\n"));
5299 DM_DBG3((
"dmCleanAllExp: empty UpdiscoveringExpanderList\n"));
5306 if (tempExpander ==
agNULL)
5308 DM_DBG1((
"dmCleanAllExp: tempExpander is NULL!!!\n"));
5313 DM_DBG3((
"dmCleanAllExp: exp id %d\n", tempExpander->
id));
5318 if (oneExpander ==
agNULL)
5320 DM_DBG3((
"dmCleanAllExp: moving\n"));
5321 DM_DBG3((
"dmCleanAllExp: moving exp id %d\n", tempExpander->
id));
5339 DM_DBG3((
"dmCleanAllExp: in mainExpanderList; skippig\n"));
5340 ExpanderList = ExpanderList->
flink;
5347 DM_DBG3((
"dmCleanAllExp: after all clean up\n"));
5365 DM_DBG3((
"dmInternalRemovals: start\n"));
5370 DM_DBG3((
"dmInternalRemovals: empty device list\n"));
5378 DeviceListList = dmAllShared->MainDeviceList.
flink;
5379 while (DeviceListList != &(dmAllShared->MainDeviceList))
5382 if (oneDeviceData ==
agNULL)
5384 DM_DBG1((
"dmInternalRemovals: oneDeviceData is NULL!!!\n"));
5387 DM_DBG3((
"dmInternalRemovals: loop did %d\n", oneDeviceData->
id));
5390 DM_DBG3((
"dmInternalRemovals: valid %d\n", oneDeviceData->
valid));
5391 DM_DBG3((
"dmInternalRemovals: valid2 %d\n", oneDeviceData->
valid2));
5395 DM_DBG3((
"dmInternalRemovals: right portcontext pid %d\n", onePortContext->
id));
5398 DM_DBG3((
"dmInternalRemovals: incremental discovery\n"));
5403 DM_DBG3((
"dmInternalRemovals: full discovery\n"));
5406 DeviceListList = DeviceListList->
flink;
5412 DM_DBG3((
"dmInternalRemovals: different portcontext; oneDeviceData->dmPortContext pid %d oneportcontext pid %d\n", oneDeviceData->
dmPortContext->
id, onePortContext->
id));
5416 DM_DBG3((
"dmInternalRemovals: different portcontext; oneDeviceData->dmPortContext pid NULL oneportcontext pid %d\n", onePortContext->
id));
5418 DeviceListList = DeviceListList->
flink;
5437 DM_DBG3((
"dmDiscoveryResetProcessed: start\n"));
5440 DeviceListList = dmAllShared->MainDeviceList.
flink;
5441 while (DeviceListList != &(dmAllShared->MainDeviceList))
5444 if (oneDeviceData ==
agNULL)
5446 DM_DBG1((
"dmDiscoveryResetProcessed: oneDeviceData is NULL!!!\n"));
5449 DM_DBG3((
"dmDiscoveryResetProcessed: loop did %d\n", oneDeviceData->
id));
5452 DM_DBG3((
"dmDiscoveryResetProcessed: resetting procssed flag\n"));
5455 DeviceListList = DeviceListList->
flink;
5479 DM_DBG3((
"dmDiscoverDone: start\n"));
5480 DM_DBG3((
"dmDiscoverDone: pid %d\n", onePortContext->
id));
5497 DM_DBG3((
"dmDiscoverDone: broadcast change; discover again\n"));
5506 DM_DBG3((
"dmDiscoverDone: dmBCTimer\n"));
5543 DM_DBG1((
"dmDiscoverDone: Error; clean up!!!\n"));
5600 DM_DBG3((
"dmSubReportRemovals: start\n"));
5602 DM_DBG3((
"dmSubReportRemovals: flag 0x%x\n", flag));
5610 DM_DBG3((
"dmSubReportRemovals: attached expander case\n"));
5611 oneAttachedExpDeviceData = oneDeviceData->
ExpDevice;
5616 DM_DBG3((
"dmSubReportRemovals: NO attached expander case\n"));
5637 DM_DBG3((
"dmSubReportChanges: start\n"));
5639 DM_DBG3((
"dmSubReportChanges: flag 0x%x\n", flag));
5648 DM_DBG3((
"dmSubReportChanges: attached expander case\n"));
5649 oneAttachedExpDeviceData = oneDeviceData->
ExpDevice;
5654 DM_DBG3((
"dmSubReportChanges: NO attached expander case\n"));
5660 DM_DBG3((
"dmSubReportChanges: skip; been reported\n"));
5685 DM_DBG3((
"dmReportChanges: start\n"));
5691 DM_DBG3((
"dmReportChanges: empty device list\n"));
5699 DeviceListList = dmAllShared->MainDeviceList.
flink;
5700 while (DeviceListList != &(dmAllShared->MainDeviceList))
5703 if (oneDeviceData ==
agNULL)
5705 DM_DBG1((
"dmReportChanges: oneDeviceData is NULL!!!\n"));
5712 DM_DBG3((
"dmReportChanges: right portcontext\n"));
5717 DM_DBG1((
"dmReportChanges: keep, not reporting did 0x%x\n", oneDeviceData->
id));
5723 DM_DBG3((
"dmReportChanges: same\n"));
5731 DM_DBG3((
"dmReportChanges: removed\n"));
5742 DM_DBG3((
"dmReportChanges: added\n"));
5751 DM_DBG3((
"dmReportChanges: else\n"));
5756 DM_DBG3((
"dmReportChanges: different portcontext\n"));
5758 DeviceListList = DeviceListList->
flink;
5776 DM_DBG3((
"dmReportChanges: added at the end\n"));
5780 onePortContext->tiPortalContext,
5791 DM_DBG3((
"dmReportChanges: removed at the end\n"));
5795 onePortContext->tiPortalContext,
5806 DM_DBG3((
"dmReportChanges: missed chance to report. forced to report OK\n"));
5811 onePortContext->tiPortalContext,
5822 DM_DBG3((
"dmReportChanges: the same\n"));
5841 DM_DBG1((
"dmReportRemovals: start\n"));
5847 DM_DBG3((
"dmReportRemovals: empty device list\n"));
5855 DeviceListList = dmAllShared->MainDeviceList.
flink;
5856 while (DeviceListList != &(dmAllShared->MainDeviceList))
5859 if (oneDeviceData ==
agNULL)
5861 DM_DBG1((
"dmReportRemovals: oneDeviceData is NULL!!!\n"));
5864 DM_DBG3((
"dmReportRemovals: loop did %d\n", oneDeviceData->
id));
5867 DM_DBG3((
"dmReportRemovals: valid %d\n", oneDeviceData->
valid));
5868 DM_DBG3((
"dmReportRemovals: valid2 %d\n", oneDeviceData->
valid2));
5872 DM_DBG3((
"dmReportRemovals: right portcontext pid %d\n", onePortContext->
id));
5877 DM_DBG1((
"dmReportRemovals: keeping\n"));
5883 DM_DBG3((
"dmReportRemovals: removing\n"));
5895 DM_DBG3((
"dmReportRemovals: did %d\n", oneDeviceData->
id));
5913 DeviceListList = DeviceListList->
flink;
5919 DM_DBG3((
"dmReportRemovals: different portcontext; oneDeviceData->dmPortContext pid %d oneportcontext pid %d\n", oneDeviceData->
dmPortContext->
id, onePortContext->
id));
5923 DM_DBG3((
"dmReportRemovals: different portcontext; oneDeviceData->dmPortContext pid NULL oneportcontext pid %d\n", onePortContext->
id));
5925 DeviceListList = DeviceListList->
flink;
5931 DM_DBG3((
"dmReportRemovals: removed at the end\n"));
5935 onePortContext->tiPortalContext,
5958 DM_DBG3((
"dmResetReported: start\n"));
5964 DM_DBG3((
"dmResetReported: empty device list\n"));
5972 DeviceListList = dmAllShared->MainDeviceList.
flink;
5973 while (DeviceListList != &(dmAllShared->MainDeviceList))
5976 if (oneDeviceData ==
agNULL)
5978 DM_DBG1((
"dmResetReported: oneDeviceData is NULL!!!\n"));
5981 DM_DBG3((
"dmResetReported: loop did %d\n", oneDeviceData->
id));
5984 DM_DBG3((
"dmResetReported: valid %d\n", oneDeviceData->
valid));
5985 DM_DBG3((
"dmResetReported: valid2 %d\n", oneDeviceData->
valid2));
5989 DM_DBG3((
"dmResetReported: right portcontext pid %d\n", onePortContext->
id));
5991 DeviceListList = DeviceListList->
flink;
5997 DM_DBG3((
"dmResetReported: different portcontext; oneDeviceData->dmPortContext pid %d oneportcontext pid %d\n", oneDeviceData->
dmPortContext->
id, onePortContext->
id));
6001 DM_DBG3((
"dmResetReported: different portcontext; oneDeviceData->dmPortContext pid NULL oneportcontext pid %d\n", onePortContext->
id));
6003 DeviceListList = DeviceListList->
flink;
6022 DM_DBG1((
"dmDiscoveryInvalidateDevices: start\n"));
6028 DM_DBG3((
"dmDiscoveryInvalidateDevices: empty device list\n"));
6035 DeviceListList = dmAllShared->MainDeviceList.
flink;
6036 while (DeviceListList != &(dmAllShared->MainDeviceList))
6039 if (oneDeviceData ==
agNULL)
6041 DM_DBG1((
"dmDiscoveryInvalidateDevices: oneDeviceData is NULL!!!\n"));
6044 DM_DBG3((
"dmDiscoveryInvalidateDevices: loop did %d\n", oneDeviceData->
id));
6047 DM_DBG3((
"dmDiscoveryInvalidateDevices: valid %d\n", oneDeviceData->
valid));
6048 DM_DBG3((
"dmDiscoveryInvalidateDevices: valid2 %d\n", oneDeviceData->
valid2));
6052 DM_DBG3((
"dmDiscoveryInvalidateDevices: right portcontext pid %d\n", onePortContext->
id));
6057 DM_DBG1((
"dmDiscoveryInvalidateDevices: keeping\n"));
6068 DM_DBG3((
"dmDiscoveryInvalidateDevices: did %d\n", oneDeviceData->
id));
6073 DeviceListList = DeviceListList->
flink;
6079 DM_DBG3((
"dmDiscoveryInvalidateDevices: different portcontext; oneDeviceData->dmPortContext pid %d oneportcontext pid %d\n", oneDeviceData->
dmPortContext->
id, onePortContext->
id));
6083 DM_DBG3((
"dmDiscoveryInvalidateDevices: different portcontext; oneDeviceData->dmPortContext pid NULL oneportcontext pid %d\n", onePortContext->
id));
6085 DeviceListList = DeviceListList->
flink;
6110 DM_DBG1((
"dmDiscoveryErrorRemovals: start\n"));
6116 DM_DBG3((
"dmDiscoveryErrorRemovals: empty device list\n"));
6123 DeviceListList = dmAllShared->MainDeviceList.
flink;
6124 while (DeviceListList != &(dmAllShared->MainDeviceList))
6127 if (oneDeviceData ==
agNULL)
6129 DM_DBG1((
"dmDiscoveryErrorRemovals: oneDeviceData is NULL!!!\n"));
6132 DM_DBG3((
"dmDiscoveryErrorRemovals: loop did %d\n", oneDeviceData->
id));
6135 DM_DBG3((
"dmDiscoveryErrorRemovals: valid %d\n", oneDeviceData->
valid));
6136 DM_DBG3((
"dmDiscoveryErrorRemovals: valid2 %d\n", oneDeviceData->
valid2));
6140 DM_DBG3((
"dmDiscoveryErrorRemovals: right portcontext pid %d\n", onePortContext->
id));
6145 DM_DBG1((
"dmDiscoveryErrorRemovals: keeping\n"));
6155 DM_DBG3((
"dmDiscoveryErrorRemovals: did %d\n", oneDeviceData->
id));
6162 DeviceListList = DeviceListList->
flink;
6168 DM_DBG3((
"dmDiscoveryErrorRemovals: different portcontext; oneDeviceData->dmPortContext pid %d oneportcontext pid %d\n", oneDeviceData->
dmPortContext->
id, onePortContext->
id));
6172 DM_DBG3((
"dmDiscoveryErrorRemovals: different portcontext; oneDeviceData->dmPortContext pid NULL oneportcontext pid %d\n", onePortContext->
id));
6174 DeviceListList = DeviceListList->
flink;
6194 DM_DBG3((
"dmDiscoveryExpanderCleanUp: start\n"));
6209 ExpanderList = dmAllShared->mainExpanderList.
flink;
6210 while (ExpanderList != &(dmAllShared->mainExpanderList))
6213 if (oneExpander ==
agNULL)
6215 DM_DBG1((
"dmDiscoveryExpanderCleanUp: oneExpander is NULL!!!\n"));
6218 oneDeviceData = oneExpander->
dmDevice;
6237 ExpanderList = dmAllShared->mainExpanderList.
flink;
6241 ExpanderList = ExpanderList->
flink;
6248 DM_DBG3((
"dmDiscoveryExpanderCleanUp: empty mainExpanderList\n"));
6267 DM_DBG3((
"dmDiscoveryDeviceCleanUp: start\n"));
6273 DeviceListList = dmAllShared->MainDeviceList.
flink;
6274 while (DeviceListList != &(dmAllShared->MainDeviceList))
6277 if (oneDeviceData ==
agNULL)
6279 DM_DBG1((
"dmDiscoveryDeviceCleanUp: oneDeviceData is NULL!!!\n"));
6301 DeviceListList = dmAllShared->MainDeviceList.
flink;
6305 DeviceListList = DeviceListList->
flink;
6312 DM_DBG3((
"dmDiscoveryDeviceCleanUp: empty MainDeviceList\n"));
6326 DM_DBG3((
"dmDumpAllExp: start\n"));
6338 DM_DBG3((
"dmDumpAllUpExp: start\n"));
6347 DM_DBG3((
"dmDumpAllFreeExp: start\n"));
6362 DM_DBG3((
"dmDumpAllMainExp: start\n"));
6367 DM_DBG3((
"dmDumpAllMainExp: empty discoveringExpanderList\n"));
6376 ExpanderList = dmAllShared->mainExpanderList.
flink;
6377 while (ExpanderList != &(dmAllShared->mainExpanderList))
6380 if (tempExpander ==
agNULL)
6382 DM_DBG1((
"dmDumpAllMainExp: tempExpander is NULL!!!\n"));
6385 DM_DBG3((
"dmDumpAllMainExp: expander id %d\n", tempExpander->
id));
6391 DM_DBG3((
"dmDumpAllMainExp: found expander id %d\n", tempExpander->
id));
6395 ExpanderList = ExpanderList->
flink;
6411 bit32 total = 0, port_total = 0;
6413 DM_DBG3((
"dmDumpAllMainDevice: start\n"));
6418 DM_DBG3((
"dmDumpAllMainDevice: empty discoveringExpanderList\n"));
6427 DeviceListList = dmAllShared->MainDeviceList.
flink;
6428 while (DeviceListList != &(dmAllShared->MainDeviceList))
6431 if (oneDeviceData ==
agNULL)
6433 DM_DBG3((
"dmDumpAllMainDevice: oneDeviceData is NULL!!!\n"));
6436 DM_DBG3((
"dmDumpAllMainDevice: oneDeviceData id %d\n", oneDeviceData->
id));
6443 DM_DBG3((
"dmDumpAllMainDevice: found oneDeviceData id %d\n", oneDeviceData->
id));
6448 DeviceListList = DeviceListList->
flink;
6450 DM_DBG3((
"dmDumpAllMainDevice: total %d port_totaol %d\n", total, port_total));
6473 DM_DBG3((
"dmAddSASToSharedcontext: start\n"));
6474 DM_DBG3((
"dmAddSASToSharedcontext: oneportContext ID %d\n", onePortContext->
id));
6476 if (oneExpDeviceData !=
agNULL)
6478 DM_DBG3((
"dmAddSASToSharedcontext: oneExpDeviceData sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
6483 DM_DBG3((
"dmAddSASToSharedcontext: oneExpDeviceData is NULL\n"));
6486 DeviceListList = dmAllShared->MainDeviceList.
flink;
6487 while (DeviceListList != &(dmAllShared->MainDeviceList))
6490 if (oneDeviceData ==
agNULL)
6492 DM_DBG1((
"dmAddSASToSharedcontext: oneDeviceData is NULL!!!\n"));
6500 DM_DBG3((
"dmAddSASToSharedcontext: pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
6504 DeviceListList = DeviceListList->
flink;
6508 if (new_device ==
agTRUE)
6510 DM_DBG3((
"dmAddSASToSharedcontext: new device\n"));
6511 DM_DBG3((
"dmAddSASToSharedcontext: sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
6517 DM_DBG1((
"dmAddSASToSharedcontext: empty DeviceData FreeLink\n"));
6526 if (oneDeviceData !=
agNULL)
6528 DM_DBG3((
"dmAddSASToSharedcontext: oneDeviceData %p pid %d did %d\n", oneDeviceData, onePortContext->
id, oneDeviceData->
id));
6530 onePortContext->
Count++;
6531 oneDeviceData->
dmRoot = dmRoot;
6548 if (oneExpDeviceData !=
agNULL)
6550 oneDeviceData->
ExpDevice = oneExpDeviceData;
6554 if (oneDeviceData->
phyID == 0xFF)
6556 oneDeviceData->
phyID = phyID;
6563 DM_DBG3((
"dmAddSASToSharedcontext: DM_DSTATE_NOT_STARTED\n"));
6572 DM_DBG3((
"dmAddSASToSharedcontext: incremental discovery\n"));
6579 DM_DBG3((
"dmAddSASToSharedcontext: full discovery\n"));
6589 DM_DBG3((
"dmAddSASToSharedcontext: one case pid %d did %d \n", onePortContext->
id, oneDeviceData->
id));
6590 DM_DBG3((
"dmAddSASToSharedcontext: new case pid %d did %d phyID %d\n", onePortContext->
id, oneDeviceData->
id, oneDeviceData->
phyID));
6595 DM_DBG3((
"dmAddSASToSharedcontext: old device\n"));
6596 DM_DBG3((
"dmAddSASToSharedcontext: oneDeviceData %p did %d\n", oneDeviceData, oneDeviceData->
id));
6597 DM_DBG3((
"dmAddSASToSharedcontext: sasAddressHi 0x%08x sasAddressLo 0x%08x\n",
6600 oneDeviceData->
dmRoot = dmRoot;
6617 if (oneExpDeviceData !=
agNULL)
6619 oneDeviceData->
ExpDevice = oneExpDeviceData;
6623 if (oneDeviceData->
phyID == 0xFF)
6625 oneDeviceData->
phyID = phyID;
6630 DM_DBG3((
"dmAddSASToSharedcontext: DM_DSTATE_NOT_STARTED\n"));
6639 DM_DBG3((
"dmAddSASToSharedcontext: incremental discovery\n"));
6646 DM_DBG3((
"dmAddSASToSharedcontext: full discovery\n"));
6652 DM_DBG3((
"dmAddSASToSharedcontext: old case pid %d did %d phyID %d\n", onePortContext->
id, oneDeviceData->
id, oneDeviceData->
phyID));
6655 return oneDeviceData;
6673 DM_DBG3((
"dmDeviceFind: start\n"));
6675 DeviceListList = dmAllShared->MainDeviceList.
flink;
6677 while (DeviceListList != &(dmAllShared->MainDeviceList))
6680 if (oneDeviceData ==
agNULL)
6682 DM_DBG1((
"dmDeviceFind: oneDeviceData is NULL!!!\n"));
6691 DM_DBG3((
"dmDeviceFind: Found pid %d did %d\n", onePortContext->
id, oneDeviceData->
id));
6697 DeviceListList = DeviceListList->
flink;
6702 DM_DBG3((
"dmDeviceFind: end returning NULL\n"));
6707 DM_DBG3((
"dmDeviceFind: end returning NOT NULL\n"));
6708 return oneDeviceData;
6724 DM_DBG3((
"dmBCTimer: start\n"));
6726 discovery = &(onePortContext->
discovery);
6756 &dmAllShared->timerlist,
6778 DM_DBG3((
"dmBCTimerCB: start\n"));
6781 discovery = &(onePortContext->
discovery);
6821 DM_DBG3((
"dmDiscoverySMPTimer: start\n"));
6822 DM_DBG3((
"dmDiscoverySMPTimer: pid %d SMPFn 0x%x\n", onePortContext->
id, functionCode));
6825 discovery = &(onePortContext->
discovery);
6854 &dmAllShared->timerlist,
6888 DM_DBG1((
"dmDiscoverySMPTimerCB: start!!!\n"));
6893 discovery = &(onePortContext->
discovery);
6894 oneDeviceData = dmSMPRequestBody->
dmDevice;
6895 agToBeAbortIORequest = &(dmSMPRequestBody->
agIORequest);
6896 agRoot = dmAllShared->agRoot;
6899 SMPFunction = dmSMPRequestBody->
smpPayload[1];
6906 DM_DBG3((
"dmDiscoverySMPTimerCB: SMP function 0x%x\n", SMPFunction));
6925 switch (SMPFunction)
6930 DM_DBG1((
"dmDiscoverySMPTimerCB: failing discovery, SMP function 0x%x !!!\n", SMPFunction));
6934 DM_DBG1((
"dmDiscoverySMPTimerCB: failing discovery, SMP function SMP_REPORT_PHY_SATA !!!\n"));
6939 DM_DBG1((
"dmDiscoverySMPTimerCB: Error, not allowed case!!!\n"));
6950 DM_DBG1((
"dmDiscoverySMPTimerCB: no free SMP, can't abort SMP!!!\n"));
6959 if (dmAbortSMPRequestBody ==
agNULL)
6961 DM_DBG1((
"dmDiscoverySMPTimerCB: dmAbortSMPRequestBody is NULL!!!\n"));
6964 DM_DBG5((
"dmDiscoverySMPTimerCB: SMP id %d\n", dmAbortSMPRequestBody->
id));
6967 dmAbortSMPRequestBody->
dmRoot = dmRoot;
6969 agAbortIORequest = &(dmAbortSMPRequestBody->
agIORequest);
6970 agAbortIORequest->
osData = (
void *) dmAbortSMPRequestBody;
6975 DM_DBG1((
"dmDiscoverySMPTimerCB: calling saSMPAbort!!!\n"));
6981 agToBeAbortIORequest,
7002 DM_DBG3((
"dmSMPBusyTimer: start\n"));
7003 DM_DBG3((
"dmSMPBusyTimer: pid %d\n", onePortContext->
id));
7005 discovery = &(onePortContext->
discovery);
7033 &dmAllShared->timerlist,
7063 DM_DBG3((
"dmSMPBusyTimerCB: start\n"));
7068 agRoot = dmAllShared->agRoot;
7073 discovery = &(onePortContext->
discovery);
7131 DM_DBG3((
"dmSMPBusyTimerCB: retries are over\n"));
7154 dmSMPBusyTimer(dmRoot, onePortContext, oneDeviceData, dmSMPRequestBody);
7173 DM_DBG3((
"dmDiscoveryConfiguringTimer: start\n"));
7174 DM_DBG3((
"dmDiscoveryConfiguringTimer: pid %d\n", onePortContext->
id));
7176 discovery = &(onePortContext->
discovery);
7192 DM_DBG3((
"dmDiscoveryConfiguringTimer: UsecsPerTick %d\n", dmAllShared->usecsPerTick));
7207 &dmAllShared->timerlist,
7230 discovery = &(onePortContext->
discovery);
7232 DM_DBG3((
"dmDiscoveryConfiguringTimerCB: start\n"));
7267 DM_DBG3((
"dmConfigureRouteTimer: start\n"));
7269 DM_DBG3((
"dmConfigureRouteTimer: pid %d\n", onePortContext->
id));
7271 discovery = &(onePortContext->
discovery);
7273 DM_DBG3((
"dmConfigureRouteTimer: onePortContext %p oneExpander %p pdmSMPDiscoverResp %p\n", onePortContext, oneExpander, pdmSMPDiscoverResp));
7275 DM_DBG3((
"dmConfigureRouteTimer: discovery %p \n", discovery));
7279 DM_DBG3((
"dmConfigureRouteTimer: discovery->status %d\n", discovery->
status));
7295 DM_DBG3((
"dmConfigureRouteTimer: UsecsPerTick %d\n", dmAllShared->usecsPerTick));
7298 if (oneExpander->
SAS2 == 0)
7306 (
void *)onePortContext,
7307 (
void *)oneExpander,
7308 (
void *)pdmSMPDiscoverResp
7319 (
void *)onePortContext,
7320 (
void *)oneExpander,
7321 (
void *)pdmSMPDiscover2Resp
7326 &dmAllShared->timerlist,
7351 DM_DBG3((
"dmConfigureRouteTimerCB: start\n"));
7355 if (oneExpander->
SAS2 == 0)
7363 discovery = &(onePortContext->
discovery);
7365 DM_DBG3((
"dmConfigureRouteTimerCB: onePortContext %p oneExpander %p pdmSMPDiscoverResp %p\n", onePortContext, oneExpander, pdmSMPDiscoverResp));
7367 DM_DBG3((
"dmConfigureRouteTimerCB: discovery %p\n", discovery));
7371 DM_DBG3((
"dmConfigureRouteTimerCB: discovery.status %d\n", discovery->
status));
7376 DM_DBG3((
"dmConfigureRouteTimerCB: retries are over\n"));
7400 if (oneExpander->
SAS2 == 0)
7404 DM_DBG3((
"dmConfigureRouteTimerCB: proceed by calling dmDownStreamDiscoverExpanderPhy\n"));
7412 DM_DBG3((
"dmConfigureRouteTimerCB: setting timer again\n"));
7419 (
void *)onePortContext,
7420 (
void *)oneExpander,
7421 (
void *)pdmSMPDiscoverResp
7426 &dmAllShared->timerlist,
7436 DM_DBG2((
"dmConfigureRouteTimerCB: proceed by calling dmDownStreamDiscover2ExpanderPhy\n"));
7443 DM_DBG2((
"dmConfigureRouteTimerCB: setting timer again\n"));
7450 (
void *)onePortContext,
7451 (
void *)oneExpander,
7452 (
void *)pdmSMPDiscover2Resp
7457 &dmAllShared->timerlist,
#define DM_DISCOVERY_OPTION_INCREMENTAL_START
#define DM_DISCOVERY_OPTION_ABORT
#define DM_DISCOVERY_OPTION_FULL_START
osGLOBAL bit32 dmQueryDiscovery(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext)
osGLOBAL bit32 dmRegisterDevice(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext, dmDeviceInfo_t *dmDeviceInfo, agsaDevHandle_t *agDevHandle)
osGLOBAL void dmNotifyBC(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext, bit32 type)
osGLOBAL bit32 dmResetFailedDiscovery(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext)
osGLOBAL bit32 dmDiscover(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext, bit32 option)
#define DEVICE_IS_SATA_DEVICE(DeviceData)
#define DISCOVERY_UP_STREAM
#define SMP_REPORT_PHY_SATA
#define SAS2_DISCRSP_IS_STP_INITIATOR(pResp)
#define DM_DSTATE_STARTED
#define SAS_EDGE_EXPANDER_DEVICE
#define DEVINFO_PUT_FLAG(devInfo, tlr)
#define SAS2_DISCRSP_IS_SMP_INITIATOR(pResp)
#define DEVINFO_GET_SAS_ADDRESSLO(devInfo)
#define DEVINFO_GET_EXT_MCN(devInfo)
#define DEVICE_IS_STP_TARGET(DeviceData)
#define DISCOVERY_CONFIG_ROUTING
#define SAS2_DISCRSP_GET_ATTACHED_SAS_ADDRESSLO(pResp)
#define DISCRSP_IS_SATA_DEVICE(pResp)
#define SAS2_DISCRSP_GET_ROUTINGATTRIB(pResp)
#define DM_DSTATE_COMPLETED
#define DEVINFO_GET_EXT_SMP(devInfo)
#define MIN(a, b)
MIN macro.
#define DISCRSP_GET_ATTACHED_SAS_ADDRESSLO(pResp)
#define DISCRSP_IS_SMP_INITIATOR(pResp)
#define DEVINFO_GET_SAS_ADDRESSHI(devInfo)
#define DM_DSTATE_NOT_STARTED
#define DISCOVERY_REPORT_PHY_SATA
#define DEVINFO_PUT_EXT(devInfo, extension)
#define DISCRSP_GET_ATTACHED_DEVTYPE(pResp)
#define SAS_ROUTING_DIRECT
#define DEVINFO_PUT_SAS_ADDRESSLO(devInfo, src32)
#define DEVINFO_PUT_SMPTO(devInfo, smpto)
#define DISCRSP_IS_STP_INITIATOR(pResp)
#define DEVINFO_PUT_FBS(devInfo, fbs)
#define DEVICE_IS_SMP_TARGET(DeviceData)
#define DEVINFO_PUT_ITNEXUSTO(devInfo, itnexusto)
#define CONFIGURE_ROUTE_TIMER_VALUE
#define DISCRSP_GET_ROUTINGATTRIB(pResp)
#define DISCRSP_IS_SMP_TARGET(pResp)
#define SMP_PHY_CONTROL_HARD_RESET
#define DISCRSP_GET_ATTACHED_SAS_ADDRESSHI(pResp)
#define DISCRSP_IS_SSP_TARGET(pResp)
#define SAS2_DISCRSP_GET_LOGICAL_LINKRATE(pResp)
#define SAS_FANOUT_EXPANDER_DEVICE
#define DISCOVERY_DOWN_STREAM
#define SMP_BUSY_TIMER_VALUE
#define SAS2_DISCRSP_GET_ATTACHED_DEVTYPE(pResp)
#define DISCOVERY_SAS_DONE
#define DEFAULT_SMP_TIMEOUT
#define SAS2_DISCRSP_IS_STP_TARGET(pResp)
#define DISCRSP_IS_SSP_INITIATOR(pResp)
#define SAS2_DISCRSP_IS_SATA_DEVICE(pResp)
#define DM_GET_SAS_ADDRESSLO(sasAddressLo)
#define SMP_CONFIGURE_ROUTING_INFORMATION
#define DISCOVERY_CONFIGURING_TIMER_VALUE
#define DEVINFO_GET_LINKRATE(devInfo)
#define DM_GET_SAS_ADDRESSHI(sasAddressHi)
#define DEVINFO_PUT_DEV_S_RATE(devInfo, dev_s_rate)
#define DEVINFO_GET_EXT_EXPANDER_TYPE(devInfo)
#define SAS_ROUTING_SUBTRACTIVE
#define SAS2_DISCRSP_GET_ATTACHED_SAS_ADDRESSHI(pResp)
#define DEVINFO_PUT_SAS_ADDRESSHI(devInfo, src32)
#define SAS_ROUTING_TABLE
#define SAS2_DISCRSP_GET_LINKRATE(pResp)
#define DEVINFO_PUT_INITIATOR_SSP_STP_SMP(devInfo, ini_ssp_stp_smp)
#define SAS2_DISCRSP_IS_SMP_TARGET(pResp)
#define SAS2_DISCRSP_IS_SSP_TARGET(pResp)
#define SMP_REPORT_GENERAL
#define DM_DSTATE_COMPLETED_WITH_FAILURE
#define DM_MAX_EXPANDER_PHYS
#define DEVINFO_PUT_TARGET_SSP_STP_SMP(devInfo, tgt_ssp_stp_smp)
#define DEVICE_IS_SSP_TARGET(DeviceData)
#define SAS2_DISCRSP_IS_SSP_INITIATOR(pResp)
#define DISCRSP_IS_STP_TARGET(pResp)
#define DISCRSP_GET_LINKRATE(pResp)
#define DMLIST_ENQUEUE_AT_HEAD(toAddHdr, listHdr)
#define DMLIST_DEQUEUE_FROM_HEAD(atHeadHdr, listHdr)
#define DMLIST_EMPTY(listHdr)
#define DMLIST_INIT_HDR(hdr)
#define DMLIST_NOT_EMPTY(listHdr)
#define DMLIST_DEQUEUE_THIS(hdr)
#define DMLIST_OBJECT_BASE(baseType, fieldName, fieldPtr)
#define DMLIST_ENQUEUE_AT_TAIL(toAddHdr, listHdr)
osGLOBAL void dmDiscoverDone(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 flag)
osGLOBAL void * dm_memcpy(void *dst, void *src, bit32 count)
osGLOBAL dmExpander_t * dmDiscoveringExpanderAlloc(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData)
osGLOBAL void dmKillTimer(dmRoot_t *dmRoot, dmTimerRequest_t *timerRequest)
bit32 dmNewEXPorNot(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmSASSubID_t *dmSASSubID)
osGLOBAL void dmUpStreamDiscover2ExpanderPhySkip(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmReportPhySataSend(dmRoot_t *dmRoot, dmDeviceData_t *oneDeviceData, bit8 phyId)
osGLOBAL void dmDownStreamDiscovering(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData)
osGLOBAL void dmSMPAbortCB(agsaRoot_t *agRoot, agsaIORequest_t *agIORequest, bit32 flag, bit32 status)
osGLOBAL void dmSetTimerRequest(dmRoot_t *dmRoot, dmTimerRequest_t *timerRequest, bit32 timeout, dmTimerCBFunc_t CBFunc, void *timerData1, void *timerData2, void *timerData3)
osGLOBAL void dmHandleZoneViolation(dmRoot_t *dmRoot, agsaRoot_t *agRoot, agsaIORequest_t *agIORequest, dmDeviceData_t *oneDeviceData, dmSMPFrameHeader_t *frameHeader, agsaFrameHandle_t frameHandle)
osGLOBAL void dmDiscoveryResetMCN(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmExpanderDownStreamPhyAdd(dmRoot_t *dmRoot, dmExpander_t *oneExpander, bit8 phyId)
osGLOBAL dmExpander_t * dmExpMainListFind(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 sasAddrHi, bit32 sasAddrLo)
osGLOBAL void dmUpStreamDiscovering(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData)
osGLOBAL bit32 dmDiscoverCheck(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
bit32 dmNewSASorNot(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmSASSubID_t *dmSASSubID)
osGLOBAL void dmDumpAllExp(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmSMPBusyTimerCB(dmRoot_t *dmRoot, void *timerData1, void *timerData2, void *timerData3)
osGLOBAL bit32 dmFindDiscoveringExpander(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL bit32 dmSAS2SAS11ErrorCheck(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *topExpander, dmExpander_t *bottomExpander, dmExpander_t *currentExpander)
osGLOBAL void dmDiscoverySMPTimerCB(dmRoot_t *dmRoot, void *timerData1, void *timerData2, void *timerData3)
osGLOBAL void dmConfigureRouteTimer(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander, smpRespDiscover_t *pdmSMPDiscoverResp, smpRespDiscover2_t *pdmSMPDiscover2Resp)
osGLOBAL void dmDownStreamDiscoverStart(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData)
osGLOBAL void dmUpStreamDiscover2ExpanderPhy(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander, smpRespDiscover2_t *pDiscoverResp)
osGLOBAL void dmUpStreamDiscoverExpanderPhy(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander, smpRespDiscover_t *pDiscoverResp)
osGLOBAL void dmDownStreamDiscover2ExpanderPhySkip(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmhexdump(const char *ptitle, bit8 *pbuf, int len)
osGLOBAL void dmDeviceDataReInit(dmRoot_t *dmRoot, dmDeviceData_t *oneDeviceData)
osGLOBAL void dmDiscoveryDumpMCN(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmUpdateMCN(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *AdjacentDeviceData, dmDeviceData_t *oneDeviceData)
osGLOBAL void dmDumpAllMainExp(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDiscoveryErrorRemovals(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDiscoveryDeviceCleanUp(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL dmDeviceData_t * dmPortSASDeviceFind(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 sasAddrLo, bit32 sasAddrHi, dmDeviceData_t *CurrentDeviceData)
osGLOBAL void dmReportRemovals(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 flag)
osGLOBAL void dmBCTimer(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDiscoveryExpanderCleanUp(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmSubReportRemovals(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData, bit32 flag)
osGLOBAL void dmReportChanges(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDiscoverSend(dmRoot_t *dmRoot, dmDeviceData_t *oneDeviceData)
osGLOBAL dmDeviceData_t * dmPortSASDeviceAdd(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, agsaSASIdentify_t sasIdentify, bit32 sasInitiator, bit8 connectionRate, bit32 itNexusTimeout, bit32 firstBurstSize, bit32 deviceType, dmDeviceData_t *oneDeviceData, dmExpander_t *dmExpander, bit8 phyID)
osGLOBAL void dmDownStreamDiscover2ExpanderPhy(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander, smpRespDiscover2_t *pDiscoverResp)
osGLOBAL void dmDiscoveryConfiguringTimer(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData)
osGLOBAL void dmSMPBusyTimer(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData, dmSMPRequestBody_t *dmSMPRequestBody)
osGLOBAL void dmUpStreamDiscoverStart(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDiscoverySMPTimer(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 functionCode, dmSMPRequestBody_t *dmSMPRequestBody)
osGLOBAL void * dm_memset(void *s, int c, bit32 n)
osGLOBAL void dmDumpAllMainDevice(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL bit32 dmDuplicateConfigSASAddr(dmRoot_t *dmRoot, dmExpander_t *oneExpander, bit32 configSASAddressHi, bit32 configSASAddressLo)
osGLOBAL void dmBCTimerCB(dmRoot_t *dmRoot_t, void *timerData1, void *timerData2, void *timerData3)
osGLOBAL void dmAddTimer(dmRoot_t *dmRoot, dmList_t *timerListHdr, dmTimerRequest_t *timerRequest)
osGLOBAL void dmDumpAllFreeExp(dmRoot_t *dmRoot)
osGLOBAL dmDeviceData_t * dmAddSASToSharedcontext(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmSASSubID_t *dmSASSubID, dmDeviceData_t *oneExpDeviceData, bit8 phyID)
osGLOBAL void dmCleanAllExp(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmInternalRemovals(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDownStreamDiscoverExpanderPhySkip(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmDiscoveryInvalidateDevices(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL bit32 dmRoutingEntryAdd(dmRoot_t *dmRoot, dmExpander_t *oneExpander, bit32 phyId, bit32 configSASAddressHi, bit32 configSASAddressLo)
osGLOBAL void dmReportGeneralSend(dmRoot_t *dmRoot, dmDeviceData_t *oneDeviceData)
osGLOBAL void dmExpanderUpStreamPhyAdd(dmRoot_t *dmRoot, dmExpander_t *oneExpander, bit8 phyId)
osGLOBAL bit32 dmFullDiscover(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDiscoveringExpanderRemove(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmResetReported(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmSubReportChanges(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData, bit32 flag)
osGLOBAL void dmDiscoverAbort(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL bit16 dmFindCurrentDownStreamPhyIndex(dmRoot_t *dmRoot, dmExpander_t *oneExpander)
osGLOBAL void dmConfigureRouteTimerCB(dmRoot_t *dmRoot, void *timerData1, void *timerData2, void *timerData3)
osGLOBAL void dmUpStreamDiscoverExpanderPhySkip(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmDumpAllUpExp(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmsaSMPCompleted(agsaRoot_t *agRoot, agsaIORequest_t *agIORequest, bit32 agIOStatus, bit32 agIOInfoLen, agsaFrameHandle_t agFrameHandle)
osGLOBAL dmDeviceData_t * dmDeviceFind(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 sasAddrHi, bit32 sasAddrLo)
osGLOBAL void dmDownStreamDiscoverExpanderPhy(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander, smpRespDiscover_t *pDiscoverResp)
osGLOBAL void dmExpanderDeviceDataReInit(dmRoot_t *dmRoot, dmExpander_t *oneExpander)
osGLOBAL bit32 dmPhyControlSend(dmRoot_t *dmRoot, dmDeviceData_t *oneDeviceData, bit8 phyOp, bit8 phyID)
osGLOBAL dmExpander_t * dmExpFind(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 sasAddrHi, bit32 sasAddrLo)
osGLOBAL dmDeviceData_t * dmFindRegNValid(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmSASSubID_t *dmSASSubID)
osGLOBAL bit32 dmIncrementalDiscover(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, bit32 flag)
osGLOBAL void dmDiscoveryReportMCN(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmDiscoveryConfiguringTimerCB(dmRoot_t *dmRoot, void *timerData1, void *timerData2, void *timerData3)
osGLOBAL void dmDiscoveringUndoAdd(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmDiscoveryResetProcessed(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext)
osGLOBAL void dmUpdateAllAdjacent(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmDeviceData_t *oneDeviceData)
osGLOBAL dmExpander_t * dmFindConfigurableExp(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
osGLOBAL void dmDiscoveringExpanderAdd(dmRoot_t *dmRoot, dmIntPortContext_t *onePortContext, dmExpander_t *oneExpander)
void ostiInitiatorEvent(tiRoot_t *ptiRoot, tiPortalContext_t *ptiPortalContext, tiDeviceHandle_t *ptiDevHandle, tiIntrEventType_t eventType, U32 eventStatus, void *parm)
The file defines the constants, data structure, and functions defined by LL API.
void * agsaFrameHandle_t
handle to access frame
#define OSSA_HW_EVENT_BROADCAST_EXP
#define OSSA_HW_EVENT_BROADCAST_SES
#define AGSA_SMP_INIT_REQ
#define OSSA_HW_EVENT_BROADCAST_CHANGE
#define SA_IDFRM_IS_STP_TARGET(identFrame)
#define SA_IDFRM_IS_SSP_TARGET(identFrame)
#define SA_IDFRM_IS_SMP_TARGET(identFrame)
#define SA_IDFRM_IS_SATA_DEVICE(identFrame)
#define SA_IDFRM_IS_SMP_INITIATOR(identFrame)
#define SA_IDFRM_GET_SAS_ADDRESSLO(identFrame)
#define SA_IDFRM_GET_DEVICETTYPE(identFrame)
#define SA_IDFRM_IS_SSP_INITIATOR(identFrame)
#define SA_IDFRM_GET_SAS_ADDRESSHI(identFrame)
The file defines the declaration of tSDK APIs.
GLOBAL bit32 saSMPAbort(agsaRoot_t *agRoot, agsaIORequest_t *agIORequest, bit32 queueNum, agsaDevHandle_t *agDevHandle, bit32 flag, void *abortParam, ossaGenericAbortCB_t agCB)
Abort SMP request.
GLOBAL void saFrameReadBlock(agsaRoot_t *agRoot, agsaFrameHandle_t agFrame, bit32 frameOffset, void *frameBuffer, bit32 frameBufLen)
Read a block from a frame.
GLOBAL bit32 saSMPStart(agsaRoot_t *agRoot, agsaIORequest_t *agIORequest, bit32 queueNum, agsaDevHandle_t *agDevHandle, bit32 agRequestType, agsaSASRequestBody_t *agRequestBody, ossaSMPCompletedCB_t agCB)
Start SMP request.
The file defines the declaration of OS APIs.
data structure stores OS specific and LL specific context
agsaSASIdentify_t sasIdentify
dmDeviceInfo_t dmDeviceInfo
struct dmExpander_s * dmExpander
struct dmDeviceData_s * ExpDevice
agsaDeviceInfo_t agDeviceInfo
bit8 initiator_ssp_stp_smp
DMSASAddressID_t SASAddressID
struct dmIntPortContext_s * dmPortContext
bit8 initiator_ssp_stp_smp
dmTimerRequest_t discoveryTimer
dmList_t UpdiscoveringExpanderList
bit32 configureRouteRetries
dmTimerRequest_t DiscoverySMPTimer
dmTimerRequest_t configureRouteTimer
dmList_t discoveringExpanderList
struct dmExpander_s * RootExp
DMSASAddressID_t sasAddressIDDiscoverError
dmTimerRequest_t SMPBusyTimer
bit32 configSASAddressLoTable[DM_MAX_DEV]
dmDeviceData_t * dmDeviceToProcess
struct dmExpander_s * dmUpStreamExpander
struct dmExpander_s * dmCurrentDownStreamExpander
bit16 numOfDownStreamPhys
bit32 configSASAddressHiTable[DM_MAX_DEV]
bit8 routingAttribute[DM_MAX_EXPANDER_PHYS]
bit32 UndoDueToTTTSupported
dmDeviceData_t * dmDevice
agsaDevHandle_t * agDevHandle
bit32 upStreamSASAddressLo
bit8 downStreamPhys[DM_MAX_EXPANDER_PHYS]
bit8 currentDownStreamPhyIndex
bit32 configSASAddrTableIndex
bit16 currentUpStreamPhyIndex
bit16 currentIndex[DM_MAX_EXPANDER_PHYS]
bit32 upStreamSASAddressHi
struct dmExpander_s * dmReturnginExpander
bit8 upStreamPhys[DM_MAX_EXPANDER_PHYS]
bit32 DiscoveryAbortInProgress
dmPortContext_t * dmPortContext
dmIntContext_t dmAllShared
bit8 initiator_ssp_stp_smp
dmDeviceData_t * dmDevice
agsaSASRequestBody_t agSASRequestBody
agsaIORequest_t agIORequest
bit8 smpPayload[SMP_DIRECT_PAYLOAD_LIMIT]
bit8 attachedDeviceTypeReason
bit8 attached_Ssp_Stp_Smp_Sata_Initiator
bit8 attachedSasAddressLo[4]
bit8 attachedPhyIdentifier
bit8 attachedSasAddressHi[4]
bit8 attached_SataPS_Ssp_Stp_Smp_Sata_Target
bit8 attachedSasAddressHi[4]
bit8 attached_SataPS_Ssp_Stp_Smp_Sata_Target
bit8 attachedPhyIdentifier
bit8 attachedSasAddressLo[4]
bit8 attached_Ssp_Stp_Smp_Sata_Initiator
osGLOBAL void tddmReportDevice(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext, dmDeviceInfo_t *dmDeviceInfo, dmDeviceInfo_t *dmExpDeviceInfo, bit32 flag)
osGLOBAL void tddmSingleThreadedLeave(dmRoot_t *dmRoot, bit32 syncLockId)
osGLOBAL void tddmDiscoverCB(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext, bit32 eventStatus)
osGLOBAL void tddmQueryDiscoveryCB(dmRoot_t *dmRoot, dmPortContext_t *dmPortContext, bit32 discType, bit32 discState)
osGLOBAL void tddmSingleThreadedEnter(dmRoot_t *dmRoot, bit32 syncLockId)
@ tiIntrEventTypeDeviceChange
@ tiIntrEventTypeDiscovery
union data structure specifies a request