From 8bc158e9dc13c01b1ab7fc7a1742da1fbd944e40 Mon Sep 17 00:00:00 2001 From: kimocoder Date: Sat, 6 Apr 2019 01:36:11 +0200 Subject: [PATCH] Add entry for compiling against openwrt tree --- Makefile | 11 +++++++++++ core/rtw_ap.c | 2 +- core/rtw_mlme_ext.c | 10 ++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 878c65f..c058b12 100755 --- a/Makefile +++ b/Makefile @@ -112,6 +112,7 @@ CONFIG_PLATFORM_ARM_S3C6K4 = n CONFIG_PLATFORM_MIPS_RMI = n CONFIG_PLATFORM_RTD2880B = n CONFIG_PLATFORM_MIPS_AR9132 = n +CONFIG_PLATFORM_OPENWRT_NEO2 = n CONFIG_PLATFORM_RTK_DMP = n CONFIG_PLATFORM_MIPS_PLM = n CONFIG_PLATFORM_MSTAR389 = n @@ -927,6 +928,16 @@ CROSS_COMPILE := aarch64-openwrt-linux- KSRC := /home/greearb/git/openwrt-neo2-dev/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/linux-4.14.78 endif +# This is how I built for openwrt Neo2 platform. --Ben +ifeq ($(CONFIG_PLATFORM_OPENWRT_NEO2), y) +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +ARCH := arm64 +CROSS_COMPILE := aarch64-openwrt-linux- +#export PATH=$PATH:/home/greearb/git/openwrt-neo2-dev/staging_dir/toolchain-aarch64_cortex-a53_gcc-7.3.0_musl/bin/ +#export STAGING_DIR=/home/greearb/git/openwrt-neo2-dev/staging_dir +KSRC := /home/greearb/git/openwrt-neo2-dev/build_dir/target-aarch64_cortex-a53_musl/linux-sunxi_cortexa53/linux-4.14.78 +endif + ifeq ($(CONFIG_PLATFORM_DMP_PHILIPS), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DRTK_DMP_PLATFORM ARCH := mips diff --git a/core/rtw_ap.c b/core/rtw_ap.c index d8a8e7f..703e17e 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -174,7 +174,7 @@ void rtw_add_bcn_ie(_adapter *padapter, WLAN_BSSID_EX *pnetwork, u8 index, u8 *d u8 bmatch = _FALSE; u8 *pie = pnetwork->IEs; u8 *p = NULL, *dst_ie = NULL, *premainder_ie = NULL, *pbackup_remainder_ie = NULL; - u32 i, offset, ielen, ie_offset, remainder_ielen = 0; + u32 i, offset, ielen = 0, ie_offset, remainder_ielen = 0; for (i = sizeof(NDIS_802_11_FIXED_IEs); i < pnetwork->IELength;) { pIE = (PNDIS_802_11_VARIABLE_IEs)(pnetwork->IEs + i); diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index d3c213c..5bd061e 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -4152,7 +4152,8 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_NEGO_REQ; - u8 wpsie[255] = { 0x00 }, p2pie[255] = { 0x00 }; + u8 *wpsie; + u8 p2pie[ 255 ] = { 0x00 }; u8 wpsielen = 0, p2pielen = 0, i; u8 channel_cnt_24g = 0, channel_cnt_5gl = 0, channel_cnt_5gh = 0; u16 len_channellist_attr = 0; @@ -4550,7 +4551,8 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l u8 action = P2P_PUB_ACTION_ACTION; u32 p2poui = cpu_to_be32(P2POUI); u8 oui_subtype = P2P_GO_NEGO_RESP; - u8 wpsie[255] = { 0x00 }, p2pie[255] = { 0x00 }; + u8 *wpsie; + u8 p2pie[ 255 ] = { 0x00 }; u8 p2pielen = 0, i; uint wpsielen = 0; u16 wps_devicepassword_id = 0x0000; @@ -4576,6 +4578,8 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l if (pmgntframe == NULL) return; + wpsie = rtw_zmalloc(256); + RTW_INFO("[%s] In, result = %d\n", __FUNCTION__, result); /* update attribute */ pattrib = &pmgntframe->attrib; @@ -4958,6 +4962,8 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l dump_mgntframe(padapter, pmgntframe); + kfree(wpsie); + return; }