Enscript Output

extractedLnx/linux-2.2.26/arch/sparc64/kernel/ioctl32.c_sys32_ioctl.c

asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
{
	struct file * filp;
	int error = -EBADF;

	lock_kernel();
	filp = fget(fd);
	if(!filp)
		goto out2;

	if (!filp->f_op || !filp->f_op->ioctl) {
		error = sys_ioctl (fd, cmd, arg);
		goto out;
	}
	switch (cmd) {
	case SIOCGIFNAME:
		error = dev_ifname32(fd, arg);
		goto out;

	case SIOCGIFCONF:
		error = dev_ifconf(fd, arg);
		goto out;
		
	case SIOCGIFFLAGS:
	case SIOCSIFFLAGS:
	case SIOCGIFMETRIC:
	case SIOCSIFMETRIC:
	case SIOCGIFMTU:
	case SIOCSIFMTU:
	case SIOCGIFMEM:
	case SIOCSIFMEM:
	case SIOCGIFHWADDR:
	case SIOCSIFHWADDR:
	case SIOCADDMULTI:
	case SIOCDELMULTI:
	case SIOCGIFINDEX:
	case SIOCGIFMAP:
	case SIOCSIFMAP:
	case SIOCGIFADDR:
	case SIOCSIFADDR:
	case SIOCGIFBRDADDR:
	case SIOCSIFBRDADDR:
	case SIOCGIFDSTADDR:
	case SIOCSIFDSTADDR:
	case SIOCGIFNETMASK:
	case SIOCSIFNETMASK:
	case SIOCSIFPFLAGS:
	case SIOCGIFPFLAGS:
	case SIOCGPPPSTATS:
	case SIOCGPPPCSTATS:
	case SIOCGPPPVER:
	case SIOCGIFTXQLEN:
	case SIOCSIFTXQLEN:
	case SIOCETHTOOL:
		error = dev_ifsioc(fd, cmd, arg);
		goto out;
		
	case SIOCADDRT:
	case SIOCDELRT:
		error = routing_ioctl(fd, cmd, arg);
		goto out;

	case SIOCRTMSG: /* Note SIOCRTMSG is no longer, so this is safe and
			 * the user would have seen just an -EINVAL anyways.
			 */
		error = -EINVAL;
		goto out;

	case SIOCGSTAMP:
		/* Sorry, timeval in the kernel is different now. */
		error = do_siocgstamp(fd, cmd, arg);
		goto out;

	case HDIO_GETGEO:
		error = hdio_getgeo(fd, arg);
		goto out;
		
	case BLKRAGET:
	case BLKGETSIZE:
	case 0x1260:
		/* The mkswap binary hard codes it to Intel value :-((( */
		if(cmd == 0x1260)
			cmd = BLKGETSIZE;
		error = w_long(fd, cmd, arg);
		goto out;
		
	case FBIOPUTCMAP32:
	case FBIOGETCMAP32:
		error = fbiogetputcmap(fd, cmd, arg);
		goto out;
		
	case FBIOSCURSOR32:
		error = fbiogscursor(fd, cmd, arg);
		goto out;

	case FBIOGET_FSCREENINFO:
	case FBIOGETCMAP:
	case FBIOPUTCMAP:
		error = fb_ioctl_trans(fd, cmd, arg);
		goto out;

	case HDIO_GET_KEEPSETTINGS:
	case HDIO_GET_UNMASKINTR:
	case HDIO_GET_DMA:
	case HDIO_GET_32BIT:
	case HDIO_GET_MULTCOUNT:
	case HDIO_GET_NOWERR:
	case HDIO_GET_NICE:
		error = hdio_ioctl_trans(fd, cmd, arg);
		goto out;

	case FDSETPRM32:
	case FDDEFPRM32:
	case FDGETPRM32:
	case FDSETDRVPRM32:
	case FDGETDRVPRM32:
	case FDGETDRVSTAT32:
	case FDPOLLDRVSTAT32:
	case FDGETFDCSTAT32:
	case FDWERRORGET32:
		error = fd_ioctl_trans(fd, cmd, arg);
		goto out;

	case PPPIOCGIDLE32:
	case PPPIOCSCOMPRESS32:
		error = ppp_ioctl_trans(fd, cmd, arg);
		goto out;

	case MTIOCGET32:
	case MTIOCPOS32:
	case MTIOCGETCONFIG32:
	case MTIOCSETCONFIG32:
		error = mt_ioctl_trans(fd, cmd, arg);
		goto out;

	case CDROMREADMODE2:
	case CDROMREADMODE1:
	case CDROMREADRAW:
	case CDROMREADCOOKED:
	case CDROMREADAUDIO:
	case CDROMREADALL:
		error = cdrom_ioctl_trans(fd, cmd, arg);
		goto out;
		
	case LOOP_SET_STATUS:
	case LOOP_GET_STATUS:
		error = loop_status(fd, cmd, arg);
		goto out;

#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int)
	case AUTOFS_IOC_SETTIMEOUT32:
		error = rw_long(fd, AUTOFS_IOC_SETTIMEOUT, arg);
		goto out;
		
	case PIO_FONTX:
	case GIO_FONTX:
		error = do_fontx_ioctl(filp, cmd, (struct consolefontdesc32 *)arg);
		goto out;
		
	case PIO_UNIMAP:
	case GIO_UNIMAP:
		error = do_unimap_ioctl(filp, cmd, (struct unimapdesc32 *)arg);
		goto out;

	case KDFONTOP:
		error = do_kdfontop_ioctl(filp, (struct console_font_op32 *)arg);
		goto out;
		
	case EXT2_IOC32_GETFLAGS:
	case EXT2_IOC32_SETFLAGS:
	case EXT2_IOC32_GETVERSION:
	case EXT2_IOC32_SETVERSION:
		error = do_ext2_ioctl(fd, cmd, arg);
		goto out;
		
	case VIDIOCGTUNER32:
	case VIDIOCSTUNER32:
	case VIDIOCGWIN32:
	case VIDIOCSWIN32:
	case VIDIOCGFBUF32:
	case VIDIOCSFBUF32:
	case VIDIOCGFREQ32:
	case VIDIOCSFREQ32:
		error = do_video_ioctl(fd, cmd, arg);
		goto out;

	/* One SMB ioctl needs translations. */
	case _IOR('u', 1, __kernel_uid_t32): /* SMB_IOC_GETMOUNTUID */
		error = do_smb_getmountuid(fd, cmd, arg);
		goto out;

#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
	case DRM32_IOCTL_VERSION:
		error = drm32_version(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_GET_UNIQUE:
		error = drm32_getsetunique(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_SET_UNIQUE:
		error = drm32_getsetunique(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_ADD_MAP:
		error = drm32_addmap(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_INFO_BUFS:
		error = drm32_info_bufs(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_FREE_BUFS:
		error = drm32_free_bufs(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_MAP_BUFS:
		error = drm32_map_bufs(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_DMA:
		error = drm32_dma(fd, cmd, arg);
		goto out;

	case DRM32_IOCTL_RES_CTX:
		error = drm32_res_ctx(fd, cmd, arg);
		goto out;
#endif /* DRM */

	/* List here exlicitly which ioctl's are known to have
	 * compatable types passed or none at all...
	 */

	/* Big T */
	case TCGETA:
	case TCSETA:
	case TCSETAW:
	case TCSETAF:
	case TCSBRK:
	case TCXONC:
	case TCFLSH:
	case TCGETS:
	case TCSETS:
	case TCSETSW:
	case TCSETSF:
	case TIOCLINUX:

	/* Little t */
	case TIOCGETD:
	case TIOCSETD:
	case TIOCEXCL:
	case TIOCNXCL:
	case TIOCCONS:
	case TIOCGSOFTCAR:
	case TIOCSSOFTCAR:
	case TIOCSWINSZ:
	case TIOCGWINSZ:
	case TIOCMGET:
	case TIOCMBIC:
	case TIOCMBIS:
	case TIOCMSET:
	case TIOCPKT:
	case TIOCNOTTY:
	case TIOCSTI:
	case TIOCOUTQ:
	case TIOCSPGRP:
	case TIOCGPGRP:
	case TIOCSCTTY:
	case TIOCGPTN:
	case TIOCSPTLCK:
	case TIOCGSERIAL:
	case TIOCSSERIAL:
	case TIOCSERGETLSR:
	
	/* Big F */
	case FBIOGTYPE:
	case FBIOSATTR:
	case FBIOGATTR:
	case FBIOSVIDEO:
	case FBIOGVIDEO:
	case FBIOGCURSOR32: /* This is not implemented yet. Later it should be converted... */
	case FBIOSCURPOS:
	case FBIOGCURPOS:
	case FBIOGCURMAX:

	case FBIOGET_VSCREENINFO:
	case FBIOPUT_VSCREENINFO:
	case FBIOPAN_DISPLAY:
	case FBIOGET_FCURSORINFO:
	case FBIOGET_VCURSORINFO:
	case FBIOPUT_VCURSORINFO:
	case FBIOGET_CURSORSTATE:
	case FBIOPUT_CURSORSTATE:
	case FBIOGET_CON2FBMAP:
	case FBIOPUT_CON2FBMAP:

	/* Little f */
	case FIOCLEX:
	case FIONCLEX:
	case FIOASYNC:
	case FIONBIO:
	case FIONREAD: /* This is also TIOCINQ */
	
	/* 0x00 */
	case FIBMAP:
	case FIGETBSZ:
	
	/* 0x03 -- HD/IDE ioctl's used by hdparm and friends.
	 *         Some need translations, these do not.
	 */
	case HDIO_GET_IDENTITY:
	case HDIO_SET_DMA:
	case HDIO_SET_KEEPSETTINGS:
	case HDIO_SET_UNMASKINTR:
	case HDIO_SET_NOWERR:
	case HDIO_SET_32BIT:
	case HDIO_SET_MULTCOUNT:
	case HDIO_DRIVE_CMD:
	case HDIO_SET_PIO_MODE:
	case HDIO_SCAN_HWIF:
	case HDIO_SET_NICE:
	case BLKROSET:
	case BLKROGET:
	case BLKELVGET:
	case BLKELVSET:

	/* 0x02 -- Floppy ioctls */
	case FDMSGON:
	case FDMSGOFF:
	case FDSETEMSGTRESH:
	case FDFLUSH:
	case FDWERRORCLR:
	case FDSETMAXERRS:
	case FDGETMAXERRS:
	case FDGETDRVTYP:
	case FDEJECT:
	case FDCLRPRM:
	case FDFMTBEG:
	case FDFMTEND:
	case FDRESET:
	case FDTWADDLE:
	case FDFMTTRK:
	case FDRAWCMD:

	/* 0x12 */
	case BLKRRPART:
	case BLKFLSBUF:
	case BLKRASET:
	
	/* 0x09 */
	case /* RAID_VERSION */		_IOR (MD_MAJOR, 0x10, char[12]):
	case /* GET_ARRAY_INFO */	_IOR (MD_MAJOR, 0x11, char[72]):
	case /* GET_DISK_INFO */	_IOR (MD_MAJOR, 0x12, char[20]):
	case /* CLEAR_ARRAY */		_IO (MD_MAJOR, 0x20):
	case /* ADD_NEW_DISK */		_IOW (MD_MAJOR, 0x21, char[20]):
	case /* HOT_REMOVE_DISK */	_IO (MD_MAJOR, 0x22):
	case /* SET_ARRAY_INFO */	_IOW (MD_MAJOR, 0x23, char[72]):
	case /* SET_DISK_INFO */	_IO (MD_MAJOR, 0x24):
	case /* WRITE_RAID_INFO */	_IO (MD_MAJOR, 0x25):
	case /* UNPROTECT_ARRAY */	_IO (MD_MAJOR, 0x26):
	case /* PROTECT_ARRAY */	_IO (MD_MAJOR, 0x27):
	case /* HOT_ADD_DISK */		_IO (MD_MAJOR, 0x28):
	case /* RUN_ARRAY */		_IOW (MD_MAJOR, 0x30, char[12]):
	case /* START_ARRAY */		_IO (MD_MAJOR, 0x31):
	case /* STOP_ARRAY */		_IO (MD_MAJOR, 0x32):
	case /* STOP_ARRAY_RO */	_IO (MD_MAJOR, 0x33):
	case /* RESTART_ARRAY_RW */	_IO (MD_MAJOR, 0x34):
	case /* PRINT_RAID_DEBUG */	_IO (MD_MAJOR, 0x13):
	case /* SET_DISK_FAULTY */	_IO (MD_MAJOR, 0x29):

	/* Big K */
	case PIO_FONT:
	case GIO_FONT:
	case KDSIGACCEPT:
	case KDGETKEYCODE:
	case KDSETKEYCODE:
	case KIOCSOUND:
	case KDMKTONE:
	case KDGKBTYPE:
	case KDSETMODE:
	case KDGETMODE:
	case KDSKBMODE:
	case KDGKBMODE:
	case KDSKBMETA:
	case KDGKBMETA:
	case KDGKBENT:
	case KDSKBENT:
	case KDGKBSENT:
	case KDSKBSENT:
	case KDGKBDIACR:
	case KDSKBDIACR:
	case KDGKBLED:
	case KDSKBLED:
	case KDGETLED:
	case KDSETLED:
	case GIO_SCRNMAP:
	case PIO_SCRNMAP:
	case GIO_UNISCRNMAP:
	case PIO_UNISCRNMAP:
	case PIO_FONTRESET:
	case PIO_UNIMAPCLR:
	
	/* Little k */
	case KIOCTYPE:
	case KIOCLAYOUT:
	case KIOCGTRANS:
	case KIOCTRANS:
	case KIOCCMD:
	case KIOCSDIRECT:
	case KIOCSLED:
	case KIOCGLED:
	case KIOCSRATE:
	case KIOCGRATE:
	
	/* Big S */
	case SCSI_IOCTL_GET_IDLUN:
	case SCSI_IOCTL_DOORLOCK:
	case SCSI_IOCTL_DOORUNLOCK:
	case SCSI_IOCTL_TEST_UNIT_READY:
	case SCSI_IOCTL_TAGGED_ENABLE:
	case SCSI_IOCTL_TAGGED_DISABLE:
	case SCSI_IOCTL_GET_BUS_NUMBER:
	case SCSI_IOCTL_SEND_COMMAND:
	
	/* Big V */
	case VT_SETMODE:
	case VT_GETMODE:
	case VT_GETSTATE:
	case VT_OPENQRY:
	case VT_ACTIVATE:
	case VT_WAITACTIVE:
	case VT_RELDISP:
	case VT_DISALLOCATE:
	case VT_RESIZE:
	case VT_RESIZEX:
	case VT_LOCKSWITCH:
	case VT_UNLOCKSWITCH:
	
	/* Little v */
	case VUIDSFORMAT:
	case VUIDGFORMAT:

	/* Little v, the video4linux ioctls */
	case VIDIOCGCAP:
	case VIDIOCGCHAN:
	case VIDIOCSCHAN:
	case VIDIOCGPICT:
	case VIDIOCSPICT:
	case VIDIOCCAPTURE:
	case VIDIOCKEY:
	case VIDIOCGAUDIO:
	case VIDIOCSAUDIO:
	case VIDIOCSYNC:
	case VIDIOCMCAPTURE:
	case VIDIOCGMBUF:
	case VIDIOCGUNIT:
	case VIDIOCGCAPTURE:
	case VIDIOCSCAPTURE:

	/* BTTV specific... */
	case _IOW('v',  BASE_VIDIOCPRIVATE+0, char [256]):
	case _IOR('v',  BASE_VIDIOCPRIVATE+1, char [256]):
	case _IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int):
	case _IOW('v' , BASE_VIDIOCPRIVATE+3, char [16]): /* struct bttv_pll_info */
	case _IOR('v' , BASE_VIDIOCPRIVATE+4, int):
	case _IOR('v' , BASE_VIDIOCPRIVATE+5, int):
	case _IOR('v' , BASE_VIDIOCPRIVATE+6, int):
	case _IOR('v' , BASE_VIDIOCPRIVATE+7, int):

	/* Little p (/dev/rtc, /dev/envctrl, /dev/d7s, etc.) */
	case RTCGET:
	case RTCSET:
	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:
	case ENVCTRL_RD_GLOBALADDRESS:
	case D7SIOCWR:
	/* case D7SIOCRD: Same value as ENVCTRL_RD_VOLTAGE_STATUS */
	case D7SIOCTM:

	/* Big R */
	case RNDGETENTCNT:
	case RNDADDTOENTCNT:
	case RNDGETPOOL:
	case RNDADDENTROPY:
	case RNDZAPENTCNT:
	case RNDCLEARPOOL:

	/* Little m */
	case MTIOCTOP:

	/* OPENPROMIO, SunOS/Solaris only, the NetBSD one's have
	 * embedded pointers in the arg which we'd need to clean up...
	 */
	case OPROMGETOPT:
	case OPROMSETOPT:
	case OPROMNXTOPT:
	case OPROMSETOPT2:
	case OPROMNEXT:
	case OPROMCHILD:
	case OPROMGETPROP:
	case OPROMNXTPROP:
	case OPROMU2P:
	case OPROMGETCONS:
	case OPROMGETFBNAME:
	case OPROMGETBOOTARGS:
	case OPROMSETCUR:
	case OPROMPCI2NODE:
	case OPROMPATH2NODE:

	/* Socket level stuff */
	case FIOSETOWN:
	case SIOCSPGRP:
	case FIOGETOWN:
	case SIOCGPGRP:
	case SIOCATMARK:
	case SIOCSIFLINK:
	case SIOCSIFENCAP:
	case SIOCGIFENCAP:
	case SIOCSIFBR:
	case SIOCGIFBR:
	case SIOCSARP:
	case SIOCGARP:
	case SIOCDARP:
#if 0 /* XXX No longer exist in new routing code. XXX */
	case OLD_SIOCSARP:
	case OLD_SIOCGARP:
	case OLD_SIOCDARP:
#endif
	case SIOCSRARP:
	case SIOCGRARP:
	case SIOCDRARP:
	case SIOCADDDLCI:
	case SIOCDELDLCI:
	
	/* SG stuff */
	case SG_SET_TIMEOUT:
	case SG_GET_TIMEOUT:
	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:
	case PPPIOCSFLAGS:
	case PPPIOCGASYNCMAP:
	case PPPIOCSASYNCMAP:
	case PPPIOCGUNIT:
	case PPPIOCGRASYNCMAP:
	case PPPIOCSRASYNCMAP:
	case PPPIOCGMRU:
	case PPPIOCSMRU:
	case PPPIOCSMAXCID:
	case PPPIOCGXASYNCMAP:
	case PPPIOCSXASYNCMAP:
	case PPPIOCXFERUNIT:
	case PPPIOCGNPMODE:
	case PPPIOCSNPMODE:
	case PPPIOCGDEBUG:
	case PPPIOCSDEBUG:

	/* CDROM stuff */
	case CDROMPAUSE:
	case CDROMRESUME:
	case CDROMPLAYMSF:
	case CDROMPLAYTRKIND:
	case CDROMREADTOCHDR:
	case CDROMREADTOCENTRY:
	case CDROMSTOP:
	case CDROMSTART:
	case CDROMEJECT:
	case CDROMVOLCTRL:
	case CDROMSUBCHNL:
	case CDROMEJECT_SW:
	case CDROMMULTISESSION:
	case CDROM_GET_MCN:
	case CDROMRESET:
	case CDROMVOLREAD:
	case CDROMSEEK:
	case CDROMPLAYBLK:
	case CDROMCLOSETRAY:
	case CDROM_SET_OPTIONS:
	case CDROM_CLEAR_OPTIONS:
	case CDROM_SELECT_SPEED:
	case CDROM_SELECT_DISC:
	case CDROM_MEDIA_CHANGED:
	case CDROM_DRIVE_STATUS:
	case CDROM_DISC_STATUS:
	case CDROM_CHANGER_NSLOTS:
	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:
	case LOOP_CLR_FD:
	
	/* Big A */
	case AUDIO_GETINFO:
	case AUDIO_SETINFO:
	case AUDIO_DRAIN:
	case AUDIO_GETDEV:
	case AUDIO_GETDEV_SUNOS:
	case AUDIO_FLUSH:

	/* Big Q for sound/OSS */
	case SNDCTL_SEQ_RESET:
	case SNDCTL_SEQ_SYNC:
	case SNDCTL_SYNTH_INFO:
	case SNDCTL_SEQ_CTRLRATE:
	case SNDCTL_SEQ_GETOUTCOUNT:
	case SNDCTL_SEQ_GETINCOUNT:
	case SNDCTL_SEQ_PERCMODE:
	case SNDCTL_FM_LOAD_INSTR:
	case SNDCTL_SEQ_TESTMIDI:
	case SNDCTL_SEQ_RESETSAMPLES:
	case SNDCTL_SEQ_NRSYNTHS:
	case SNDCTL_SEQ_NRMIDIS:
	case SNDCTL_MIDI_INFO:
	case SNDCTL_SEQ_THRESHOLD:
	case SNDCTL_SYNTH_MEMAVL:
	case SNDCTL_FM_4OP_ENABLE:
	case SNDCTL_SEQ_PANIC:
	case SNDCTL_SEQ_OUTOFBAND:
	case SNDCTL_SEQ_GETTIME:
	case SNDCTL_SYNTH_ID:
	case SNDCTL_SYNTH_CONTROL:
	case SNDCTL_SYNTH_REMOVESAMPLE:

	/* Big T for sound/OSS */
	case SNDCTL_TMR_TIMEBASE:
	case SNDCTL_TMR_START:
	case SNDCTL_TMR_STOP:
	case SNDCTL_TMR_CONTINUE:
	case SNDCTL_TMR_TEMPO:
	case SNDCTL_TMR_SOURCE:
	case SNDCTL_TMR_METRONOME:
	case SNDCTL_TMR_SELECT:

	/* Little m for sound/OSS */
	case SNDCTL_MIDI_PRETIME:
	case SNDCTL_MIDI_MPUMODE:
	case SNDCTL_MIDI_MPUCMD:

	/* Big P for sound/OSS */
	case SNDCTL_DSP_RESET:
	case SNDCTL_DSP_SYNC:
	case SNDCTL_DSP_SPEED:
	case SNDCTL_DSP_STEREO:
	case SNDCTL_DSP_GETBLKSIZE:
	case SNDCTL_DSP_CHANNELS:
	case SOUND_PCM_WRITE_FILTER:
	case SNDCTL_DSP_POST:
	case SNDCTL_DSP_SUBDIVIDE:
	case SNDCTL_DSP_SETFRAGMENT:
	case SNDCTL_DSP_GETFMTS:
	case SNDCTL_DSP_SETFMT:
	case SNDCTL_DSP_GETOSPACE:
	case SNDCTL_DSP_GETISPACE:
	case SNDCTL_DSP_NONBLOCK:
	case SNDCTL_DSP_GETCAPS:
	case SNDCTL_DSP_GETTRIGGER:
	case SNDCTL_DSP_SETTRIGGER:
	case SNDCTL_DSP_GETIPTR:
	case SNDCTL_DSP_GETOPTR:
	/* case SNDCTL_DSP_MAPINBUF: XXX needs translation */
	/* case SNDCTL_DSP_MAPOUTBUF: XXX needs translation */
	case SNDCTL_DSP_SETSYNCRO:
	case SNDCTL_DSP_SETDUPLEX:
	case SNDCTL_DSP_GETODELAY:
	case SNDCTL_DSP_PROFILE:

	case SOUND_PCM_READ_RATE:
	case SOUND_PCM_READ_CHANNELS:
	case SOUND_PCM_READ_BITS:
	case SOUND_PCM_READ_FILTER:

	/* Big C for sound/OSS */
	case SNDCTL_COPR_RESET:
	case SNDCTL_COPR_LOAD:
	case SNDCTL_COPR_RDATA:
	case SNDCTL_COPR_RCODE:
	case SNDCTL_COPR_WDATA:
	case SNDCTL_COPR_WCODE:
	case SNDCTL_COPR_RUN:
	case SNDCTL_COPR_HALT:
	case SNDCTL_COPR_SENDMSG:
	case SNDCTL_COPR_RCVMSG:

	/* Big M for sound/OSS */
	case SOUND_MIXER_READ_VOLUME:
	case SOUND_MIXER_READ_BASS:
	case SOUND_MIXER_READ_TREBLE:
	case SOUND_MIXER_READ_SYNTH:
	case SOUND_MIXER_READ_PCM:
	case SOUND_MIXER_READ_SPEAKER:
	case SOUND_MIXER_READ_LINE:
	case SOUND_MIXER_READ_MIC:
	case SOUND_MIXER_READ_CD:
	case SOUND_MIXER_READ_IMIX:
	case SOUND_MIXER_READ_ALTPCM:
	case SOUND_MIXER_READ_RECLEV:
	case SOUND_MIXER_READ_IGAIN:
	case SOUND_MIXER_READ_OGAIN:
	case SOUND_MIXER_READ_LINE1:
	case SOUND_MIXER_READ_LINE2:
	case SOUND_MIXER_READ_LINE3:
	case SOUND_MIXER_READ_MUTE:
	/* case SOUND_MIXER_READ_ENHANCE: same value as READ_MUTE */
	/* case SOUND_MIXER_READ_LOUD: same value as READ_MUTE */
	case SOUND_MIXER_READ_RECSRC:
	case SOUND_MIXER_READ_DEVMASK:
	case SOUND_MIXER_READ_RECMASK:
	case SOUND_MIXER_READ_STEREODEVS:
	case SOUND_MIXER_READ_CAPS:

	case SOUND_MIXER_WRITE_VOLUME:
	case SOUND_MIXER_WRITE_BASS:
	case SOUND_MIXER_WRITE_TREBLE:
	case SOUND_MIXER_WRITE_SYNTH:
	case SOUND_MIXER_WRITE_PCM:
	case SOUND_MIXER_WRITE_SPEAKER:
	case SOUND_MIXER_WRITE_LINE:
	case SOUND_MIXER_WRITE_MIC:
	case SOUND_MIXER_WRITE_CD:
	case SOUND_MIXER_WRITE_IMIX:
	case SOUND_MIXER_WRITE_ALTPCM:
	case SOUND_MIXER_WRITE_RECLEV:
	case SOUND_MIXER_WRITE_IGAIN:
	case SOUND_MIXER_WRITE_OGAIN:
	case SOUND_MIXER_WRITE_LINE1:
	case SOUND_MIXER_WRITE_LINE2:
	case SOUND_MIXER_WRITE_LINE3:
	case SOUND_MIXER_WRITE_MUTE:
	/* case SOUND_MIXER_WRITE_ENHANCE: same value as WRITE_MUTE */
	/* case SOUND_MIXER_WRITE_LOUD: same value as WRITE_MUTE */
	case SOUND_MIXER_WRITE_RECSRC:

	case SOUND_MIXER_INFO:
	case SOUND_OLD_MIXER_INFO:
	case SOUND_MIXER_ACCESS:
	case SOUND_MIXER_PRIVATE1:
	case SOUND_MIXER_PRIVATE2:
	case SOUND_MIXER_PRIVATE3:
	case SOUND_MIXER_PRIVATE4:
	case SOUND_MIXER_PRIVATE5:
	case SOUND_MIXER_GETLEVELS:
	case SOUND_MIXER_SETLEVELS:

	case OSS_GETVERSION:

	/* AUTOFS */
	case AUTOFS_IOC_READY:
	case AUTOFS_IOC_FAIL:
	case AUTOFS_IOC_CATATONIC:
	case AUTOFS_IOC_PROTOVER:
	case AUTOFS_IOC_EXPIRE:

	/* Big W for hardware watchdog timers */
	/* WIOC_GETSUPPORT not yet implemented -E */
	case WDIOC_GETSTATUS:
	case WDIOC_GETBOOTSTATUS:
	case WDIOC_GETTEMP:
	case WDIOC_SETOPTIONS:
	case WDIOC_KEEPALIVE:
	case WIOCSTART:
	case WIOCSTOP:
	case WIOCGSTAT:
	
	/* Raw devices */
	case _IO(0xac, 0): /* RAW_SETBIND */
	case _IO(0xac, 1): /* RAW_GETBIND */

	/* SMB ioctls which do not need any translations */
	case SMB_IOC_NEWCONN:

#if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
	/* DRM ioctls which do not need any translations */
	case DRM_IOCTL_GET_MAGIC:
	case DRM_IOCTL_IRQ_BUSID:
	case DRM_IOCTL_AUTH_MAGIC:
	case DRM_IOCTL_BLOCK:
	case DRM_IOCTL_UNBLOCK:
	case DRM_IOCTL_CONTROL:
	case DRM_IOCTL_ADD_BUFS:
	case DRM_IOCTL_MARK_BUFS:
	case DRM_IOCTL_ADD_CTX:
	case DRM_IOCTL_RM_CTX:
	case DRM_IOCTL_MOD_CTX:
	case DRM_IOCTL_GET_CTX:
	case DRM_IOCTL_SWITCH_CTX:
	case DRM_IOCTL_NEW_CTX:
	case DRM_IOCTL_ADD_DRAW:
	case DRM_IOCTL_RM_DRAW:
	case DRM_IOCTL_LOCK:
	case DRM_IOCTL_UNLOCK:
	case DRM_IOCTL_FINISH:
#endif /* DRM */

	/* Misc. */
	case 0x41545900:		/* ATYIO_CLKR */
	case 0x41545901:		/* ATYIO_CLKW */
	case PCIIOC_CONTROLLER:
	case PCIIOC_MMAP_IS_IO:
	case PCIIOC_MMAP_IS_MEM:
	case PCIIOC_WRITE_COMBINE:

		error = sys_ioctl (fd, cmd, arg);
		goto out;

	default:
		do {
			static int count = 0;
			if (++count <= 20)
				printk("sys32_ioctl: Unknown cmd fd(%d) "
				       "cmd(%08x) arg(%08x)\n",
				       (int)fd, (unsigned int)cmd, (unsigned int)arg);
		} while(0);
		error = -EINVAL;
		goto out;
	}
out:
	fput(filp);
out2:
	unlock_kernel();
	return error;
}

Generated by GNU enscript 1.6.4.