xref: /freebsd/sys/dev/pms/freebsd/driver/common/osenv.h (revision 315ee00f)
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 
25 Version Control Information:
26 
27 $RCSfile: osenv.h,v $
28 $Revision: 114125 $
29 
30 Note:  This file defines the working environment of the system.  All
31        defines listed in this file could also be compiler flags.
32        I am listing all the defines (even if used as a compiler flag)
33        so that they can be seen and documented.
34 ***************************************************************************/
35 
36 #ifndef __OSENV_H__
37 #define __OSENV_H__
38 #include <dev/pms/freebsd/driver/common/osstring.h>
39 
40 /*
41 ** Define the protocols to compile with.  Currently, these defines are
42 ** only for this header file and are used further down to define the protocol
43 ** specific environment:
44 **
45 **      #define AG_PROTOCOL_ISCSI
46 **      #define AG_PROTOCOL_FC
47 */
48 
49 /*
50 ** Define the application types:
51 **
52 **      #define INITIATOR_DRIVER
53 **      #define TARGET_DRIVER
54 */
55 
56 /*
57 ** Define the endian-ness of the host CPU using one of the following:
58 **
59 **      #define AG_CPU_LITTLE_ENDIAN
60 **      #define AG_CPU_BIG_ENDIAN
61 */
62 
63 /*
64 ** Define the host CPU word size
65 **
66 **      #define AG_CPU_32_BIT
67 **      #define AG_CPU_64_BIT
68 **
69 */
70 #ifdef CONFIG_IA64
71 #define AG_CPU_64_BIT
72 #else
73 #define AG_CPU_32_BIT
74 #endif
75 
76 /*
77 ** The following allow the code to use defines for word alignment and adding
78 ** to allow for 32bit and 64bit system differences.
79 */
80 #ifdef AG_CPU_32_BIT
81 #define AG_WORD_ALIGN_ADD      3
82 #define AG_WORD_ALIGN_MASK     0xfffffffc
83 #else
84 #define AG_WORD_ALIGN_ADD      7
85 #define AG_WORD_ALIGN_MASK     0xfffffff8
86 #endif
87 
88 /***************************************************************************
89 iSCSI environment - The following is used for compiling the iSCSI
90                      protocol.
91 **************************************************************************/
92 
93 /*
94 ** Define the existence of an external bus swapper using on of the
95 ** following:
96 **
97 **      #define AG_SWAPPING_BUS
98 **      #define AG_NON_SWAPPING_BUS
99 **
100 */
101 
102 /*
103 ** Define the use of cache memory for message system:
104 **
105 **      #define AG_CACHED_MSG_SYSTEM
106 **
107 */
108 /* #define AG_CACHED_MSG_SYSTEM */
109 
110 /***************************************************************************
111 FC environment - The following is used for compiling the FC protocol.
112 **************************************************************************/
113 
114 /*
115 ** Define if an PMC-Sierra card is being used:
116 **
117 **      #define CCFLAGS_PMC_SIERRA_BOARD
118 **
119 */
120 
121 /*
122 ** Define if the TSDK is being used:
123 **
124 **      #define FCLayer_Tsdk
125 **
126 */
127 
128 /*
129 ** The following defines are not changed directly, but use either previous
130 ** defines, or compiler directives.
131 **
132 */
133 #ifdef AG_CPU_LITTLE_ENDIAN
134 #define FC_DMA_LITTLE_ENDIAN
135 #define FC_CPU_LITTLE_ENDIAN
136 #define SA_DMA_LITTLE_ENDIAN
137 #define SA_CPU_LITTLE_ENDIAN
138 #endif
139 
140 #ifdef AG_CPU_BIG_ENDIAN
141 #define FC_DMA_BIG_ENDIAN
142 #define FC_CPU_BIG_ENDIAN
143 #define SA_DMA_BIG_ENDIAN
144 #define SA_CPU_BIG_ENDIAN
145 #endif
146 
147 /* warning: leave this next line as-is.  it is used for FC-Layer testing      */
148 #undef   FC_CHECKMACRO
149 
150 #endif /* __OSENV_H__ */
151