Copy missing slave_info data in kernel space. redundancy
authorFlorian Pose <fp@igh-essen.com>
Tue, 10 Jan 2012 10:11:20 +0100
branchredundancy
changeset 2340 3f2a4f9ff786
parent 2339 ecaff0d1d165
child 2341 80c03df98a49
Copy missing slave_info data in kernel space.
master/master.c
--- a/master/master.c	Tue Jan 10 10:10:58 2012 +0100
+++ b/master/master.c	Tue Jan 10 10:11:20 2012 +0100
@@ -2407,6 +2407,7 @@
         ec_slave_info_t *slave_info)
 {
     const ec_slave_t *slave;
+    unsigned int i;
 
     if (down_interruptible(&master->master_sem)) {
         return -EINTR;
@@ -2421,6 +2422,25 @@
     slave_info->serial_number = slave->sii.serial_number;
     slave_info->alias = slave->effective_alias;
     slave_info->current_on_ebus = slave->sii.current_on_ebus;
+
+    for (i = 0; i < EC_MAX_PORTS; i++) {
+        slave_info->ports[i].desc = slave->ports[i].desc;
+        slave_info->ports[i].link.link_up = slave->ports[i].link.link_up;
+        slave_info->ports[i].link.loop_closed =
+            slave->ports[i].link.loop_closed;
+        slave_info->ports[i].link.signal_detected =
+            slave->ports[i].link.signal_detected;
+        slave_info->ports[i].receive_time = slave->ports[i].receive_time;
+        if (slave->ports[i].next_slave) {
+            slave_info->ports[i].next_slave =
+                slave->ports[i].next_slave->ring_position;
+        } else {
+            slave_info->ports[i].next_slave = 0xffff;
+        }
+        slave_info->ports[i].delay_to_next_dc =
+            slave->ports[i].delay_to_next_dc;
+    }
+
     slave_info->al_state = slave->current_state;
     slave_info->error_flag = slave->error_flag;
     slave_info->sync_count = slave->sii.sync_count;