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 37 #ifndef __OS_TYPES_H__ 38 #define __OS_TYPES_H__ 39 40 #include <linux/version.h> 41 42 #ifndef VOID 43 #define VOID void 44 #define PVOID void* 45 #endif 46 47 #if !defined(FALSE) 48 #define FALSE 0 49 #endif 50 51 #if !defined(TRUE) 52 #define TRUE 1 53 #endif 54 55 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23) 56 #if !defined(false) 57 #define false 0 58 #endif 59 60 #if !defined(true) 61 #define true 1 62 #endif 63 #endif 64 65 #ifndef NULL 66 #if defined(__cplusplus) 67 #define NULL 0 68 #else 69 #define NULL ((void *)0) 70 #endif 71 #endif /* NULL */ 72 73 #ifndef UNUSED 74 #define UNUSED(p) ((void)p) 75 #endif 76 77 #ifndef SIZE_ARR 78 #define SIZE_ARR(a) (sizeof(a)/sizeof(a[0]) ) 79 #endif 80 /* 81 #ifdef _UNICODE 82 #define _T unsigned short 83 #else 84 #define _T 85 #endif 86 */ 87 #ifndef TI_HANDLE 88 typedef void* TI_HANDLE; 89 #endif 90 #define TI_HANDLE_INVALID NULL 91 #define TI_OK 0 92 #define TI_ERROR -1 93 94 typedef signed char INT8, *PINT8, *PCHAR; 95 typedef unsigned char UINT8, *PUINT8, UCHAR, *PUCHAR; 96 typedef short INT16, *PINT16; 97 typedef unsigned short UINT16, *PUINT16; 98 typedef unsigned int UINT, *PUINT; 99 100 typedef void tiVOID, *tiPVOID; 101 typedef unsigned int tiBOOL; 102 typedef tiBOOL BOOLEAN, *PBOOLEAN; 103 typedef UINT16 tiUINT16; 104 typedef signed int tiINT32; 105 typedef unsigned int tiUINT32; 106 typedef UINT8 tiUINT8; 107 typedef char ti_char; 108 typedef char tiCHAR; 109 typedef unsigned long long tiULONGLONG; 110 typedef long long tiLONGLONG; 111 112 #ifndef _BASETSD_H_ 113 typedef signed int INT32, *PINT32; 114 typedef unsigned long /*LARGE_INTEGER, */ULONG, *PULONG; 115 # ifndef _WINDOWS 116 typedef union _LARGE_INTEGER_T { 117 struct { 118 tiUINT32 LowPart; 119 tiINT32 HighPart; 120 }; 121 tiLONGLONG QuadPart; 122 } LARGE_INTEGER; 123 # endif /* _WINDOWS */ 124 125 # ifndef _SUPPLICANT_ 126 typedef unsigned int UINT32, *PUINT32; 127 typedef unsigned char BOOL, *PBOOL; 128 # endif /* _SUPPLICANT_ */ 129 #endif /* _BASETSD_H_ */ 130 131 /* 132 typedef struct _GUID { 133 unsigned long Data1; 134 unsigned short Data2; 135 unsigned short Data3; 136 unsigned char Data4[ 8 ]; 137 } GUID; 138 139 #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) ; 140 */ 141 typedef unsigned long long UINT64; 142 typedef long long INT64; 143 #define CONSTANT64(x) (x##LL) 144 145 #define STRUCT typedef struct 146 #define UNION typedef union 147 #define ENUM typedef enum 148 149 #define PACKED_STRUCT(name,content) STRUCT { content } __attribute__ ((packed)) name 150 #define PACKED_STRUCT_NO_TYPEDEF(content) struct { content } __attribute__ ((packed)) 151 #define PACKED_UNION(name,content) union { content } __attribute__ ((packed)) name 152 #define PACKED_UNION_NO_TYPEDEF(content) union { content } __attribute__ ((packed)) 153 #define ENUM_BODY(name, value) name value, 154 #define PACKED_ENUM(name, list) ENUM { list(ENUM_BODY) } __attribute__ ((packed)) name 155 156 157 #define NWIF_MAX_QOS_CONNS 7 158 159 #define BIT_TO_BYTE_FACTOR 8 160 161 typedef struct nwif_clsfr_entry_t 162 { 163 UINT32 ip; 164 UINT16 port; 165 UINT16 pri; 166 } NWIF_CLSFR_ENTRY; 167 /*The following define assumes that the structure above is 8 bytes.*/ 168 #define OS_CLSFR_TABLE_SIZE (NWIF_MAX_QOS_CONNS * 8) 169 170 typedef UINT64 OS_PHYSICAL_ADDRESS; 171 172 #define IMPORT_TI_API 173 174 #endif /* __OS_TYPES_H__*/ 175 176 177