xref: /freebsd/sys/dev/pms/RefTisa/discovery/api/tddmapi.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 *   tmdmapi.h
25 *
26 *   Abstract:   This module contains function prototype of the Discovery
27 *               Module (DM) API callback for initiator.
28 *******************************************************************************/
29 
30 #ifndef TDDMAPI_H
31 
32 #define TDDMAPI_H
33 
34 osGLOBAL void tddmCacheFlush(
35 				dmRoot_t 	*dmRoot,
36 				void 		*tdMemHandle,
37 				void 		*virtPtr,
38 				bit32 		length
39 				);
40 
41 osGLOBAL void tddmCacheInvalidate(
42 				dmRoot_t 	*dmRoot,
43 				void 		*tdMemHandle,
44 				void 		*virtPtr,
45 				bit32 		length
46 				);
47 
48 osGLOBAL void tddmCachePreFlush(
49 				dmRoot_t 	*dmRoot,
50 				void 		*tdMemHandle,
51 				void 		*virtPtr,
52 				bit32 		length
53 				);
54 
55 osGLOBAL void tddmDiscoverCB(
56 				dmRoot_t 		*dmRoot,
57 				dmPortContext_t		*dmPortContext,
58 				bit32			eventStatus
59 				);
60 
61 osGLOBAL void tddmQueryDiscoveryCB(
62 				dmRoot_t 		*dmRoot,
63 				dmPortContext_t		*dmPortContext,
64 				bit32          		discType,
65 				bit32			discState
66 				);
67 
68 osGLOBAL void tddmReportDevice(
69 				dmRoot_t 		*dmRoot,
70 				dmPortContext_t		*dmPortContext,
71 				dmDeviceInfo_t		*dmDeviceInfo,
72                                 dmDeviceInfo_t		*dmExpDeviceInfo,
73 				bit32                   flag
74 				);
75 
76 osGLOBAL bit8 tddmSATADeviceTypeDecode(bit8 * pSignature);
77 
78 osGLOBAL void tddmSingleThreadedEnter(
79 				       dmRoot_t 		*dmRoot,
80 				       bit32    		syncLockId
81 				      );
82 
83 osGLOBAL void tddmSingleThreadedLeave(
84 				       dmRoot_t 		*dmRoot,
85 				       bit32    		syncLockId
86 				      );
87 osGLOBAL bit32 tddmGetTransportParam(
88                         dmRoot_t    *dmRoot,
89                         char        *key,
90                         char        *subkey1,
91                         char        *subkey2,
92                         char        *subkey3,
93                         char        *subkey4,
94                         char        *subkey5,
95                         char        *valueName,
96                         char        *buffer,
97                         bit32       bufferLen,
98                         bit32       *lenReceived
99                         );
100 osGLOBAL bit32
101 tddmRotateQnumber(
102                   dmRoot_t          *dmRoot,
103                   agsaDevHandle_t   *agDevHandle
104                  );
105 #ifndef tddmLogDebugString
106 GLOBAL void tddmLogDebugString(
107                          dmRoot_t     *dmRoot,
108                          bit32        level,
109                          char         *string,
110                          void         *ptr1,
111                          void         *ptr2,
112                          bit32        value1,
113                          bit32        value2
114                          );
115 #endif
116 
117 
118 #endif  /* TDDMAPI_H */
119