Skip to content
Snippets Groups Projects
Commit 8da3757c authored by Florian Pose's avatar Florian Pose
Browse files

Added EC_IOCTL_APP_TIME.

parent c3015aef
No related branches found
No related tags found
No related merge requests found
......@@ -1640,6 +1640,29 @@ int ec_cdev_ioctl_master_state(
/*****************************************************************************/
/** Get the master state.
*/
int ec_cdev_ioctl_app_time(
ec_master_t *master, /**< EtherCAT master. */
unsigned long arg, /**< ioctl() argument. */
ec_cdev_priv_t *priv /**< Private data structure of file handle. */
)
{
ec_ioctl_app_time_t data;
if (unlikely(!priv->requested))
return -EPERM;
if (copy_from_user(&data, (void __user *) arg, sizeof(data))) {
return -EFAULT;
}
ecrt_master_application_time(master, data.app_time);
return 0;
}
/*****************************************************************************/
/** Sync the reference clock.
*/
int ec_cdev_ioctl_sync_ref(
......@@ -3130,6 +3153,10 @@ long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
return ec_cdev_ioctl_receive(master, arg, priv);
case EC_IOCTL_MASTER_STATE:
return ec_cdev_ioctl_master_state(master, arg, priv);
case EC_IOCTL_APP_TIME:
if (!(filp->f_mode & FMODE_WRITE))
return -EPERM;
return ec_cdev_ioctl_app_time(master, arg, priv);
case EC_IOCTL_SYNC_REF:
if (!(filp->f_mode & FMODE_WRITE))
return -EPERM;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment