aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorRoman Kuzmitskii <damex.pp@icloud.com>2020-10-28 19:23:49 +0000
committerDaniel Golle <daniel@makrotopia.org>2020-11-05 19:29:48 +0000
commita8ceda752c8f6d5ee84bfc4d2d24a5b326c9e671 (patch)
treebe7a009b863f3a3e6665b83e6d2c43881a38404a /target/linux
parentb9898cd78a38bd1aa98de7eab070b097b44c2ea1 (diff)
downloadupstream-a8ceda752c8f6d5ee84bfc4d2d24a5b326c9e671.tar.gz
upstream-a8ceda752c8f6d5ee84bfc4d2d24a5b326c9e671.tar.bz2
upstream-a8ceda752c8f6d5ee84bfc4d2d24a5b326c9e671.zip
octeon: implement interface rename by label from device tree
adds patch to octeon ethernet driver that to rename interface name by label from device tree Tested-by: Johannes Kimmel <fff@bareminimum.eu> Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch
new file mode 100644
index 0000000000..0aef899a96
--- /dev/null
+++ b/target/linux/octeon/patches-5.4/700-allocate_interface_by_label.patch
@@ -0,0 +1,38 @@
+From: Roman Kuzmitskii <damex.pp@icloud.com>
+Date: Wed, 28 Oct 2020 19:00:00 +0000
+Subject: [PATCH] staging: octeon: add net-labels support
+
+With this patch, device name can be set within dts file
+in the same way as dsa port can.
+
+Add label to pip interface node to use this feature:
+label = "lan0";
+
+Tested-by: Johannes Kimmel <fff@bareminimum.eu>
+Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
+--- a/drivers/staging/octeon/ethernet.c
++++ b/drivers/staging/octeon/ethernet.c
+@@ -407,9 +407,12 @@
+ {
+ struct octeon_ethernet *priv = netdev_priv(dev);
+ const u8 *mac = NULL;
++ const u8 *label = NULL;
+
+- if (priv->of_node)
++ if (priv->of_node) {
+ mac = of_get_mac_address(priv->of_node);
++ label = of_get_property(priv->of_node, "label", NULL);
++ }
+
+ if (!IS_ERR_OR_NULL(mac))
+ ether_addr_copy(dev->dev_addr, mac);
+@@ -444,6 +447,9 @@
+ if (dev->netdev_ops->ndo_stop)
+ dev->netdev_ops->ndo_stop(dev);
+
++ if (!IS_ERR_OR_NULL(label))
++ dev_alloc_name(dev, label);
++
+ return 0;
+ }
+