From dfe012d4875ceae6029ac3e650ad089de54b5a1e Mon Sep 17 00:00:00 2001 From: astsam Date: Sun, 14 May 2017 12:27:25 +0300 Subject: [PATCH] Fix compilation for ARM --- Makefile | 10 +++++----- core/rtw_mp.c | 13 ++++++++++--- include/rtw_mp.h | 3 ++- os_dep/linux/ioctl_mp.c | 3 ++- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 642384a..64a470c 100755 --- a/Makefile +++ b/Makefile @@ -1031,13 +1031,13 @@ endif ifeq ($(CONFIG_MP_VHT_HW_TX_MODE), y) EXTRA_CFLAGS += -DCONFIG_MP_VHT_HW_TX_MODE -ifeq ($(CONFIG_PLATFORM_I386_PC), y) +#ifeq ($(CONFIG_PLATFORM_I386_PC), y) ## For I386 X86 ToolChain use Hardware FLOATING -EXTRA_CFLAGS += -mhard-float -else +#EXTRA_CFLAGS += -mhard-float +#else ## For ARM ToolChain use Hardware FLOATING -EXTRA_CFLAGS += -mfloat-abi=hard -endif +#EXTRA_CFLAGS += -mfloat-abi=hard +#endif endif ifeq ($(CONFIG_APPEND_VENDOR_IE_ENABLE), y) diff --git a/core/rtw_mp.c b/core/rtw_mp.c index ecd48a3..eb9ce72 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -33,6 +33,11 @@ #define CEILING_NEG(X) ((X - (int)(X)) < 0 ? (int)(X - 1) : (int)(X)) #define ceil(X) (((X) > 0) ? CEILING_POS(X) : CEILING_NEG(X)) +static int rtfloor(float x) { + int xi = (int)x; + return x < xi ? xi - 1 : xi; +} +#if 0 int rtfloor(float x) { int i = x - 2; @@ -42,6 +47,7 @@ int rtfloor(float x) return i; } #endif +#endif #ifdef CONFIG_MP_INCLUDED u32 read_macreg(_adapter *padapter, u32 addr, u32 sz) @@ -2766,7 +2772,7 @@ void CRC16_generator( } - +#if !defined(__arm__) /*======================================== SFD SIGNAL SERVICE LENGTH CRC 16 bit 8 bit 8 bit 16 bit 16 bit @@ -2846,7 +2852,7 @@ void CCK_generator( ByteToBit(pPMacTxInfo->CRC16, crc16_out, 2); } - +#endif void PMAC_Get_Pkt_Param( PRT_PMAC_TX_INFO pPMacTxInfo, @@ -2919,7 +2925,7 @@ void PMAC_Get_Pkt_Param( pPMacTxInfo->m_STBC = 1; } - +#if !defined(__arm__) UINT LDPC_parameter_generator( UINT N_pld_int, UINT N_CBPSS, @@ -3265,6 +3271,7 @@ void L_SIG_generator( _rtw_memset(pPMacTxInfo->LSIG, 0, 3); ByteToBit(pPMacTxInfo->LSIG, (bool *)sig_bi, 3); } +#endif void CRC8_generator( diff --git a/include/rtw_mp.h b/include/rtw_mp.h index 1b7bdfc..0d144ed 100644 --- a/include/rtw_mp.h +++ b/include/rtw_mp.h @@ -781,6 +781,7 @@ PMAC_Get_Pkt_Param( PRT_PMAC_TX_INFO pPMacTxInfo, PRT_PMAC_PKT_INFO pPMacPktInfo ); +#if !defined(__arm__) void CCK_generator( PRT_PMAC_TX_INFO pPMacTxInfo, @@ -797,7 +798,7 @@ L_SIG_generator( PRT_PMAC_TX_INFO pPMacTxInfo, PRT_PMAC_PKT_INFO pPMacPktInfo ); - +#endif void HT_SIG_generator( PRT_PMAC_TX_INFO pPMacTxInfo, PRT_PMAC_PKT_INFO pPMacPktInfo); diff --git a/os_dep/linux/ioctl_mp.c b/os_dep/linux/ioctl_mp.c index dbebe8f..e6fc0b7 100644 --- a/os_dep/linux/ioctl_mp.c +++ b/os_dep/linux/ioctl_mp.c @@ -1597,7 +1597,7 @@ int rtw_mp_tx(struct net_device *dev, _rtw_memset(pMptCtx->PMacTxInfo.MacAddress, 0xFF, ETH_ALEN); PMAC_Get_Pkt_Param(&pMptCtx->PMacTxInfo, &pMptCtx->PMacPktInfo); - +#if !defined(__arm__) if (MPT_IS_CCK_RATE(pMptCtx->PMacTxInfo.TX_RATE)) CCK_generator(&pMptCtx->PMacTxInfo, &pMptCtx->PMacPktInfo); @@ -1606,6 +1606,7 @@ int rtw_mp_tx(struct net_device *dev, /* 24 BIT*/ L_SIG_generator(pMptCtx->PMacPktInfo.N_sym, &pMptCtx->PMacTxInfo, &pMptCtx->PMacPktInfo); } +#endif /* 48BIT*/ if (MPT_IS_HT_RATE(pMptCtx->PMacTxInfo.TX_RATE)) HT_SIG_generator(&pMptCtx->PMacTxInfo, &pMptCtx->PMacPktInfo);