aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sbus/char
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-11-07 17:13:14 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-07 17:13:14 -0500
commitb66621fef30e15810d459212bc8bdc274e08f14f (patch)
tree6f0c71c93f56d47414dd43a39e3ed563d560aeda /drivers/sbus/char
parent1d5d00bd9c44ab4730d353ee6ba0c8ebbff295c7 (diff)
[SPARC] cpwatchdog: implement ->compat_ioctl
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/sbus/char')
-rw-r--r--drivers/sbus/char/cpwatchdog.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/sbus/char/cpwatchdog.c b/drivers/sbus/char/cpwatchdog.c
index c82abeb59d3a..071ae24be892 100644
--- a/drivers/sbus/char/cpwatchdog.c
+++ b/drivers/sbus/char/cpwatchdog.c
@@ -26,6 +26,7 @@
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/ioport.h> 27#include <linux/ioport.h>
28#include <linux/timer.h> 28#include <linux/timer.h>
29#include <linux/smp_lock.h>
29#include <asm/irq.h> 30#include <asm/irq.h>
30#include <asm/ebus.h> 31#include <asm/ebus.h>
31#include <asm/oplib.h> 32#include <asm/oplib.h>
@@ -394,6 +395,28 @@ static int wd_ioctl(struct inode *inode, struct file *file,
394 return(0); 395 return(0);
395} 396}
396 397
398static long wd_compat_ioctl(struct file *file, unsigned int cmd,
399 unsigned long arg)
400{
401 int rval = -ENOIOCTLCMD;
402
403 switch (cmd) {
404 /* solaris ioctls are specific to this driver */
405 case WIOCSTART:
406 case WIOCSTOP:
407 case WIOCGSTAT:
408 lock_kernel();
409 rval = wd_ioctl(file->f_dentry->d_inode, file, cmd, arg);
410 lock_kernel();
411 break;
412 /* everything else is handled by the generic compat layer */
413 default:
414 break;
415 }
416
417 return rval;
418}
419
397static ssize_t wd_write(struct file *file, 420static ssize_t wd_write(struct file *file,
398 const char __user *buf, 421 const char __user *buf,
399 size_t count, 422 size_t count,
@@ -441,6 +464,7 @@ static irqreturn_t wd_interrupt(int irq, void *dev_id, struct pt_regs *regs)
441static struct file_operations wd_fops = { 464static struct file_operations wd_fops = {
442 .owner = THIS_MODULE, 465 .owner = THIS_MODULE,
443 .ioctl = wd_ioctl, 466 .ioctl = wd_ioctl,
467 .compat_ioctl = wd_compat_ioctl,
444 .open = wd_open, 468 .open = wd_open,
445 .write = wd_write, 469 .write = wd_write,
446 .read = wd_read, 470 .read = wd_read,