1 /* $Id: ioctl.c,v 1.16.2.1 2002/03/03 23:41:26 davem Exp $
2 * ioctl.c: Solaris ioctl emulation.
4 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 * Copyright (C) 1997,1998 Patrik Rak (prak3264@ss1000.ms.mff.cuni.cz)
7 * Streams & timod emulation based on code
8 * Copyright (C) 1995, 1996 Mike Jagdis (jaggy@purplet.demon.co.uk)
10 * 1999-08-19 Implemented solaris 'm' (mag tape) and
11 * 'O' (openprom) ioctls, by Jason Rappleye
12 * (rappleye@ccr.buffalo.edu)
15 #include <linux/types.h>
16 #include <linux/kernel.h>
17 #include <linux/sched.h>
18 #include <linux/smp.h>
19 #include <linux/smp_lock.h>
20 #include <linux/ioctl.h>
22 #include <linux/file.h>
23 #include <linux/netdevice.h>
24 #include <linux/mtio.h>
25 #include <linux/time.h>
27 #include <asm/uaccess.h>
28 #include <asm/termios.h>
29 #include <asm/openpromio.h>
34 extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
36 extern asmlinkage int sys32_ioctl(unsigned int fd, unsigned int cmd,
38 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
40 extern int timod_putmsg(unsigned int fd, char *ctl_buf, int ctl_len,
41 char *data_buf, int data_len, int flags);
42 extern int timod_getmsg(unsigned int fd, char *ctl_buf, int ctl_maxlen, int *ctl_len,
43 char *data_buf, int data_maxlen, int *data_len, int *flags);
45 /* termio* stuff {{{ */
47 struct solaris_termios {
55 struct solaris_termio {
64 struct solaris_termiox {
71 static u32 solaris_to_linux_cflag(u32 cflag)
74 if (cflag & 0x200000) {
75 int baud = cflag & 0xf;
78 case 0: baud = B57600; break;
79 case 1: baud = B76800; break;
80 case 2: baud = B115200; break;
81 case 3: baud = B153600; break;
82 case 4: baud = B230400; break;
83 case 5: baud = B307200; break;
84 case 6: baud = B460800; break;
86 cflag |= CBAUDEX | baud;
91 static u32 linux_to_solaris_cflag(u32 cflag)
93 cflag &= ~(CMSPAR | CIBAUD);
94 if (cflag & CBAUDEX) {
95 int baud = cflag & CBAUD;
98 case B57600: baud = 0; break;
99 case B76800: baud = 1; break;
100 case B115200: baud = 2; break;
101 case B153600: baud = 3; break;
102 case B230400: baud = 4; break;
103 case B307200: baud = 5; break;
104 case B460800: baud = 6; break;
105 case B614400: baud = 7; break;
106 case B921600: baud = 8; break;
108 case B1843200: baud = 9; break;
111 cflag |= 0x200000 | baud;
116 static inline int linux_to_solaris_termio(unsigned int fd, unsigned int cmd, u32 arg)
120 ret = sys_ioctl(fd, cmd, A(arg));
124 if (__get_user (cflag, &((struct solaris_termio *)A(arg))->c_cflag))
126 cflag = linux_to_solaris_cflag(cflag);
127 if (__put_user (cflag, &((struct solaris_termio *)A(arg))->c_cflag))
133 static int solaris_to_linux_termio(unsigned int fd, unsigned int cmd, u32 arg)
136 struct solaris_termio s;
137 mm_segment_t old_fs = get_fs();
139 if (copy_from_user (&s, (struct solaris_termio *)A(arg), sizeof(struct solaris_termio)))
141 s.c_cflag = solaris_to_linux_cflag(s.c_cflag);
143 ret = sys_ioctl(fd, cmd, (unsigned long)&s);
148 static inline int linux_to_solaris_termios(unsigned int fd, unsigned int cmd, u32 arg)
151 struct solaris_termios s;
152 mm_segment_t old_fs = get_fs();
155 ret = sys_ioctl(fd, cmd, (unsigned long)&s);
158 if (put_user (s.c_iflag, &((struct solaris_termios *)A(arg))->c_iflag) ||
159 __put_user (s.c_oflag, &((struct solaris_termios *)A(arg))->c_oflag) ||
160 __put_user (linux_to_solaris_cflag(s.c_cflag), &((struct solaris_termios *)A(arg))->c_cflag) ||
161 __put_user (s.c_lflag, &((struct solaris_termios *)A(arg))->c_lflag) ||
162 __copy_to_user (((struct solaris_termios *)A(arg))->c_cc, s.c_cc, 16) ||
163 __clear_user (((struct solaris_termios *)A(arg))->c_cc + 16, 2))
169 static int solaris_to_linux_termios(unsigned int fd, unsigned int cmd, u32 arg)
172 struct solaris_termios s;
173 mm_segment_t old_fs = get_fs();
176 ret = sys_ioctl(fd, TCGETS, (unsigned long)&s);
179 if (put_user (s.c_iflag, &((struct solaris_termios *)A(arg))->c_iflag) ||
180 __put_user (s.c_oflag, &((struct solaris_termios *)A(arg))->c_oflag) ||
181 __put_user (s.c_cflag, &((struct solaris_termios *)A(arg))->c_cflag) ||
182 __put_user (s.c_lflag, &((struct solaris_termios *)A(arg))->c_lflag) ||
183 __copy_from_user (s.c_cc, ((struct solaris_termios *)A(arg))->c_cc, 16))
185 s.c_cflag = solaris_to_linux_cflag(s.c_cflag);
187 ret = sys_ioctl(fd, cmd, (unsigned long)&s);
192 static inline int solaris_T(unsigned int fd, unsigned int cmd, u32 arg)
194 switch (cmd & 0xff) {
196 return linux_to_solaris_termio(fd, TCGETA, arg);
198 return solaris_to_linux_termio(fd, TCSETA, arg);
199 case 3: /* TCSETAW */
200 return solaris_to_linux_termio(fd, TCSETAW, arg);
201 case 4: /* TCSETAF */
202 return solaris_to_linux_termio(fd, TCSETAF, arg);
204 return sys_ioctl(fd, TCSBRK, arg);
206 return sys_ioctl(fd, TCXONC, arg);
208 return sys_ioctl(fd, TCFLSH, arg);
209 case 13: /* TCGETS */
210 return linux_to_solaris_termios(fd, TCGETS, arg);
211 case 14: /* TCSETS */
212 return solaris_to_linux_termios(fd, TCSETS, arg);
213 case 15: /* TCSETSW */
214 return solaris_to_linux_termios(fd, TCSETSW, arg);
215 case 16: /* TCSETSF */
216 return solaris_to_linux_termios(fd, TCSETSF, arg);
217 case 103: /* TIOCSWINSZ */
218 return sys_ioctl(fd, TIOCSWINSZ, arg);
219 case 104: /* TIOCGWINSZ */
220 return sys_ioctl(fd, TIOCGWINSZ, arg);
225 static inline int solaris_t(unsigned int fd, unsigned int cmd, u32 arg)
227 switch (cmd & 0xff) {
228 case 20: /* TIOCGPGRP */
229 return sys_ioctl(fd, TIOCGPGRP, arg);
230 case 21: /* TIOCSPGRP */
231 return sys_ioctl(fd, TIOCSPGRP, arg);
238 /* A pseudo STREAMS support {{{ */
241 int cmd, timeout, len;
245 struct solaris_si_sockparams {
251 struct solaris_o_si_udata {
262 struct solaris_si_udata {
271 struct solaris_si_sockparams sockparams;
274 #define SOLARIS_MODULE_TIMOD 0
275 #define SOLARIS_MODULE_SOCKMOD 1
276 #define SOLARIS_MODULE_MAX 2
278 static struct module_info {
280 /* can be expanded further if needed */
281 } module_table[ SOLARIS_MODULE_MAX + 1 ] = {
282 /* the ordering here must match the module numbers above! */
288 static inline int solaris_sockmod(unsigned int fd, unsigned int cmd, u32 arg)
291 /* I wonder which of these tests are superfluous... --patrik */
292 read_lock(¤t->files->file_lock);
293 if (! current->files->fd[fd] ||
294 ! current->files->fd[fd]->f_dentry ||
295 ! (ino = current->files->fd[fd]->f_dentry->d_inode) ||
297 read_unlock(¤t->files->file_lock);
300 read_unlock(¤t->files->file_lock);
302 switch (cmd & 0xff) {
303 case 109: /* SI_SOCKPARAMS */
305 struct solaris_si_sockparams si;
306 if (copy_from_user (&si, (struct solaris_si_sockparams *) A(arg), sizeof(si)))
307 return (EFAULT << 8) | TSYSERR;
309 /* Should we modify socket ino->socket_i.ops and type? */
312 case 110: /* SI_GETUDATA */
314 int etsdusize, servtype;
315 switch (ino->u.socket_i.type) {
325 if (put_user(16384, &((struct solaris_si_udata *)A(arg))->tidusize) ||
326 __put_user(sizeof(struct sockaddr), &((struct solaris_si_udata *)A(arg))->addrsize) ||
327 __put_user(-1, &((struct solaris_si_udata *)A(arg))->optsize) ||
328 __put_user(etsdusize, &((struct solaris_si_udata *)A(arg))->etsdusize) ||
329 __put_user(servtype, &((struct solaris_si_udata *)A(arg))->servtype) ||
330 __put_user(0, &((struct solaris_si_udata *)A(arg))->so_state) ||
331 __put_user(0, &((struct solaris_si_udata *)A(arg))->so_options) ||
332 __put_user(16384, &((struct solaris_si_udata *)A(arg))->tsdusize) ||
333 __put_user(ino->u.socket_i.ops->family, &((struct solaris_si_udata *)A(arg))->sockparams.sp_family) ||
334 __put_user(ino->u.socket_i.type, &((struct solaris_si_udata *)A(arg))->sockparams.sp_type) ||
335 __put_user(ino->u.socket_i.ops->family, &((struct solaris_si_udata *)A(arg))->sockparams.sp_protocol))
336 return (EFAULT << 8) | TSYSERR;
339 case 101: /* O_SI_GETUDATA */
341 int etsdusize, servtype;
342 switch (ino->u.socket_i.type) {
352 if (put_user(16384, &((struct solaris_o_si_udata *)A(arg))->tidusize) ||
353 __put_user(sizeof(struct sockaddr), &((struct solaris_o_si_udata *)A(arg))->addrsize) ||
354 __put_user(-1, &((struct solaris_o_si_udata *)A(arg))->optsize) ||
355 __put_user(etsdusize, &((struct solaris_o_si_udata *)A(arg))->etsdusize) ||
356 __put_user(servtype, &((struct solaris_o_si_udata *)A(arg))->servtype) ||
357 __put_user(0, &((struct solaris_o_si_udata *)A(arg))->so_state) ||
358 __put_user(0, &((struct solaris_o_si_udata *)A(arg))->so_options) ||
359 __put_user(16384, &((struct solaris_o_si_udata *)A(arg))->tsdusize))
360 return (EFAULT << 8) | TSYSERR;
363 case 102: /* SI_SHUTDOWN */
364 case 103: /* SI_LISTEN */
365 case 104: /* SI_SETMYNAME */
366 case 105: /* SI_SETPEERNAME */
367 case 106: /* SI_GETINTRANSIT */
368 case 107: /* SI_TCL_LINK */
369 case 108: /* SI_TCL_UNLINK */
375 static inline int solaris_timod(unsigned int fd, unsigned int cmd, u32 arg,
380 switch (cmd & 0xff) {
381 case 141: /* TI_OPTMGMT */
385 SOLD("TI_OPMGMT entry");
386 ret = timod_putmsg(fd, (char *)A(arg), len, NULL, -1, 0);
387 SOLD("timod_putmsg() returned");
389 return (-ret << 8) | TSYSERR;
391 SOLD("calling timod_getmsg()");
392 ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
393 SOLD("timod_getmsg() returned");
395 return (-ret << 8) | TSYSERR;
397 if (get_user(prim, (u32 *)A(arg)))
398 return (EFAULT << 8) | TSYSERR;
400 if (prim == T_ERROR_ACK) {
402 SOLD("prim is T_ERROR_ACK");
403 if (get_user(tmp, (u32 *)A(arg)+3) ||
404 get_user(tmp2, (u32 *)A(arg)+2))
405 return (EFAULT << 8) | TSYSERR;
406 return (tmp2 << 8) | tmp;
408 SOLD("TI_OPMGMT return 0");
411 case 142: /* TI_BIND */
415 SOLD("TI_BIND entry");
416 ret = timod_putmsg(fd, (char *)A(arg), len, NULL, -1, 0);
417 SOLD("timod_putmsg() returned");
419 return (-ret << 8) | TSYSERR;
420 len = 1024; /* Solaris allows arbitrary return size */
422 SOLD("calling timod_getmsg()");
423 ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
424 SOLD("timod_getmsg() returned");
426 return (-ret << 8) | TSYSERR;
428 if (get_user(prim, (u32 *)A(arg)))
429 return (EFAULT << 8) | TSYSERR;
431 if (prim == T_ERROR_ACK) {
433 SOLD("prim is T_ERROR_ACK");
434 if (get_user(tmp, (u32 *)A(arg)+3) ||
435 get_user(tmp2, (u32 *)A(arg)+2))
436 return (EFAULT << 8) | TSYSERR;
437 return (tmp2 << 8) | tmp;
439 SOLD("no ERROR_ACK requested");
440 if (prim != T_OK_ACK)
442 SOLD("OK_ACK requested");
444 SOLD("calling timod_getmsg()");
445 ret = timod_getmsg(fd, (char *)A(arg), len, len_p, NULL, -1, NULL, &i);
446 SOLD("timod_getmsg() returned");
448 return (-ret << 8) | TSYSERR;
449 SOLD("TI_BIND return ok");
452 case 140: /* TI_GETINFO */
453 case 143: /* TI_UNBIND */
454 case 144: /* TI_GETMYNAME */
455 case 145: /* TI_GETPEERNAME */
456 case 146: /* TI_SETMYNAME */
457 case 147: /* TI_SETPEERNAME */
463 static inline int solaris_S(struct file *filp, unsigned int fd, unsigned int cmd, u32 arg)
470 struct sol_socket_struct *sock;
471 struct module_info *mi;
473 ino = filp->f_dentry->d_inode;
476 sock = filp->private_data;
478 printk("solaris_S: NULL private_data\n");
481 if (sock->magic != SOLARIS_SOCKET_MAGIC) {
482 printk("solaris_S: invalid magic\n");
487 switch (cmd & 0xff) {
488 case 1: /* I_NREAD */
492 p = getname ((char *)A(arg));
496 for (mi = module_table; mi->name; mi++) {
497 if (strcmp(mi->name, p) == 0) {
499 if (sock->modcount >= MAX_NR_STREAM_MODULES) {
503 m = (sol_module) (mi - module_table);
504 sock->module[sock->modcount++] = m;
513 if (sock->modcount <= 0) return -EINVAL;
519 if (sock->modcount <= 0) return -EINVAL;
520 p = module_table[(unsigned)sock->module[sock->modcount]].name;
521 if (copy_to_user ((char *)A(arg), p, strlen(p)))
525 case 5: /* I_FLUSH */
528 if (copy_from_user(&si, (struct strioctl *)A(arg), sizeof(struct strioctl)))
530 /* We ignore what module is actually at the top of stack. */
531 switch ((si.cmd >> 8) & 0xff) {
533 return solaris_sockmod(fd, si.cmd, si.data);
535 return solaris_timod(fd, si.cmd, si.data, si.len,
536 &((struct strioctl*)A(arg))->len);
538 return solaris_ioctl(fd, si.cmd, si.data);
540 case 9: /* I_SETSIG */
541 return sys_ioctl(fd, FIOSETOWN, current->pid);
542 case 10: /* I_GETSIG */
545 sys_ioctl(fd, FIOGETOWN, (unsigned long)&ret);
547 if (ret == current->pid) return 0x3ff;
549 case 11: /* I_FIND */
552 p = getname ((char *)A(arg));
556 for (i = 0; i < sock->modcount; i++) {
557 unsigned m = sock->module[i];
558 if (strcmp(module_table[m].name, p) == 0) {
566 case 19: /* I_SWROPT */
567 case 32: /* I_SETCLTIME */
573 static inline int solaris_s(unsigned int fd, unsigned int cmd, u32 arg)
575 switch (cmd & 0xff) {
576 case 0: /* SIOCSHIWAT */
577 case 2: /* SIOCSLOWAT */
578 return 0; /* We don't support them */
579 case 1: /* SIOCGHIWAT */
580 case 3: /* SIOCGLOWAT */
581 if (put_user (0, (u32 *)A(arg)))
584 case 7: /* SIOCATMARK */
585 return sys_ioctl(fd, SIOCATMARK, arg);
586 case 8: /* SIOCSPGRP */
587 return sys_ioctl(fd, SIOCSPGRP, arg);
588 case 9: /* SIOCGPGRP */
589 return sys_ioctl(fd, SIOCGPGRP, arg);
594 static inline int solaris_r(unsigned int fd, unsigned int cmd, u32 arg)
596 switch (cmd & 0xff) {
597 case 10: /* SIOCADDRT */
598 return sys32_ioctl(fd, SIOCADDRT, arg);
599 case 11: /* SIOCDELRT */
600 return sys32_ioctl(fd, SIOCDELRT, arg);
605 static inline int solaris_i(unsigned int fd, unsigned int cmd, u32 arg)
607 switch (cmd & 0xff) {
608 case 12: /* SIOCSIFADDR */
609 return sys32_ioctl(fd, SIOCSIFADDR, arg);
610 case 13: /* SIOCGIFADDR */
611 return sys32_ioctl(fd, SIOCGIFADDR, arg);
612 case 14: /* SIOCSIFDSTADDR */
613 return sys32_ioctl(fd, SIOCSIFDSTADDR, arg);
614 case 15: /* SIOCGIFDSTADDR */
615 return sys32_ioctl(fd, SIOCGIFDSTADDR, arg);
616 case 16: /* SIOCSIFFLAGS */
617 return sys32_ioctl(fd, SIOCSIFFLAGS, arg);
618 case 17: /* SIOCGIFFLAGS */
619 return sys32_ioctl(fd, SIOCGIFFLAGS, arg);
620 case 18: /* SIOCSIFMEM */
621 return sys32_ioctl(fd, SIOCSIFMEM, arg);
622 case 19: /* SIOCGIFMEM */
623 return sys32_ioctl(fd, SIOCGIFMEM, arg);
624 case 20: /* SIOCGIFCONF */
625 return sys32_ioctl(fd, SIOCGIFCONF, arg);
626 case 21: /* SIOCSIFMTU */
627 return sys32_ioctl(fd, SIOCSIFMTU, arg);
628 case 22: /* SIOCGIFMTU */
629 return sys32_ioctl(fd, SIOCGIFMTU, arg);
630 case 23: /* SIOCGIFBRDADDR */
631 return sys32_ioctl(fd, SIOCGIFBRDADDR, arg);
632 case 24: /* SIOCSIFBRDADDR */
633 return sys32_ioctl(fd, SIOCSIFBRDADDR, arg);
634 case 25: /* SIOCGIFNETMASK */
635 return sys32_ioctl(fd, SIOCGIFNETMASK, arg);
636 case 26: /* SIOCSIFNETMASK */
637 return sys32_ioctl(fd, SIOCSIFNETMASK, arg);
638 case 27: /* SIOCGIFMETRIC */
639 return sys32_ioctl(fd, SIOCGIFMETRIC, arg);
640 case 28: /* SIOCSIFMETRIC */
641 return sys32_ioctl(fd, SIOCSIFMETRIC, arg);
642 case 30: /* SIOCSARP */
643 return sys32_ioctl(fd, SIOCSARP, arg);
644 case 31: /* SIOCGARP */
645 return sys32_ioctl(fd, SIOCGARP, arg);
646 case 32: /* SIOCDARP */
647 return sys32_ioctl(fd, SIOCDARP, arg);
648 case 52: /* SIOCGETNAME */
649 case 53: /* SIOCGETPEER */
651 struct sockaddr uaddr;
652 int uaddr_len = sizeof(struct sockaddr), ret;
654 mm_segment_t old_fs = get_fs();
655 int (*sys_socketcall)(int, unsigned long *) =
656 (int (*)(int, unsigned long *))SYS(socketcall);
658 args[0] = fd; args[1] = (long)&uaddr; args[2] = (long)&uaddr_len;
660 ret = sys_socketcall(((cmd & 0xff) == 52) ? SYS_GETSOCKNAME : SYS_GETPEERNAME,
664 if (copy_to_user((char *)A(arg), &uaddr, uaddr_len))
670 case 86: /* SIOCSOCKSYS */
671 return socksys_syscall(fd, arg);
673 case 87: /* SIOCGIFNUM */
675 struct net_device *d;
678 read_lock_bh(&dev_base_lock);
679 for (d = dev_base; d; d = d->next) i++;
680 read_unlock_bh(&dev_base_lock);
682 if (put_user (i, (int *)A(arg)))
690 static int solaris_m(unsigned int fd, unsigned int cmd, u32 arg)
694 switch (cmd & 0xff) {
695 case 1: /* MTIOCTOP */
696 ret = sys_ioctl(fd, MTIOCTOP, (unsigned long)&arg);
698 case 2: /* MTIOCGET */
699 ret = sys_ioctl(fd, MTIOCGET, (unsigned long)&arg);
701 case 3: /* MTIOCGETDRIVETYPE */
702 case 4: /* MTIOCPERSISTENT */
703 case 5: /* MTIOCPERSISTENTSTATUS */
704 case 6: /* MTIOCLRERR */
705 case 7: /* MTIOCGUARANTEEDORDER */
706 case 8: /* MTIOCRESERVE */
707 case 9: /* MTIOCRELEASE */
708 case 10: /* MTIOCFORCERESERVE */
709 case 13: /* MTIOCSTATE */
710 case 14: /* MTIOCREADIGNOREILI */
711 case 15: /* MTIOCREADIGNOREEOFS */
712 case 16: /* MTIOCSHORTFMK */
714 ret = -ENOSYS; /* linux doesn't support these */
721 static int solaris_O(unsigned int fd, unsigned int cmd, u32 arg)
725 switch (cmd & 0xff) {
726 case 1: /* OPROMGETOPT */
727 ret = sys_ioctl(fd, OPROMGETOPT, arg);
729 case 2: /* OPROMSETOPT */
730 ret = sys_ioctl(fd, OPROMSETOPT, arg);
732 case 3: /* OPROMNXTOPT */
733 ret = sys_ioctl(fd, OPROMNXTOPT, arg);
735 case 4: /* OPROMSETOPT2 */
736 ret = sys_ioctl(fd, OPROMSETOPT2, arg);
738 case 5: /* OPROMNEXT */
739 ret = sys_ioctl(fd, OPROMNEXT, arg);
741 case 6: /* OPROMCHILD */
742 ret = sys_ioctl(fd, OPROMCHILD, arg);
744 case 7: /* OPROMGETPROP */
745 ret = sys_ioctl(fd, OPROMGETPROP, arg);
747 case 8: /* OPROMNXTPROP */
748 ret = sys_ioctl(fd, OPROMNXTPROP, arg);
750 case 9: /* OPROMU2P */
751 ret = sys_ioctl(fd, OPROMU2P, arg);
753 case 10: /* OPROMGETCONS */
754 ret = sys_ioctl(fd, OPROMGETCONS, arg);
756 case 11: /* OPROMGETFBNAME */
757 ret = sys_ioctl(fd, OPROMGETFBNAME, arg);
759 case 12: /* OPROMGETBOOTARGS */
760 ret = sys_ioctl(fd, OPROMGETBOOTARGS, arg);
762 case 13: /* OPROMGETVERSION */
763 case 14: /* OPROMPATH2DRV */
764 case 15: /* OPROMDEV2PROMNAME */
765 case 16: /* OPROMPROM2DEVNAME */
766 case 17: /* OPROMGETPROPLEN */
776 asmlinkage int solaris_ioctl(unsigned int fd, unsigned int cmd, u32 arg)
787 switch ((cmd >> 8) & 0xff) {
788 case 'S': error = solaris_S(filp, fd, cmd, arg); break;
789 case 'T': error = solaris_T(fd, cmd, arg); break;
790 case 'i': error = solaris_i(fd, cmd, arg); break;
791 case 'r': error = solaris_r(fd, cmd, arg); break;
792 case 's': error = solaris_s(fd, cmd, arg); break;
793 case 't': error = solaris_t(fd, cmd, arg); break;
794 case 'f': error = sys_ioctl(fd, cmd, arg); break;
795 case 'm': error = solaris_m(fd, cmd, arg); break;
796 case 'O': error = solaris_O(fd, cmd, arg); break;
804 if (error == -ENOSYS) {
805 unsigned char c = cmd>>8;
807 if (c < ' ' || c > 126) c = '.';
808 printk("solaris_ioctl: Unknown cmd fd(%d) cmd(%08x '%c') arg(%08x)\n",
809 (int)fd, (unsigned int)cmd, c, (unsigned int)arg);