Skip to content

Commit

Permalink
Merge: Add aarch64 support to nexutil (#530)
Browse files Browse the repository at this point in the history
* Add aarch64 support to nexutil

* Revert changes on types.h, nexutil shouldn't depend on this

* Make nexutil no longer depending on types.h

* Update interface type when an existing interface is put in monitor mode

* Reuse MAC addr for the newly created mon vif - Closes #534
  • Loading branch information
DrSchottky authored Nov 14, 2023
1 parent b198f5e commit a80131b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions patches/driver/brcmfmac_5.15.y-nexmon/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,11 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
"Adhoc" : "Infra");
}
ndev->ieee80211_ptr->iftype = type;
#ifdef NEXMON_MON_IF
if(type == NL80211_IFTYPE_MONITOR) {
ndev->type = ARPHRD_IEEE80211_RADIOTAP;
}
#endif

brcmf_cfg80211_update_proto_addr_mode(&vif->wdev);

Expand Down
1 change: 1 addition & 0 deletions patches/driver/brcmfmac_5.15.y-nexmon/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ int brcmf_net_mon_attach(struct brcmf_if *ifp)

ndev = ifp->ndev;
ndev->netdev_ops = &brcmf_netdev_ops_mon;
memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN);

err = cfg80211_register_netdevice(ndev);
if (err)
Expand Down
2 changes: 1 addition & 1 deletion utilities/libnexio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ USE_VENDOR_CMD := 0

all: libs/armeabi/libnexio.a

ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l aarch64))
libs/armeabi/libnexio.a: Android.mk
$(NDK_ROOT)/ndk-build NDK_APPLICATION_MK=`pwd`/Application.mk NDK_APP_OUT=. TARGET_PLATFORM=android-21
else
Expand Down
6 changes: 3 additions & 3 deletions utilities/nexutil/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
USE_VENDOR_CMD := 0

ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l aarch64))
all: libs/armeabi/nexutil
else
all: nexutil
endif

ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l aarch64))
libs/armeabi/nexutil: Android.mk nexutil.c ../libargp/local/armeabi/libargp.a ../libnexio/local/armeabi/libnexio.a FORCE
touch nexutil.c
$(NDK_ROOT)/ndk-build NDK_APPLICATION_MK=`pwd`/Application.mk NDK_APP_OUT=. TARGET_PLATFORM=android-21 GIT_VERSION=$(GIT_VERSION)
Expand All @@ -29,7 +29,7 @@ endif
../libnexio/libnexio.a: FORCE
cd ../libnexio && make

ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l))
ifneq ($(shell uname -m),$(filter $(shell uname -m), armv6l armv7l aarch64))
install: libs/armeabi/nexutil
adb push $< /sdcard/
adb shell 'su -c "mount -o rw,remount /system"'
Expand Down
3 changes: 2 additions & 1 deletion utilities/nexutil/nexutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
#include <sys/ioctl.h>
#include <arpa/inet.h>
#ifdef BUILD_ON_RPI
#include <types.h> //not sure why it was removed, but it is needed for typedefs like `uint`
#include <linux/if.h>
#else
#include <net/if.h>
Expand All @@ -61,6 +60,8 @@

#include <nexioctls.h>

typedef uint32_t uint;

#include <typedefs.h>
#include <bcmwifi_channels.h>
#include <b64.h>
Expand Down
2 changes: 1 addition & 1 deletion utilities/nexutil/typedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

#endif /* ! __cplusplus */

#if defined(__x86_64__)
#if defined(__LP64__)
#define TYPEDEF_UINTPTR
typedef unsigned long long int uintptr;
#endif
Expand Down

0 comments on commit a80131b

Please sign in to comment.