Added ecrt_master_reset() method.

This commit is contained in:
Florian Pose
2010-11-30 15:24:21 +01:00
parent 379ab87b98
commit 6929f2f718
5 changed files with 91 additions and 32 deletions
+23
View File
@@ -1992,6 +1992,25 @@ int ec_cdev_ioctl_sync_mon_process(
/*****************************************************************************/
/** Reset configuration.
*/
int ec_cdev_ioctl_reset(
ec_master_t *master, /**< EtherCAT master. */
unsigned long arg, /**< ioctl() argument. */
ec_cdev_priv_t *priv /**< Private data structure of file handle. */
)
{
if (unlikely(!priv->requested))
return -EPERM;
down(&master->master_sem);
ecrt_master_reset(master);
up(&master->master_sem);
return 0;
}
/*****************************************************************************/
/** Configure a sync manager.
*/
int ec_cdev_ioctl_sc_sync(
@@ -3671,6 +3690,10 @@ long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (!(filp->f_mode & FMODE_WRITE))
return -EPERM;
return ec_cdev_ioctl_sync_mon_process(master, arg, priv);
case EC_IOCTL_RESET:
if (!(filp->f_mode & FMODE_WRITE))
return -EPERM;
return ec_cdev_ioctl_reset(master, arg, priv);
case EC_IOCTL_SC_SYNC:
if (!(filp->f_mode & FMODE_WRITE))
return -EPERM;