These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / watchdog / hpwdt.c
index ada3e44..286369d 100644 (file)
@@ -588,7 +588,7 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd,
 {
        void __user *argp = (void __user *)arg;
        int __user *p = argp;
-       int new_margin;
+       int new_margin, options;
        int ret = -ENOTTY;
 
        switch (cmd) {
@@ -608,6 +608,20 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd,
                ret = 0;
                break;
 
+       case WDIOC_SETOPTIONS:
+               ret = get_user(options, p);
+               if (ret)
+                       break;
+
+               if (options & WDIOS_DISABLECARD)
+                       hpwdt_stop();
+
+               if (options & WDIOS_ENABLECARD) {
+                       hpwdt_start();
+                       hpwdt_ping();
+               }
+               break;
+
        case WDIOC_SETTIMEOUT:
                ret = get_user(new_margin, p);
                if (ret)