1285809Sscottl/*******************************************************************************
2285809Sscottl**
3285809Sscottl*Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
4285809Sscottl*
5285809Sscottl*Redistribution and use in source and binary forms, with or without modification, are permitted provided
6285809Sscottl*that the following conditions are met:
7285809Sscottl*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
8285809Sscottl*following disclaimer.
9285809Sscottl*2. Redistributions in binary form must reproduce the above copyright notice,
10285809Sscottl*this list of conditions and the following disclaimer in the documentation and/or other materials provided
11285809Sscottl*with the distribution.
12285809Sscottl*
13285809Sscottl*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
14285809Sscottl*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
15285809Sscottl*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16285809Sscottl*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
17285809Sscottl*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
18285809Sscottl*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
19285809Sscottl*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
20285809Sscottl*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
21285809Sscottl**
22285809Sscottl* $FreeBSD$
23285809Sscottl*
24285809Sscottl********************************************************************************/
25285809Sscottl/********************************************************************************
26285809Sscottl*   dmapi.h
27285809Sscottl*
28285809Sscottl*   Abstract:   This module contains function prototype of the Discovery
29285809Sscottl*               Module (DM) API for initiator.
30285809Sscottl*******************************************************************************/
31285809Sscottl
32285809Sscottl#ifndef DMAPI_H
33285809Sscottl#define DMAPI_H
34285809Sscottl
35285809Sscottl#include <dev/pms/RefTisa/discovery/api/dm.h>
36285809Sscottl#include <dev/pms/RefTisa/sallsdk/api/sa.h>
37285809Sscottl
38285809SscottlosGLOBAL bit32  dmCreatePort(
39285809Sscottl       dmRoot_t        *dmRoot,
40285809Sscottl       dmPortContext_t *dmPortContext,
41285809Sscottl       dmPortInfo_t    *dmPortInfo);
42285809Sscottl
43285809SscottlosGLOBAL bit32  dmDestroyPort(
44285809Sscottl       dmRoot_t        *dmRoot,
45285809Sscottl       dmPortContext_t *dmPortContext,
46285809Sscottl       dmPortInfo_t    *dmPortInfo);
47285809Sscottl
48285809SscottlosGLOBAL bit32  dmRegisterDevice(
49285809Sscottl       dmRoot_t        *dmRoot,
50285809Sscottl       dmPortContext_t *dmPortContext,
51285809Sscottl       dmDeviceInfo_t  *dmDeviceInfo,
52285809Sscottl       agsaDevHandle_t *agDevHandle);
53285809Sscottl
54285809SscottlosGLOBAL bit32  dmDiscover(
55285809Sscottl       dmRoot_t        *dmRoot,
56285809Sscottl       dmPortContext_t *dmPortContext,
57285809Sscottl       bit32            option);
58285809Sscottl
59285809SscottlosGLOBAL void dmGetRequirements(
60285809Sscottl       dmRoot_t              *dmRoot,
61285809Sscottl       dmSwConfig_t          *swConfig,
62285809Sscottl       dmMemoryRequirement_t *memoryRequirement,
63285809Sscottl       bit32                 *usecsPerTick,
64285809Sscottl       bit32                 *maxNumLocks);
65285809Sscottl
66285809SscottlosGLOBAL void dmNotifyBC(
67285809Sscottl       dmRoot_t        *dmRoot,
68285809Sscottl       dmPortContext_t *dmPortContext,
69285809Sscottl       bit32            type);
70285809Sscottl
71285809SscottlosGLOBAL bit32  dmQueryDiscovery(
72285809Sscottl       dmRoot_t        *dmRoot,
73285809Sscottl       dmPortContext_t *dmPortContext);
74285809Sscottl
75285809SscottlosGLOBAL bit32
76285809SscottldmResetFailedDiscovery(
77285809Sscottl                 dmRoot_t               *dmRoot,
78285809Sscottl                 dmPortContext_t        *dmPortContext);
79285809Sscottl
80285809SscottlosGLOBAL bit32  dmInitialize(
81285809Sscottl       dmRoot_t             *dmRoot,
82285809Sscottl       agsaRoot_t           *agRoot,
83285809Sscottl       dmMemoryRequirement_t *memoryAllocated,
84285809Sscottl       dmSwConfig_t          *swConfig,
85285809Sscottl       bit32                 usecsPerTick );
86285809Sscottl
87285809SscottlosGLOBAL void   dmTimerTick ( dmRoot_t  *dmRoot );
88285809Sscottl
89285809Sscottl#endif  /* DMAPI_H */
90