1 /****************************************************************************** 2 * 3 * Copyright(c) 2015 - 2018 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 ******************************************************************************/ 15 16 #ifndef _HALMAC_2_PLATFORM_H_ 17 #define _HALMAC_2_PLATFORM_H_ 18 19 /*[Driver] always set BUILD_TEST =0*/ 20 #define BUILD_TEST 0 21 22 #if BUILD_TEST 23 #include "../Platform/App/Test/halmac_2_platformapi.h" 24 #else 25 /*[Driver] use their own header files*/ 26 #include <drv_conf.h> /* for basic_types.h and osdep_service.h */ 27 #include <basic_types.h> /* u8, u16, u32 and etc.*/ 28 #include <osdep_service.h> /* __BIG_ENDIAN, __LITTLE_ENDIAN, _sema, _mutex */ 29 #endif 30 31 /*[Driver] provide the define of NULL, u8, u16, u32*/ 32 #ifndef NULL 33 #define NULL ((void *)0) 34 #endif 35 36 #define HALMAC_INLINE inline 37 38 /* 39 * Ignore following typedef because Linux already have these 40 * u8, u16, u32, s8, s16, s32 41 * __le16, __le32, __be16, __be32 42 */ 43 44 #define HALMAC_PLATFORM_LITTLE_ENDIAN 1 45 #define HALMAC_PLATFORM_BIG_ENDIAN 0 46 47 /* Note : Named HALMAC_PLATFORM_LITTLE_ENDIAN / HALMAC_PLATFORM_BIG_ENDIAN 48 * is not mandatory. But Little endian must be '1'. Big endian must be '0' 49 */ 50 /*[Driver] config the system endian*/ 51 #ifdef __LITTLE_ENDIAN 52 #define HALMAC_SYSTEM_ENDIAN HALMAC_PLATFORM_LITTLE_ENDIAN 53 #else /* !__LITTLE_ENDIAN */ 54 #define HALMAC_SYSTEM_ENDIAN HALMAC_PLATFORM_BIG_ENDIAN 55 #endif /* !__LITTLE_ENDIAN */ 56 57 /*[Driver] config if the operating platform*/ 58 #define HALMAC_PLATFORM_WINDOWS 0 59 #define HALMAC_PLATFORM_LINUX 1 60 #define HALMAC_PLATFORM_AP 0 61 /*[Driver] must set HALMAC_PLATFORM_TESTPROGRAM = 0*/ 62 #define HALMAC_PLATFORM_TESTPROGRAM 0 63 64 /*[Driver] config if enable the dbg msg or notl*/ 65 #define HALMAC_DBG_MSG_ENABLE 1 66 67 #define HALMAC_MSG_LEVEL_TRACE 3 68 #define HALMAC_MSG_LEVEL_WARNING 2 69 #define HALMAC_MSG_LEVEL_ERR 1 70 #define HALMAC_MSG_LEVEL_NO_LOG 0 71 /*[Driver] config halmac msg level 72 * Use HALMAC_MSG_LEVEL_XXXX 73 */ 74 #define HALMAC_MSG_LEVEL HALMAC_MSG_LEVEL_TRACE 75 76 #ifdef DBG_IO 77 #define HALMAC_DBG_MONITOR_IO 1 78 #else 79 #define HALMAC_DBG_MONITOR_IO 0 80 #endif /*DBG_IO*/ 81 82 /*[Driver] define the Rx FIFO expanding mode packet size unit for 8821C and 8822B */ 83 /*Should be 8 Byte alignment*/ 84 #define HALMAC_RX_FIFO_EXPANDING_MODE_PKT_SIZE 80 /*Bytes*/ 85 86 #define HALMAC_USE_TYPEDEF 0 87 88 /*[Driver] provide the type mutex*/ 89 /* Mutex type */ 90 typedef _mutex HALMAC_MUTEX; 91 92 #endif /* _HALMAC_2_PLATFORM_H_ */ 93 94