aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2005-11-07 17:12:47 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-07 17:12:47 -0500
commitb31023fc24e5c39d246e9c6fc75dba1a2902c1d6 (patch)
treee89713fbd2769a70271e650aa3e3db5cf59c39a6 /drivers
parent1928f8e541245eae933f8c95b64b2bc3683f9661 (diff)
[SPARC] openprom: implement ->compat_ioctl
implement a compat_ioctl handle in the driver instead of having table entries in sparc64 ioctl32.c (I plan to get rid of the arch ioctl32.c file eventually) Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/sbus/char/openprom.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 58ed33749571..5028ac214326 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -39,6 +39,7 @@
39#include <linux/slab.h> 39#include <linux/slab.h>
40#include <linux/string.h> 40#include <linux/string.h>
41#include <linux/miscdevice.h> 41#include <linux/miscdevice.h>
42#include <linux/smp_lock.h>
42#include <linux/init.h> 43#include <linux/init.h>
43#include <linux/fs.h> 44#include <linux/fs.h>
44#include <asm/oplib.h> 45#include <asm/oplib.h>
@@ -565,6 +566,38 @@ static int openprom_ioctl(struct inode * inode, struct file * file,
565 } 566 }
566} 567}
567 568
569static long openprom_compat_ioctl(struct file *file, unsigned int cmd,
570 unsigned long arg)
571{
572 long rval = -ENOTTY;
573
574 /*
575 * SunOS/Solaris only, the NetBSD one's have embedded pointers in
576 * the arg which we'd need to clean up...
577 */
578 switch (cmd) {
579 case OPROMGETOPT:
580 case OPROMSETOPT:
581 case OPROMNXTOPT:
582 case OPROMSETOPT2:
583 case OPROMNEXT:
584 case OPROMCHILD:
585 case OPROMGETPROP:
586 case OPROMNXTPROP:
587 case OPROMU2P:
588 case OPROMGETCONS:
589 case OPROMGETFBNAME:
590 case OPROMGETBOOTARGS:
591 case OPROMSETCUR:
592 case OPROMPCI2NODE:
593 case OPROMPATH2NODE:
594 lock_kernel();
595 rval = openprom_ioctl(file->f_dentry->d_inode, file, cmd, arg);
596 lock_kernel();
597 break;
598 }
599}
600
568static int openprom_open(struct inode * inode, struct file * file) 601static int openprom_open(struct inode * inode, struct file * file)
569{ 602{
570 DATA *data; 603 DATA *data;