• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2 **+-----------------------------------------------------------------------+**
3 **|                                                                       |**
4 **| Copyright(c) 1998 - 2008 Texas Instruments. All rights reserved.      |**
5 **| All rights reserved.                                                  |**
6 **|                                                                       |**
7 **| Redistribution and use in source and binary forms, with or without    |**
8 **| modification, are permitted provided that the following conditions    |**
9 **| are met:                                                              |**
10 **|                                                                       |**
11 **|  * Redistributions of source code must retain the above copyright     |**
12 **|    notice, this list of conditions and the following disclaimer.      |**
13 **|  * Redistributions in binary form must reproduce the above copyright  |**
14 **|    notice, this list of conditions and the following disclaimer in    |**
15 **|    the documentation and/or other materials provided with the         |**
16 **|    distribution.                                                      |**
17 **|  * Neither the name Texas Instruments nor the names of its            |**
18 **|    contributors may be used to endorse or promote products derived    |**
19 **|    from this software without specific prior written permission.      |**
20 **|                                                                       |**
21 **| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS   |**
22 **| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT     |**
23 **| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |**
24 **| A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT  |**
25 **| OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |**
26 **| SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT      |**
27 **| LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |**
28 **| DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |**
29 **| THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT   |**
30 **| (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |**
31 **| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  |**
32 **|                                                                       |**
33 **+-----------------------------------------------------------------------+**
34 ****************************************************************************/
35 
36 /** \file public_types.h
37  *  \brief Basic types and general macros, bit manipulations, etc.
38  *
39  */
40 
41 #ifndef PUBLIC_TYPES_H
42 #define PUBLIC_TYPES_H
43 
44 
45 /******************************************************************************
46 
47     Basic definitions
48 
49 ******************************************************************************/
50 #ifndef uint8
51 typedef unsigned char   uint8;
52 #endif
53 #ifndef uint16
54 typedef unsigned short  uint16;
55 #endif
56 #ifndef uint32
57 typedef unsigned long int    uint32;
58 #endif
59 
60 #ifndef int8
61 typedef signed char     int8;
62 #endif
63 #ifndef int16
64 typedef short           int16;
65 #endif
66 #ifndef int32
67 typedef long int        int32;
68 #endif
69 
70 #ifndef TRUE
71 #define TRUE  1
72 #endif
73 #ifndef FALSE
74 #define FALSE 0
75 #endif
76 
77 /* !! LAC - NULL definition conflicts with the compilers version.
78    I redid this definition to the ANSI version....
79     #define NULL 0
80 */
81 #if !defined( NULL )
82 #if defined( __cplusplus )
83 #define NULL 0
84 #else
85 #define NULL ((void *)0)
86 #endif
87 #endif
88 
89 /* Bool_e should be used when we need it to be a byte. */
90 typedef uint8           Bool_e;
91 
92 /* Bool32 should be used whenever possible for efficiency */
93 typedef uint32          Bool32;
94 
95 /* to align enum to 32/16 bits */
96 #define MAX_POSITIVE32 0x7FFFFFFF
97 #define MAX_POSITIVE16 0x7FFF
98 
99 
100 #define MAC_ADDR_SIZE 6
101 
102 #ifndef HOST_COMPILE
103 #define HOST_COMPILE	/* temp fix for suppl build err */
104 #endif
105 
106 #ifdef HOST_COMPILE
107 #else
108 typedef struct macAddress_t
109 {
110     uint8 addr[MAC_ADDR_SIZE];
111 }macAddress_t;
112 #endif
113 
114 
115 #define  BIT_0    0x00000001
116 #define  BIT_1    0x00000002
117 #define  BIT_2    0x00000004
118 #define  BIT_3    0x00000008
119 #define  BIT_4    0x00000010
120 #define  BIT_5    0x00000020
121 #define  BIT_6    0x00000040
122 #define  BIT_7    0x00000080
123 #define  BIT_8    0x00000100
124 #define  BIT_9    0x00000200
125 #define  BIT_10   0x00000400
126 #define  BIT_11   0x00000800
127 #define  BIT_12   0x00001000
128 #define  BIT_13   0x00002000
129 #define  BIT_14   0x00004000
130 #define  BIT_15   0x00008000
131 #define  BIT_16   0x00010000
132 #define  BIT_17   0x00020000
133 #define  BIT_18   0x00040000
134 #define  BIT_19   0x00080000
135 #define  BIT_20   0x00100000
136 #define  BIT_21   0x00200000
137 #define  BIT_22   0x00400000
138 #define  BIT_23   0x00800000
139 #define  BIT_24   0x01000000
140 #define  BIT_25   0x02000000
141 #define  BIT_26   0x04000000
142 #define  BIT_27   0x08000000
143 #define  BIT_28   0x10000000
144 #define  BIT_29   0x20000000
145 #define  BIT_30   0x40000000
146 #define  BIT_31   0x80000000
147 
148 #define  BIT_32   0x00000001
149 #define  BIT_33   0x00000002
150 #define  BIT_34   0x00000004
151 #define  BIT_35   0x00000008
152 #define  BIT_36   0x00000010
153 #define  BIT_37   0x00000020
154 #define  BIT_38   0x00000040
155 #define  BIT_39   0x00000080
156 #define  BIT_40   0x00000100
157 #define  BIT_41   0x00000200
158 #define  BIT_42   0x00000400
159 #define  BIT_43   0x00000800
160 #define  BIT_44   0x00001000
161 #define  BIT_45   0x00002000
162 #define  BIT_46   0x00004000
163 #define  BIT_47   0x00008000
164 #define  BIT_48   0x00010000
165 #define  BIT_49   0x00020000
166 #define  BIT_50   0x00040000
167 #define  BIT_51   0x00080000
168 #define  BIT_52   0x00100000
169 #define  BIT_53   0x00200000
170 #define  BIT_54   0x00400000
171 #define  BIT_55   0x00800000
172 #define  BIT_56   0x01000000
173 #define  BIT_57   0x02000000
174 #define  BIT_58   0x04000000
175 #define  BIT_59   0x08000000
176 #define  BIT_60   0x10000000
177 #define  BIT_61   0x20000000
178 #define  BIT_62   0x40000000
179 #define  BIT_63   0x80000000
180 
181 
182 /******************************************************************************
183 
184     CHANNELS, BAND & REG DOMAINS definitions
185 
186 ******************************************************************************/
187 
188 
189 typedef uint8 Channel_e;
190 
191 typedef enum
192 {
193     RADIO_BAND_2_4GHZ = 0,  /* 2.4 Ghz band */
194     RADIO_BAND_5GHZ = 1,    /* 5 Ghz band */
195     RADIO_BAND_JAPAN_4_9_GHZ = 2,
196     DEFAULT_BAND = RADIO_BAND_2_4GHZ,
197     INVALID_BAND = 0xFE,
198     MAX_RADIO_BANDS = 0xFF
199 } RadioBand_enum;
200 
201 #ifdef HOST_COMPILE
202 typedef uint8 RadioBand_e;
203 #else
204 typedef RadioBand_enum RadioBand_e;
205 #endif
206 
207 
208 typedef enum
209 {
210     NO_RATE      = 0,
211     RATE_1MBPS   = 0x0A,
212     RATE_2MBPS   = 0x14,
213     RATE_5_5MBPS = 0x37,
214     RATE_6MBPS   = 0x0B,
215     RATE_9MBPS   = 0x0F,
216     RATE_11MBPS  = 0x6E,
217     RATE_12MBPS  = 0x0A,
218     RATE_18MBPS  = 0x0E,
219     RATE_22MBPS  = 0xDC,
220     RATE_24MBPS  = 0x09,
221     RATE_36MBPS  = 0x0D,
222     RATE_48MBPS  = 0x08,
223     RATE_54MBPS  = 0x0C
224 } Rate_enum;
225 
226 #ifdef HOST_COMPILE
227 typedef uint8 Rate_e;
228 #else
229 typedef Rate_enum Rate_e;
230 #endif
231 
232 typedef enum
233 {
234 	RATE_INDEX_1MBPS   =  0,
235 	RATE_INDEX_2MBPS   =  1,
236 	RATE_INDEX_5_5MBPS =  2,
237 	RATE_INDEX_6MBPS   =  3,
238 	RATE_INDEX_9MBPS   =  4,
239 	RATE_INDEX_11MBPS  =  5,
240 	RATE_INDEX_12MBPS  =  6,
241 	RATE_INDEX_18MBPS  =  7,
242 	RATE_INDEX_22MBPS  =  8,
243 	RATE_INDEX_24MBPS  =  9,
244 	RATE_INDEX_36MBPS  =  10,
245 	RATE_INDEX_48MBPS  =  11,
246 	RATE_INDEX_54MBPS  =  12,
247 	RATE_INDEX_MAX     =  RATE_INDEX_54MBPS,
248 	MAX_RATE_INDEX,
249 	INVALID_RATE_INDEX = MAX_RATE_INDEX,
250 	RATE_INDEX_ENUM_MAX_SIZE = 0x7FFFFFFF
251 } RateIndex_e;
252 
253 #define SHORT_PREAMBLE_BIT   BIT_0 /* CCK or Barker depending on the rate */
254 #define OFDM_RATE_BIT        BIT_6
255 #define PBCC_RATE_BIT        BIT_7
256 
257 
258 typedef enum
259 {
260     CCK_LONG = 0,
261     CCK_SHORT = SHORT_PREAMBLE_BIT,
262     PBCC_LONG = PBCC_RATE_BIT,
263     PBCC_SHORT = PBCC_RATE_BIT | SHORT_PREAMBLE_BIT,
264     OFDM = OFDM_RATE_BIT
265 } Mod_enum;
266 
267 #ifdef HOST_COMPILE
268 typedef  uint8 Mod_e;
269 #else
270 typedef  Mod_enum Mod_e;
271 #endif
272 
273 
274 typedef uint16 BasicRateSet_t;
275 
276 
277 /******************************************************************************
278 
279 Transmit-Descriptor RATE-SET field definitions...
280 
281 Define a new "Rate-Set" for TX path that incorporates the
282 Rate & Modulation info into a single 16-bit field.
283 
284 TxdRateSet_t:
285   b15    - Indicates Preamble type (1=SHORT, 0=LONG).
286            Notes:
287              Must be LONG (0) for 1Mbps rate.
288              Does not apply (set to 0) for RevG-OFDM rates.
289   b14    - Indicates PBCC encoding (1=PBCC, 0=not).
290            Notes:
291              Does not apply (set to 0) for rates 1 and 2 Mbps.
292              Does not apply (set to 0) for RevG-OFDM rates.
293   b13    - Unused (set to 0).
294   b12-b0 - Supported Rate indicator bits as defined below.
295 
296 ******************************************************************************/
297 
298 typedef uint16 TxdRateSet_t;
299 
300 
301 /******************************************************************************
302 
303     CHIP_ID definitions
304 
305 ******************************************************************************/
306 #define TNETW1150_PG10_CHIP_ID          0x04010101
307 #define TNETW1150_PG11_CHIP_ID          0x04020101
308 #define TNETW1150_CHIP_ID               0x04030101  /* 1150 PG2.0, 1250, 1350, 1450*/
309 #define TNETW1350A_CHIP_ID              0x06010101
310 #define TNETW1251_CHIP_ID_PG1_0         0x07010101
311 #define TNETW1251_CHIP_ID_PG1_1         0x07020101
312 #define TNETW1251_CHIP_ID_PG1_2	        0x07030101
313 
314 #define IS_CHIP_PG_LESS_THEN_PG12()      ((CHIP_ID == TNETW1251_CHIP_ID_PG1_0) || (CHIP_ID == TNETW1251_CHIP_ID_PG1_1))
315 
316 /******************************************************************************
317 Enable bits for SOC1251 PG1.2
318 ******************************************************************************/
319 #define PDET_BINARY_OFFSET_EN   BIT_0
320 #define STOP_TOGGLE_MONADC_EN   BIT_1
321 #define RX_ADC_BIAS_DEC_EN      BIT_2
322 #define RX_LNB_AND_DIGI_GAIN_EN BIT_3
323 
324 
325 #endif /* PUBLIC_TYPES_H*/
326