1 /*******************************************************************************
3 *Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
5 *Redistribution and use in source and binary forms, with or without modification, are permitted provided
6 *that the following conditions are met:
7 *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
9 *2. Redistributions in binary form must reproduce the above copyright notice,
10 *this list of conditions and the following disclaimer in the documentation and/or other materials provided
11 *with the distribution.
13 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15 *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
18 *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
19 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
20 *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
24 ********************************************************************************/
28 #include <dev/pms/RefTisa/discovery/dm/dmtypes.h>
30 /***************** util ****************************************/
32 *dm_memset(void *s, int c, bit32 n);
35 *dm_memcpy(void *dst, void *src, bit32 count);
38 dmhexdump(const char *ptitle, bit8 *pbuf, int len);
49 dmTimerRequest_t *timerRequest
55 dmTimerRequest_t *timerRequest,
57 dmTimerCBFunc_t CBFunc,
66 dmList_t *timerListHdr,
67 dmTimerRequest_t *timerRequest
73 dmTimerRequest_t *timerRequest
91 dmIntPortContext_t *onePortContext
102 dmDeviceData_t *oneDeviceData
106 dmExpanderDeviceDataInit(
112 dmExpanderDeviceDataReInit(
114 dmExpander_t *oneExpander
127 dmIntPortContext_t *onePortContext
132 dmIntPortContext_t *onePortContext
139 dmIntPortContext_t *onePortContext
143 dmIncrementalDiscover(
145 dmIntPortContext_t *onePortContext,
149 osGLOBAL dmExpander_t *
150 dmDiscoveringExpanderAlloc(
152 dmIntPortContext_t *onePortContext,
153 dmDeviceData_t *oneDeviceData
156 dmDiscoveringExpanderAdd(
158 dmIntPortContext_t *onePortContext,
159 dmExpander_t *oneExpander
163 dmDiscoveringExpanderRemove(
165 dmIntPortContext_t *onePortContext,
166 dmExpander_t *oneExpander
169 osGLOBAL dmExpander_t *
172 dmIntPortContext_t *onePortContext,
177 osGLOBAL dmExpander_t *
180 dmIntPortContext_t *onePortContext,
185 osGLOBAL dmDeviceData_t *
188 dmIntPortContext_t *onePortContext,
194 dmUpStreamDiscoverStart(
196 dmIntPortContext_t *onePortContext
200 dmUpStreamDiscovering(
202 dmIntPortContext_t *onePortContext,
203 dmDeviceData_t *oneDeviceData
207 dmDownStreamDiscovering(
209 dmIntPortContext_t *onePortContext,
210 dmDeviceData_t *oneDeviceData
214 dmDownStreamDiscoverStart(
216 dmIntPortContext_t *onePortContext,
217 dmDeviceData_t *oneDeviceData
223 dmIntPortContext_t *onePortContext
229 dmIntPortContext_t *onePortContext
232 dmDiscoveryResetProcessed(
234 dmIntPortContext_t *onePortContext
240 dmIntPortContext_t *onePortContext,
245 dmUpStreamDiscoverExpanderPhy(
247 dmIntPortContext_t *onePortContext,
248 dmExpander_t *oneExpander,
249 smpRespDiscover_t *pDiscoverResp
253 dmUpStreamDiscover2ExpanderPhy(
255 dmIntPortContext_t *onePortContext,
256 dmExpander_t *oneExpander,
257 smpRespDiscover2_t *pDiscoverResp
261 dmDownStreamDiscoverExpanderPhy(
263 dmIntPortContext_t *onePortContext,
264 dmExpander_t *oneExpander,
265 smpRespDiscover_t *pDiscoverResp
268 dmDownStreamDiscover2ExpanderPhy(
270 dmIntPortContext_t *onePortContext,
271 dmExpander_t *oneExpander,
272 smpRespDiscover2_t *pDiscoverResp
276 dmUpStreamDiscoverExpanderPhySkip(
278 dmIntPortContext_t *onePortContext,
279 dmExpander_t *oneExpander
283 dmUpStreamDiscover2ExpanderPhySkip(
285 dmIntPortContext_t *onePortContext,
286 dmExpander_t *oneExpander
290 dmDownStreamDiscoverExpanderPhySkip(
292 dmIntPortContext_t *onePortContext,
293 dmExpander_t *oneExpander
296 dmDownStreamDiscover2ExpanderPhySkip(
298 dmIntPortContext_t *onePortContext,
299 dmExpander_t *oneExpander
303 dmDiscoveringUndoAdd(
305 dmIntPortContext_t *onePortContext,
306 dmExpander_t *oneExpander
311 dmExpanderUpStreamPhyAdd(
313 dmExpander_t *oneExpander,
318 dmExpanderDownStreamPhyAdd(
320 dmExpander_t *oneExpander,
324 osGLOBAL dmDeviceData_t *
327 dmIntPortContext_t *onePortContext,
330 dmDeviceData_t *CurrentDeviceData
335 dmIntPortContext_t *onePortContext,
336 dmSASSubID_t *dmSASSubID
342 dmIntPortContext_t *onePortContext,
343 dmSASSubID_t *dmSASSubID
346 osGLOBAL dmDeviceData_t *
349 dmIntPortContext_t *onePortContext,
350 agsaSASIdentify_t sasIdentify,
353 bit32 itNexusTimeout,
354 bit32 firstBurstSize,
356 dmDeviceData_t *oneDeviceData,
357 dmExpander_t *dmExpander,
362 osGLOBAL dmDeviceData_t *
365 dmIntPortContext_t *onePortContext,
366 dmSASSubID_t *dmSASSubID
369 osGLOBAL dmExpander_t *
370 dmFindConfigurableExp(
372 dmIntPortContext_t *onePortContext,
373 dmExpander_t *oneExpander
377 dmDuplicateConfigSASAddr(
379 dmExpander_t *oneExpander,
380 bit32 configSASAddressHi,
381 bit32 configSASAddressLo
386 dmFindCurrentDownStreamPhyIndex(
388 dmExpander_t *oneExpander
393 dmFindDiscoveringExpander(
395 dmIntPortContext_t *onePortContext,
396 dmExpander_t *oneExpander
402 dmIntPortContext_t *onePortContext,
403 dmExpander_t *oneExpander
410 dmIntPortContext_t *onePortContext,
411 dmExpander_t *oneExpander
422 dmIntPortContext_t *onePortContext
428 dmIntPortContext_t *onePortContext
434 dmIntPortContext_t *onePortContext,
435 dmDeviceData_t *oneDeviceData,
441 dmIntPortContext_t *onePortContext,
442 dmDeviceData_t *oneDeviceData,
449 dmIntPortContext_t *onePortContext
455 dmIntPortContext_t *onePortContext,
460 dmDiscoveryDeviceCleanUp(
462 dmIntPortContext_t *onePortContext
465 dmDiscoveryExpanderCleanUp(
467 dmIntPortContext_t *onePortContext
473 dmIntPortContext_t *onePortContext
477 dmDiscoveryErrorRemovals(
479 dmIntPortContext_t *onePortContext
482 dmDiscoveryInvalidateDevices(
484 dmIntPortContext_t *onePortContext
487 osGLOBAL dmDeviceData_t *
488 dmAddSASToSharedcontext(
490 dmIntPortContext_t *onePortContext,
491 dmSASSubID_t *dmSASSubID,
492 dmDeviceData_t *oneExpDeviceData,
496 dmSAS2SAS11ErrorCheck(
498 dmIntPortContext_t *onePortContext,
499 dmExpander_t *topExpander,
500 dmExpander_t *bottomExpander,
501 dmExpander_t *currentExpander
507 dmIntPortContext_t *onePortContext,
508 dmDeviceData_t *AdjacentDeviceData, /* adjacent expander */
509 dmDeviceData_t *oneDeviceData /* current one */
515 dmIntPortContext_t *onePortContext,
516 dmDeviceData_t *oneDeviceData /* current one */
521 dmIntPortContext_t *onePortContext
527 dmIntPortContext_t *onePortContext
531 dmDiscoveryReportMCN(
533 dmIntPortContext_t *onePortContext
536 GLOBAL void dmSetDeviceInfoCB(
538 agsaContext_t *agContext,
539 agsaDevHandle_t *agDevHandle,
545 /*********************************** SMP-related *******************************************************/
549 agsaIORequest_t *agIORequest,
552 agsaFrameHandle_t agFrameHandle
559 dmDeviceData_t *oneDeviceData,
569 dmDeviceData_t *oneDeviceData
573 dmReportGeneralRespRcvd(
576 agsaIORequest_t *agIORequest,
577 dmDeviceData_t *oneDeviceData,
578 dmSMPFrameHeader_t *frameHeader,
579 agsaFrameHandle_t frameHandle
583 dmReportGeneral2RespRcvd(
586 agsaIORequest_t *agIORequest,
587 dmDeviceData_t *oneDeviceData,
588 dmSMPFrameHeader_t *frameHeader,
589 agsaFrameHandle_t frameHandle
595 dmDeviceData_t *oneDeviceData
602 agsaIORequest_t *agIORequest,
603 dmDeviceData_t *oneDeviceData,
604 dmSMPFrameHeader_t *frameHeader,
605 agsaFrameHandle_t frameHandle
612 agsaIORequest_t *agIORequest,
613 dmDeviceData_t *oneDeviceData,
614 dmSMPFrameHeader_t *frameHeader,
615 agsaFrameHandle_t frameHandle
622 dmDeviceData_t *oneDeviceData
626 dmDiscoverList2RespRcvd(
629 dmDeviceData_t *oneDeviceData,
630 dmSMPFrameHeader_t *frameHeader,
631 agsaFrameHandle_t frameHandle
638 dmDeviceData_t *oneDeviceData,
646 agsaIORequest_t *agIORequest,
647 dmDeviceData_t *oneDeviceData,
648 dmSMPFrameHeader_t *frameHeader,
649 agsaFrameHandle_t frameHandle
653 dmReportPhySata2Rcvd(
656 agsaIORequest_t *agIORequest,
657 dmDeviceData_t *oneDeviceData,
658 dmSMPFrameHeader_t *frameHeader,
659 agsaFrameHandle_t frameHandle
665 dmExpander_t *oneExpander,
667 bit32 configSASAddressHi,
668 bit32 configSASAddressLo
672 dmConfigRoutingInfoRespRcvd(
675 agsaIORequest_t *agIORequest,
676 dmDeviceData_t *oneDeviceData,
677 dmSMPFrameHeader_t *frameHeader,
678 agsaFrameHandle_t frameHandle
682 dmConfigRoutingInfo2RespRcvd(
685 agsaIORequest_t *agIORequest,
686 dmDeviceData_t *oneDeviceData,
687 dmSMPFrameHeader_t *frameHeader,
688 agsaFrameHandle_t frameHandle
694 dmDeviceData_t *oneDeviceData,
700 dmPhyControlRespRcvd(
703 agsaIORequest_t *agIORequest,
704 dmDeviceData_t *oneDeviceData,
705 dmSMPFrameHeader_t *frameHeader,
706 agsaFrameHandle_t frameHandle
710 dmPhyControl2RespRcvd(
713 agsaIORequest_t *agIORequest,
714 dmDeviceData_t *oneDeviceData,
715 dmSMPFrameHeader_t *frameHeader,
716 agsaFrameHandle_t frameHandle
720 dmPhyControlFailureRespRcvd(
723 dmDeviceData_t *oneDeviceData,
724 dmSMPFrameHeader_t *frameHeader,
725 agsaFrameHandle_t frameHandle
729 dmHandleZoneViolation(
732 agsaIORequest_t *agIORequest,
733 dmDeviceData_t *oneDeviceData,
734 dmSMPFrameHeader_t *frameHeader,
735 agsaFrameHandle_t frameHandle
741 agsaIORequest_t *agIORequest,
744 agsaFrameHandle_t agFrameHandle
750 agsaIORequest_t *agIORequest,
758 dmIntPortContext_t *onePortContext
769 /*********************************** SMP-related *******************************************************/
771 dmDiscoverySMPTimer(dmRoot_t *dmRoot,
772 dmIntPortContext_t *onePortContext,
774 dmSMPRequestBody_t *dmSMPRequestBody
778 dmDiscoverySMPTimerCB(
786 dmDiscoveryConfiguringTimer(dmRoot_t *dmRoot,
787 dmIntPortContext_t *onePortContext,
788 dmDeviceData_t *oneDeviceData
793 dmDiscoveryConfiguringTimerCB(
801 dmSMPBusyTimer(dmRoot_t *dmRoot,
802 dmIntPortContext_t *onePortContext,
803 dmDeviceData_t *oneDeviceData,
804 dmSMPRequestBody_t *dmSMPRequestBody
816 dmConfigureRouteTimer(dmRoot_t *dmRoot,
817 dmIntPortContext_t *onePortContext,
818 dmExpander_t *oneExpander,
819 smpRespDiscover_t *pdmSMPDiscoverResp,
820 smpRespDiscover2_t *pdmSMPDiscover2Resp
824 dmConfigureRouteTimerCB(
831 #endif /* __DMPROTO_H__ */