master/cdev.c
changeset 1963 6aaf77798445
parent 1952 7d9fb723fc4b
parent 1961 48f536aefc18
child 1966 23c638a81fe7
child 1995 7d748d9cf9e8
--- a/master/cdev.c	Thu Aug 05 09:54:06 2010 +0200
+++ b/master/cdev.c	Thu Sep 16 10:16:12 2010 +0200
@@ -659,6 +659,19 @@
 
 /*****************************************************************************/
 
+/** Issue a bus scan.
+ */
+int ec_cdev_ioctl_master_rescan(
+        ec_master_t *master, /**< EtherCAT master. */
+        unsigned long arg /**< ioctl() argument. */
+        )
+{
+    master->fsm.rescan_required = 1;
+    return 0;
+}
+
+/*****************************************************************************/
+
 /** Set slave state.
  */
 int ec_cdev_ioctl_slave_state(
@@ -3501,6 +3514,10 @@
             if (!(filp->f_mode & FMODE_WRITE))
                 return -EPERM;
             return ec_cdev_ioctl_master_debug(master, arg);
+        case EC_IOCTL_MASTER_RESCAN:
+            if (!(filp->f_mode & FMODE_WRITE))
+                return -EPERM;
+            return ec_cdev_ioctl_master_rescan(master, arg);
         case EC_IOCTL_SLAVE_STATE:
             if (!(filp->f_mode & FMODE_WRITE))
                 return -EPERM;