mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-09-25 03:23:46 +08:00
Added ecrt_master_reset() method.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user