xref: /freebsd/sys/dev/pms/RefTisa/sat/api/smapi.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 /*******************************************************************************
2 *Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3 *
4 *Redistribution and use in source and binary forms, with or without modification, are permitted provided
5 *that the following conditions are met:
6 *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7 *following disclaimer.
8 *2. Redistributions in binary form must reproduce the above copyright notice,
9 *this list of conditions and the following disclaimer in the documentation and/or other materials provided
10 *with the distribution.
11 *
12 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17 *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19 *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20 *
21 *
22 ********************************************************************************/
23 /********************************************************************************
24 *   smapi.h
25 *
26 *   Abstract:   This module contains function prototype of the SAT
27 *               Module (SM) API for initiator.
28 *******************************************************************************/
29 
30 #ifndef SMAPI_H
31 #define SMAPI_H
32 
33 #include <dev/pms/RefTisa/sat/api/sm.h>
34 #include <dev/pms/RefTisa/sallsdk/api/sa.h>
35 
36 osGLOBAL bit32
37 smRegisterDevice(
38                  smRoot_t                       *smRoot,
39                  agsaDevHandle_t                *agDevHandle,
40                  smDeviceHandle_t               *smDeviceHandle,
41                  agsaDevHandle_t                *agExpDevHandle,
42                  bit32                          phyID,
43                  bit32                          DeviceType
44                 );
45 
46 osGLOBAL bit32
47 smDeregisterDevice(
48                    smRoot_t                     *smRoot,
49                    agsaDevHandle_t              *agDevHandle,
50                    smDeviceHandle_t             *smDeviceHandle
51                   );
52 
53 osGLOBAL void
54 smGetRequirements(
55                   smRoot_t                      *smRoot,
56                   smSwConfig_t                  *swConfig,
57                   smMemoryRequirement_t         *memoryRequirement,
58                   bit32                         *usecsPerTick,
59                   bit32                         *maxNumLocks
60                  );
61 
62 osGLOBAL bit32
63 smIDStart(
64           smRoot_t                     *smRoot,
65           smIORequest_t                *smIORequest,
66           smDeviceHandle_t             *smDeviceHandle
67          );
68 
69 osGLOBAL bit32
70 smInitialize(
71              smRoot_t                           *smRoot,
72              agsaRoot_t                         *agRoot,
73              smMemoryRequirement_t              *memoryAllocated,
74              smSwConfig_t                       *swConfig,
75              bit32                              usecsPerTick
76             );
77 
78 osGLOBAL bit32
79 smIOAbort(
80            smRoot_t                     *smRoot,
81            smIORequest_t                *tasktag
82          );
83 
84 osGLOBAL bit32
85 smIOAbortAll(
86              smRoot_t                     *smRoot,
87              smDeviceHandle_t             *smDeviceHandle
88             );
89 
90 osGLOBAL FORCEINLINE bit32
91 smIOStart(
92           smRoot_t                      *smRoot,
93           smIORequest_t                 *smIORequest,
94           smDeviceHandle_t              *smDeviceHandle,
95           smScsiInitiatorRequest_t      *smSCSIRequest,
96           bit32                         interruptContext
97          );
98 
99 osGLOBAL bit32
100 smSuperIOStart(
101                smRoot_t                         *smRoot,
102                smIORequest_t                    *smIORequest,
103                smDeviceHandle_t                 *smDeviceHandle,
104                smSuperScsiInitiatorRequest_t    *smSCSIRequest,
105                bit32                            AddrHi,
106                bit32                            AddrLo,
107                bit32                            interruptContext
108               );
109 
110 osGLOBAL bit32
111 smTaskManagement(
112                  smRoot_t                       *smRoot,
113                  smDeviceHandle_t               *smDeviceHandle,
114                  bit32                          task,
115                  smLUN_t                        *lun,
116                  smIORequest_t                  *taskTag,
117                  smIORequest_t                  *currentTaskTag
118                 );
119 
120 #endif  /* SMAPI_H */
121 
122