xradio: update get mac address from dts function

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
Arne Fitzenreiter
2021-11-10 07:04:58 +00:00
parent 4290323c4d
commit 50fe4e50f3
2 changed files with 42 additions and 0 deletions

View File

@@ -82,6 +82,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/xradio/fix-transmit-of-tkip-encrypted-packets.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/xradio/fix-missing-wpa1-2-sequence-numbers-for-group.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/xradio/report-mic-fails-to-kernel-and-correct-iv-str.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/xradio/eth_platform_get_mac_address.patch
cd $(DIR_APP) && CONFIG_WLAN_VENDOR_XRADIO=m \
make $(MAKETUNING) -C /lib/modules/$(KVER)-$(VERSUFIX)/build/ M=$(DIR_APP)/ modules

View File

@@ -0,0 +1,41 @@
diff -Naur xradio-354e8c32e7948d46a63796d0ca266b1f702999b0.org/main.c xradio-354e8c32e7948d46a63796d0ca266b1f702999b0/main.c
--- xradio-354e8c32e7948d46a63796d0ca266b1f702999b0.org/main.c 2020-05-02 17:17:06.000000000 +0000
+++ xradio-354e8c32e7948d46a63796d0ca266b1f702999b0/main.c 2021-11-07 10:30:26.153851399 +0000
@@ -12,7 +12,7 @@
#include <linux/firmware.h>
#include <net/cfg80211.h>
-#include <linux/of_net.h>
+#include <linux/etherdevice.h>
#include <linux/mmc/sdio_func.h>
#include "xradio.h"
@@ -501,9 +501,8 @@
u8 b; /* MRK 5.5a */
struct ieee80211_hw *dev;
struct xradio_common *hw_priv;
- unsigned char randomaddr[ETH_ALEN];
- const unsigned char *addr = NULL;
-
+ unsigned char addr[ETH_ALEN];
+ int ret;
//init xradio_common
dev = xradio_init_common(sizeof(struct xradio_common));
if (!dev) {
@@ -517,12 +516,12 @@
// fill in mac addresses
if (hw_priv->pdev->of_node) {
- addr = of_get_mac_address(hw_priv->pdev->of_node);
+ ret = eth_platform_get_mac_address(hw_priv->pdev, addr);
}
- if (!addr) {
+
+ if (ret<0) {
dev_warn(hw_priv->pdev, "no mac address provided, using random\n");
- eth_random_addr(randomaddr);
- addr = randomaddr;
+ eth_random_addr(addr);
}
for (b = 0; b < XRWL_MAX_VIFS; b++) { /* MRK 5.5a */
memcpy(hw_priv->addresses[b].addr, addr, ETH_ALEN);