From 4ca3a2792f037ddbf14333bd7b3d042e59be4a60 Mon Sep 17 00:00:00 2001
From: Florian Pose <fp@igh-essen.com>
Date: Wed, 12 Sep 2007 10:00:39 +0000
Subject: [PATCH] Create network interfaces for EoE devices with alias as
 eoeXaY.

---
 master/ethernet.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/master/ethernet.c b/master/ethernet.c
index 9c52bae1..436b75c1 100644
--- a/master/ethernet.c
+++ b/master/ethernet.c
@@ -117,12 +117,16 @@ int ec_eoe_init(
     eoe->tx_rate = 0;
     eoe->rate_jiffies = 0;
 
-    /* device name eoe<MASTER>s<SLAVE>, because system tools don't like
-     * hyphens etc. in interface names. */
-    sprintf(name, "eoe%us%u", slave->master->index, slave->ring_position);
+    /* device name eoe<MASTER>[as]<SLAVE>, because networking scripts don't
+     * like hyphens etc. in interface names. */
+    if (slave->sii_alias) {
+        sprintf(name, "eoe%ua%u", slave->master->index, slave->sii_alias);
+    } else {
+        sprintf(name, "eoe%us%u", slave->master->index, slave->ring_position);
+    }
 
     if (!(eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, ether_setup))) {
-        EC_ERR("Unable to allocate net_device for EoE handler!\n");
+        EC_ERR("Unable to allocate net_device %s for EoE handler!\n", name);
         goto out_return;
     }
 
-- 
GitLab