]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
xradio: update get mac address from dts function
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 10 Nov 2021 07:04:58 +0000 (07:04 +0000)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 10 Nov 2021 07:04:58 +0000 (07:04 +0000)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
lfs/xradio
src/patches/xradio/eth_platform_get_mac_address.patch [new file with mode: 0644]

index d65756b3e38809c1065504608989db71e270d6d6..1f92f69754012d2337f5354dc5eb4a5faa4638b6 100644 (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
diff --git a/src/patches/xradio/eth_platform_get_mac_address.patch b/src/patches/xradio/eth_platform_get_mac_address.patch
new file mode 100644 (file)
index 0000000..bc1733e
--- /dev/null
@@ -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);