Display real ethernet address.
authorFlorian Pose <fp@igh-essen.com>
Mon, 28 Jul 2008 13:23:07 +0000 (2008-07-28)
changeset 1162 51a8b41d3dbc
parent 1161 d1324ac71232
child 1163 81f9c6daeb60
Display real ethernet address.
TODO
master/cdev.c
--- a/TODO	Mon Jul 28 13:15:19 2008 +0000
+++ b/TODO	Mon Jul 28 13:23:07 2008 +0000
@@ -14,7 +14,6 @@
 * Get original driver for r8169.
 * Race in jiffies frame timeout?
 * ethercat tool:
-    - Display attached device's MAC address instead of ff's.
     - Data type abbreviations.
     - Add a -n (numeric) switch.
     - Check for options, remove global variables.
--- a/master/cdev.c	Mon Jul 28 13:15:19 2008 +0000
+++ b/master/cdev.c	Mon Jul 28 13:23:07 2008 +0000
@@ -135,11 +135,22 @@
     up(&master->master_sem);
 
     down(&master->device_sem);
-    memcpy(data.devices[0].address, master->main_mac, ETH_ALEN); 
+    if (master->main_device.dev) {
+        memcpy(data.devices[0].address,
+                master->main_device.dev->dev_addr, ETH_ALEN);
+    } else {
+        memcpy(data.devices[0].address, master->main_mac, ETH_ALEN); 
+    }
     data.devices[0].attached = master->main_device.dev ? 1 : 0;
     data.devices[0].tx_count = master->main_device.tx_count;
     data.devices[0].rx_count = master->main_device.rx_count;
-    memcpy(data.devices[1].address, master->backup_mac, ETH_ALEN); 
+
+    if (master->backup_device.dev) {
+        memcpy(data.devices[1].address,
+                master->backup_device.dev->dev_addr, ETH_ALEN); 
+    } else {
+        memcpy(data.devices[1].address, master->backup_mac, ETH_ALEN); 
+    }
     data.devices[1].attached = master->backup_device.dev ? 1 : 0;
     data.devices[1].tx_count = master->backup_device.tx_count;
     data.devices[1].rx_count = master->backup_device.rx_count;