# HG changeset patch
# User Florian Pose <fp@igh-essen.com>
# Date 1214487743 0
# Node ID 435d7f36f13de4d63bb0847ca81ba965d314061a
# Parent  7b656881e77167e5abd47495ef49196b6c7e7257
Operational flag in 'ethercat config'.

diff -r 7b656881e771 -r 435d7f36f13d master/cdev.c
--- a/master/cdev.c	Thu Jun 26 13:41:42 2008 +0000
+++ b/master/cdev.c	Thu Jun 26 13:42:23 2008 +0000
@@ -858,6 +858,8 @@
                 }
                 data.sdo_count = ec_slave_config_sdo_count(sc);
                 data.attached = sc->slave != NULL;
+                data.operational = sc->slave &&
+                    sc->slave->current_state == EC_SLAVE_STATE_OP;
 
                 if (copy_to_user((void __user *) arg, &data, sizeof(data)))
                     retval = -EFAULT;
diff -r 7b656881e771 -r 435d7f36f13d master/ioctl.h
--- a/master/ioctl.h	Thu Jun 26 13:41:42 2008 +0000
+++ b/master/ioctl.h	Thu Jun 26 13:42:23 2008 +0000
@@ -296,7 +296,9 @@
         uint32_t pdo_count;
     } syncs[16];
     uint32_t sdo_count;
-    uint8_t attached;
+    uint8_t attached    : 1,
+            operational : 1;
+    
 } ec_ioctl_config_t;
 
 /*****************************************************************************/
diff -r 7b656881e771 -r 435d7f36f13d tools/Master.cpp
--- a/tools/Master.cpp	Thu Jun 26 13:41:42 2008 +0000
+++ b/tools/Master.cpp	Thu Jun 26 13:42:23 2008 +0000
@@ -198,7 +198,8 @@
             << hex << setw(8) << config.vendor_id << endl
             << "Product code: 0x"
             << hex << setw(8) << config.product_code << endl
-            << "Attached: " << (config.attached ? "yes" : "no") << endl;
+            << "Attached: " << (config.attached ? "yes" : "no") << endl
+            << "Operational: " << (config.operational ? "yes" : "no") << endl;
 
         for (j = 0; j < 16; j++) {
             if (config.syncs[j].pdo_count) {