8723BU: Update 8723BU wifi driver to version v4.3.16_14189.20150519_BTCOEX2015119...
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723bu / include / basic_types.h
index 28ba763ba5a2524e675757f819e5d5c5c02a8713..6f98c1af231da0aea60e016d2592a4f71d35ce4d 100755 (executable)
@@ -76,7 +76,7 @@
 
 
 #ifdef PLATFORM_LINUX
-
+       #include <linux/version.h>
        #include <linux/types.h>
        #define IN
        #define OUT
        #define UINT u32
        #define ULONG u32       
 
+       #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
+               typedef _Bool bool;
+       #endif
+
        typedef void (*proc_t)(void*);
 
        typedef         __kernel_size_t SIZE_T; 
        ( \
                LE_P2BYTE_TO_HOST_2BYTE(__pStart) \
                & \
-               ( ~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen) ) \
+               (u16)(~BIT_OFFSET_LEN_MASK_16(__BitOffset, __BitLen))\
        )
 
 #define SET_BITS_TO_LE_2BYTE(__pStart, __BitOffset, __BitLen, __Value) \
        ( \
                LE_P1BYTE_TO_HOST_1BYTE(__pStart) \
                & \
-               ( ~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen) ) \
+               (u8)(~BIT_OFFSET_LEN_MASK_8(__BitOffset, __BitLen))\
        )
 
 #define SET_BITS_TO_LE_1BYTE(__pStart, __BitOffset, __BitLen, __Value) \
        )
 
 #define SET_BITS_TO_LE_1BYTE_8BIT(__pStart, __BitOffset, __BitLen, __Value) \
-{ \
+do { \
        *((u8 *)(__pStart)) = \
                EF1Byte( \
                        LE_BITS_CLEARED_TO_1BYTE_8BIT(__pStart, __BitOffset, __BitLen) \
                        | \
                        ((u8)__Value) \
                ); \
-}
+} while (0)
 
 // Get the N-bytes aligment offset from the current length
 #define N_BYTE_ALIGMENT(__Value, __Aligment) ((__Aligment == 1) ? (__Value) : (((__Value + __Aligment - 1) / __Aligment) * __Aligment))