ioctl
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
#define DEVICE_NAME "variable_monitor"
|
||||
|
||||
//!todo check name
|
||||
// for character device
|
||||
static dev_t dev_num;
|
||||
static struct cdev *watch_cdev;
|
||||
@@ -57,9 +56,9 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num,
|
||||
|
||||
printk(KERN_INFO "variable_monitor fun: %s with ioctl_num %d\n", __FUNCTION__,
|
||||
ioctl_num);
|
||||
//!todo check style
|
||||
//! todo check style
|
||||
switch (ioctl_num) {
|
||||
case 0:
|
||||
case IOCTL_WATCH_VARIABLE:
|
||||
// copy watch_arg
|
||||
if (copy_from_user(&warg, (watch_arg *)ioctl_param, sizeof(warg))) {
|
||||
return -EACCES;
|
||||
@@ -72,7 +71,7 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num,
|
||||
// start watch variable
|
||||
start_watch_variable(warg);
|
||||
break;
|
||||
case 1:
|
||||
case IOCTL_DUMP_LOG:
|
||||
printk(KERN_INFO "variable_monitor ioctl_num 1\n");
|
||||
ret = copy_from_user(&dump_param, (ioctl_dump_param *)ioctl_param,
|
||||
sizeof(ioctl_dump_param));
|
||||
|
||||
Reference in New Issue
Block a user