FreeBSD kernel pms device code
tdsmapi.h
Go to the documentation of this file.
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* $FreeBSD$
22*
23********************************************************************************/
24/********************************************************************************
25* tmsmapi.h
26*
27* Abstract: This module contains function prototype of the SAT
28* Module (SM) API callback for initiator.
29*******************************************************************************/
30
31#ifndef TDSMAPI_H
32#define TDSMAPI_H
33
34osGLOBAL void
36 smRoot_t *smRoot,
37 smIORequest_t *smIORequest,
38 smDeviceHandle_t *smDeviceHandle,
40 void *IDdata
41 );
42
45 smRoot_t *smRoot,
46 smIORequest_t *smIORequest,
48 bit32 statusDetail,
49 smSenseData_t *senseData,
50 bit32 interruptContext
51 );
52osGLOBAL void
54 smRoot_t *smRoot,
55 smDeviceHandle_t *smDeviceHandle,
56 smIntrEventType_t eventType,
57 bit32 eventStatus,
58 void *parm
59 );
60
63 smRoot_t *smRoot,
64 bit32 syncLockId
65 );
66
69 smRoot_t *smRoot,
70 bit32 syncLockId
71 );
72
75 smRoot_t *smRoot,
76 bit32 *Index,
77 bit32 Mask
78 );
79
80#ifdef LINUX_VERSION_CODE
81
84 smRoot_t *smRoot,
85 sbit32 volatile *Addend
86 );
87
90 smRoot_t *smRoot,
91 sbit32 volatile *Addend
92 );
93
95tdsmAtomicBitClear(
96 smRoot_t *smRoot,
97 sbit32 volatile *Destination,
98 sbit32 Value
99 );
100
102tdsmAtomicBitSet(
103 smRoot_t *smRoot,
104 sbit32 volatile *Destination,
105 sbit32 Value
106 );
107
109tdsmAtomicExchange(
110 smRoot_t *smRoot,
111 sbit32 volatile *Target,
112 sbit32 Value
113 );
114#else
115
118 smRoot_t *smRoot,
119 sbit32 volatile *Addend
120 );
121
124 smRoot_t *smRoot,
125 sbit32 volatile *Addend
126 );
127
130 smRoot_t *smRoot,
131 sbit32 volatile *Destination,
132 sbit32 Value
133 );
134
137 smRoot_t *smRoot,
138 sbit32 volatile *Destination,
139 sbit32 Value
140 );
141
144 smRoot_t *smRoot,
145 sbit32 volatile *Target,
146 sbit32 Value
147 );
148
149#endif /*LINUX_VERSION_CODE*/
150
153 smRoot_t *smRoot,
154 void **osMemHandle,
155 void ** virtPtr,
156 bit32 * physAddrUpper,
157 bit32 * physAddrLower,
158 bit32 alignment,
159 bit32 allocLength,
160 smBOOLEAN isCacheable
161 );
162
165 smRoot_t *smRoot,
166 void *osDMAHandle,
167 bit32 allocLength
168 );
169
172 smDeviceHandle_t *smDeviceHandle
173 );
174
177 smIORequest_t *smIORequest,
178 bit32 QueueDepth
179 );
180
181
182#ifndef tdsmLogDebugString
184 smRoot_t *smRoot,
185 bit32 level,
186 char *string,
187 void *ptr1,
188 void *ptr2,
189 bit32 value1,
190 bit32 value2
191 );
192#endif
193
194
195
197 smRoot_t *smRoot,
198 char *key,
199 char *subkey1,
200 char *subkey2,
201 char *subkey3,
202 char *subkey4,
203 char *subkey5,
204 char *valueName,
205 char *buffer,
206 bit32 bufferLen,
207 bit32 *lenReceived
208 );
209
210#endif /* TDSMAPI_H */
211
bit32 status
Definition: encrypt_ioctl.h:12
#define osGLOBAL
Definition: ostypes.h:147
int sbit32
Definition: ostypes.h:102
#define GLOBAL
Definition: ostypes.h:131
unsigned int bit32
Definition: ostypes.h:99
#define FORCEINLINE
Definition: ostypes.h:86
unsigned char bit8
Definition: ostypes.h:97
#define smBOOLEAN
Definition: sm.h:280
smIntrEventType_t
Definition: sm.h:108
osGLOBAL FORCEINLINE bit32 tdsmRotateQnumber(smRoot_t *smRoot, smDeviceHandle_t *smDeviceHandle)
osGLOBAL bit32 tdsmFreeMemory(smRoot_t *smRoot, void *osDMAHandle, bit32 allocLength)
osGLOBAL FORCEINLINE sbit32 tdsmInterlockedIncrement(smRoot_t *smRoot, sbit32 volatile *Addend)
osGLOBAL FORCEINLINE bit8 tdsmBitScanForward(smRoot_t *smRoot, bit32 *Index, bit32 Mask)
osGLOBAL bit32 tdsmGetTransportParam(smRoot_t *smRoot, char *key, char *subkey1, char *subkey2, char *subkey3, char *subkey4, char *subkey5, char *valueName, char *buffer, bit32 bufferLen, bit32 *lenReceived)
osGLOBAL FORCEINLINE sbit32 tdsmInterlockedExchange(smRoot_t *smRoot, sbit32 volatile *Target, sbit32 Value)
GLOBAL void tdsmLogDebugString(smRoot_t *smRoot, bit32 level, char *string, void *ptr1, void *ptr2, bit32 value1, bit32 value2)
osGLOBAL void tdsmEventCB(smRoot_t *smRoot, smDeviceHandle_t *smDeviceHandle, smIntrEventType_t eventType, bit32 eventStatus, void *parm)
osGLOBAL void tdsmIDCompletedCB(smRoot_t *smRoot, smIORequest_t *smIORequest, smDeviceHandle_t *smDeviceHandle, bit32 status, void *IDdata)
osGLOBAL FORCEINLINE sbit32 tdsmInterlockedDecrement(smRoot_t *smRoot, sbit32 volatile *Addend)
osGLOBAL FORCEINLINE sbit32 tdsmInterlockedAnd(smRoot_t *smRoot, sbit32 volatile *Destination, sbit32 Value)
osGLOBAL bit32 tdsmSetDeviceQueueDepth(smRoot_t *smRoot, smIORequest_t *smIORequest, bit32 QueueDepth)
osGLOBAL FORCEINLINE void tdsmSingleThreadedEnter(smRoot_t *smRoot, bit32 syncLockId)
osGLOBAL FORCEINLINE void tdsmIOCompletedCB(smRoot_t *smRoot, smIORequest_t *smIORequest, bit32 status, bit32 statusDetail, smSenseData_t *senseData, bit32 interruptContext)
osGLOBAL FORCEINLINE void tdsmSingleThreadedLeave(smRoot_t *smRoot, bit32 syncLockId)
osGLOBAL FORCEINLINE sbit32 tdsmInterlockedOr(smRoot_t *smRoot, sbit32 volatile *Destination, sbit32 Value)
osGLOBAL bit32 tdsmAllocMemory(smRoot_t *smRoot, void **osMemHandle, void **virtPtr, bit32 *physAddrUpper, bit32 *physAddrLower, bit32 alignment, bit32 allocLength, smBOOLEAN isCacheable)