mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-02-06 03:41:52 +08:00
Multi-master support for command-line tool. The --master option supports
ranges like '1-3,6,7-9'. The ioctl() interface version is checked.
This commit is contained in:
@@ -157,6 +157,25 @@ void ec_cdev_strcpy(
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/** Get module information.
|
||||
*/
|
||||
int ec_cdev_ioctl_module(
|
||||
unsigned long arg /**< Userspace address to store the results. */
|
||||
)
|
||||
{
|
||||
ec_ioctl_module_t data;
|
||||
|
||||
data.ioctl_version_magic = EC_IOCTL_VERSION_MAGIC;
|
||||
data.master_count = ec_master_count();
|
||||
|
||||
if (copy_to_user((void __user *) arg, &data, sizeof(data)))
|
||||
return -EFAULT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/** Get master information.
|
||||
*/
|
||||
int ec_cdev_ioctl_master(
|
||||
@@ -3281,6 +3300,8 @@ long eccdev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||
#endif
|
||||
|
||||
switch (cmd) {
|
||||
case EC_IOCTL_MODULE:
|
||||
return ec_cdev_ioctl_module(arg);
|
||||
case EC_IOCTL_MASTER:
|
||||
return ec_cdev_ioctl_master(master, arg);
|
||||
case EC_IOCTL_SLAVE:
|
||||
|
||||
Reference in New Issue
Block a user