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