patch-2.2.16 linux/arch/sparc64/kernel/ioctl32.c

Next file: linux/arch/sparc64/kernel/psycho.c
Previous file: linux/arch/sparc64/defconfig
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/arch/sparc64/kernel/ioctl32.c linux/arch/sparc64/kernel/ioctl32.c
@@ -1,8 +1,10 @@
-/* $Id: ioctl32.c,v 1.62.2.9 2000/01/15 04:40:57 davem Exp $
+/* $Id: ioctl32.c,v 1.62.2.12 2000/05/27 04:46:26 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997  Jakub Jelinek  (jj@sunsite.mff.cuni.cz)
  * Copyright (C) 1998  Eddie C. Dost  (ecd@skynet.be)
+ * Copyright (C) 2000  Vinh Truong (vinh.truong@eng.sun.com)
+ *              --- VT: add commands for envctrl driver in sys32_ioctl()
  *
  * These routines maintain argument size conversion between 32bit and 64bit
  * ioctls.
@@ -38,6 +40,7 @@
 #include <linux/videodev.h>
 #include <linux/netdevice.h>
 #include <linux/smb_fs.h>
+#include <linux/blkdev.h>
 
 #include <scsi/scsi.h>
 /* Ugly hack. */
@@ -1437,11 +1440,21 @@
 	__kernel_caddr_t32	buf;
 };
 
+struct cdrom_generic_command32 {
+	unsigned char		cmd[CDROM_PACKET_SIZE];
+	__kernel_caddr_t32	buffer;
+	unsigned int		buflen;
+	int			stat;
+	__kernel_caddr_t32	sense;
+	__kernel_caddr_t32	reserved[3];
+};
+
 static int cdrom_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
 {
 	mm_segment_t old_fs = get_fs();
 	struct cdrom_read cdread;
 	struct cdrom_read_audio cdreadaudio;
+	struct cdrom_generic_command cgc;
 	__kernel_caddr_t32 addr;
 	char *data = 0;
 	void *karg;
@@ -1476,6 +1489,17 @@
 			return -ENOMEM;
 		cdreadaudio.buf = data;
 		break;
+	case CDROM_SEND_PACKET:
+		karg = &cgc;
+		err = copy_from_user(cgc.cmd, &((struct cdrom_generic_command32 *)arg)->cmd, sizeof(cgc.cmd));
+		err |= __get_user(addr, &((struct cdrom_generic_command32 *)arg)->buffer);
+		err |= __get_user(cgc.buflen, &((struct cdrom_generic_command32 *)arg)->buflen);
+		if (err)
+		return -EFAULT;
+		if ((data = kmalloc(cgc.buflen, GFP_KERNEL)) == NULL)
+			return -ENOMEM;
+		cgc.buffer = data;
+		break;
 	default:
 		do {
 			static int count = 0;
@@ -1501,11 +1525,14 @@
 	case CDROMREADAUDIO:
 		err = copy_to_user((char *)A(addr), data, cdreadaudio.nframes * 2352);
 		break;
+	case CDROM_SEND_PACKET:
+		err = copy_to_user((char *)A(addr), data, cgc.buflen);
 	default:
 		break;
 	}
-out:	if (data) kfree(data);
-	return err;
+out:	if (data)
+		kfree(data);
+	return err ? -EFAULT : 0;
 }
 
 struct loop_info32 {
@@ -1996,6 +2023,8 @@
 	case HDIO_SET_NICE:
 	case BLKROSET:
 	case BLKROGET:
+	case BLKELVGET:
+	case BLKELVSET:
 
 	/* 0x02 -- Floppy ioctls */
 	case FDMSGON:
@@ -2141,8 +2170,16 @@
 	/* Little p (/dev/rtc, /dev/envctrl, etc.) */
 	case RTCGET:
 	case RTCSET:
-	case I2CIOCSADR:
-	case I2CIOCGADR:
+	case ENVCTRL_RD_WARNING_TEMPERATURE:
+	case ENVCTRL_RD_SHUTDOWN_TEMPERATURE:
+	case ENVCTRL_RD_CPU_TEMPERATURE:
+	case ENVCTRL_RD_FAN_STATUS:
+	case ENVCTRL_RD_VOLTAGE_STATUS:
+	case ENVCTRL_RD_SCSI_TEMPERATURE:
+	case ENVCTRL_RD_ETHERNET_TEMPERATURE:
+	case ENVCTRL_RD_MTHRBD_TEMPERATURE:
+	case ENVCTRL_RD_CPU_VOLTAGE:
+
 
 	/* Little m */
 	case MTIOCTOP:
@@ -2197,6 +2234,25 @@
 	case SG_EMULATED_HOST:
 	case SG_SET_TRANSFORM:
 	case SG_GET_TRANSFORM:
+	case SG_SET_RESERVED_SIZE:
+	case SG_GET_RESERVED_SIZE:
+	case SG_GET_SCSI_ID:
+	case SG_SET_FORCE_LOW_DMA:
+	case SG_GET_LOW_DMA:
+	case SG_SET_FORCE_PACK_ID:
+	case SG_GET_PACK_ID:
+	case SG_GET_NUM_WAITING:
+	case SG_SET_DEBUG:
+	case SG_GET_SG_TABLESIZE:
+	case SG_GET_MERGE_FD:
+	case SG_SET_MERGE_FD:
+	case SG_GET_COMMAND_Q:
+	case SG_SET_COMMAND_Q:
+	case SG_GET_UNDERRUN_FLAG:
+	case SG_SET_UNDERRUN_FLAG:
+	case SG_GET_VERSION_NUM:
+	case SG_NEXT_CMD_LEN:
+	case SG_SCSI_RESET:
 
 	/* PPP stuff */
 	case PPPIOCGFLAGS:
@@ -2248,6 +2304,12 @@
 	case CDROM_LOCKDOOR:
 	case CDROM_DEBUG:
 	case CDROM_GET_CAPABILITY:
+	case DVD_READ_STRUCT:
+	case DVD_WRITE_STRUCT:
+	case DVD_AUTH:
+	case CDROM_SEND_PACKET:
+	case CDROM_NEXT_WRITABLE:
+	case CDROM_LAST_WRITTEN:
 	
 	/* Big L */
 	case LOOP_SET_FD:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)