xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8822be/hal/halmac/halmac_2_platform.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2015 - 2016 Realtek Corporation. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20 #ifndef _HALMAC_2_PLATFORM_H_
21 #define _HALMAC_2_PLATFORM_H_
22 
23 /*[Driver] always set BUILD_TEST =0*/
24 #define BUILD_TEST	0
25 
26 #if BUILD_TEST
27 #include "../Platform/App/Test/halmac_2_platformapi.h"
28 #else
29 /*[Driver] use their own header files*/
30 #include <drv_conf.h>			/* for basic_types.h and osdep_service.h */
31 #include <basic_types.h>		/* u8, u16, u32 and etc.*/
32 #include <osdep_service.h>		/* __BIG_ENDIAN, __LITTLE_ENDIAN, _sema, _mutex */
33 #endif
34 
35 /*[Driver] provide the define of _TRUE, _FALSE, NULL, u8, u16, u32*/
36 #ifndef NULL
37 #define NULL		((void *)0)
38 #endif
39 
40 #define HALMAC_INLINE	inline
41 
42 typedef u8	*pu8;
43 typedef u16	*pu16;
44 typedef u32	*pu32;
45 typedef s8	*ps8;
46 typedef s16	*ps16;
47 typedef s32	*ps32;
48 
49 
50 #define HALMAC_PLATFORM_LITTLE_ENDIAN	1
51 #define HALMAC_PLATFORM_BIG_ENDIAN	0
52 
53 /* Note : Named HALMAC_PLATFORM_LITTLE_ENDIAN / HALMAC_PLATFORM_BIG_ENDIAN
54  * is not mandatory. But Little endian must be '1'. Big endian must be '0'
55  */
56 /*[Driver] config the system endian*/
57 #ifdef __LITTLE_ENDIAN
58 #define HALMAC_SYSTEM_ENDIAN	HALMAC_PLATFORM_LITTLE_ENDIAN
59 #else /* !__LITTLE_ENDIAN */
60 #define HALMAC_SYSTEM_ENDIAN	HALMAC_PLATFORM_BIG_ENDIAN
61 #endif /* !__LITTLE_ENDIAN */
62 
63 /*[Driver] config if the operating platform*/
64 #define HALMAC_PLATFORM_WINDOWS		0
65 #define HALMAC_PLATFORM_LINUX		1
66 #define HALMAC_PLATFORM_AP		0
67 /*[Driver] must set HALMAC_PLATFORM_TESTPROGRAM = 0*/
68 #define HALMAC_PLATFORM_TESTPROGRAM	0
69 
70 /*[Driver] config if enable the dbg msg or notl*/
71 #define HALMAC_DBG_MSG_ENABLE		1
72 
73 /*[Driver] define the Platform SDIO Bus CLK */
74 #define PLATFORM_SD_CLK	50000000 /*50MHz*/
75 
76 /*[Driver] provide the type mutex*/
77 /* Mutex type */
78 typedef _mutex		HALMAC_MUTEX;
79 
80 #endif /* _HALMAC_2_PLATFORM_H_ */
81 
82