This source file includes following definitions.
- sunos_ioctl
1
2
3
4
5
6
7
8 #include <asm/segment.h>
9
10 #include <linux/sched.h>
11 #include <linux/errno.h>
12 #include <linux/string.h>
13 #include <linux/termios.h>
14 #include <linux/ioctl.h>
15 #include <linux/route.h>
16 #include <linux/sockios.h>
17 #include <linux/if.h>
18 #include <linux/if_arp.h>
19 #include <linux/fs.h>
20 #include <linux/mm.h>
21 #include <asm/kbio.h>
22
23 #if 0
24 extern char sunkbd_type;
25 extern char sunkbd_layout;
26 #endif
27
28 extern asmlinkage int sys_ioctl(unsigned int, unsigned int, unsigned long);
29 extern asmlinkage int sys_setsid(void);
30
31 asmlinkage int sunos_ioctl (int fd, unsigned long cmd, unsigned long arg)
32 {
33 struct file *filp;
34 int foo;
35
36 if (fd >= NR_OPEN || !(filp = current->files->fd [fd]))
37 return -EBADF;
38
39
40 if(cmd == TIOCSETD) {
41 int *p, ntty = N_TTY, old_fs;
42
43 p = (int *) arg;
44 foo = verify_area(VERIFY_WRITE, p, sizeof(int));
45 if(foo) return foo;
46 if(*p == 2) {
47 old_fs = get_fs();
48 set_fs(KERNEL_DS);
49 foo = sys_ioctl(fd, cmd, (int) &ntty);
50 set_fs(old_fs);
51 return (foo == -EINVAL ? -EOPNOTSUPP : foo);
52 }
53 }
54
55
56 if(cmd == TIOCNOTTY)
57 return sys_setsid();
58
59
60 switch (cmd) {
61 case _IOW('r', 10, struct rtentry):
62 return sys_ioctl(fd, SIOCADDRT, arg);
63 case _IOW('r', 11, struct rtentry):
64 return sys_ioctl(fd, SIOCDELRT, arg);
65 case _IOW('i', 12, struct ifreq):
66 return sys_ioctl(fd, SIOCSIFADDR, arg);
67 case _IORW('i', 13, struct ifreq):
68 return sys_ioctl(fd, SIOCGIFADDR, arg);
69 case _IOW('i', 14, struct ifreq):
70 return sys_ioctl(fd, SIOCSIFDSTADDR, arg);
71 case _IORW('i', 15, struct ifreq):
72 return sys_ioctl(fd, SIOCGIFDSTADDR, arg);
73 case _IOW('i', 16, struct ifreq):
74 return sys_ioctl(fd, SIOCSIFFLAGS, arg);
75 case _IORW('i', 17, struct ifreq):
76 return sys_ioctl(fd, SIOCGIFFLAGS, arg);
77 case _IOW('i', 18, struct ifreq):
78 return sys_ioctl(fd, SIOCSIFMEM, arg);
79 case _IORW('i', 19, struct ifreq):
80 return sys_ioctl(fd, SIOCGIFMEM, arg);
81 case _IORW('i', 20, struct ifconf):
82 return sys_ioctl(fd, SIOCGIFCONF, arg);
83 case _IOW('i', 21, struct ifreq):
84 return sys_ioctl(fd, SIOCSIFMTU, arg);
85 case _IORW('i', 22, struct ifreq):
86 return sys_ioctl(fd, SIOCGIFMTU, arg);
87
88 case _IORW('i', 23, struct ifreq):
89 return sys_ioctl(fd, SIOCGIFBRDADDR, arg);
90 case _IOW('i', 24, struct ifreq):
91 return sys_ioctl(fd, SIOCGIFBRDADDR, arg);
92 case _IORW('i', 25, struct ifreq):
93 return sys_ioctl(fd, SIOCGIFNETMASK, arg);
94 case _IOW('i', 26, struct ifreq):
95 return sys_ioctl(fd, SIOCSIFNETMASK, arg);
96 case _IORW('i', 27, struct ifreq):
97 return sys_ioctl(fd, SIOCGIFMETRIC, arg);
98 case _IOW('i', 28, struct ifreq):
99 return sys_ioctl(fd, SIOCSIFMETRIC, arg);
100
101 case _IOW('i', 30, struct arpreq):
102 return sys_ioctl(fd, SIOCSARP, arg);
103 case _IOW('i', 31, struct arpreq):
104 return sys_ioctl(fd, SIOCGARP, arg);
105 case _IOW('i', 32, struct arpreq):
106 return sys_ioctl(fd, SIOCGARP, arg);
107
108 case _IOW('i', 40, struct ifreq):
109 case _IOW('i', 41, struct ifreq):
110 case _IOW('i', 44, struct ifreq):
111 case _IOW('i', 45, struct ifreq):
112 case _IOW('i', 46, struct ifreq):
113 case _IOW('i', 47, struct ifreq):
114 case _IOW('i', 48, struct ifreq):
115 return -EOPNOTSUPP;
116
117 case _IOW('i', 49, struct ifreq):
118 return sys_ioctl(fd, SIOCADDMULTI, arg);
119 case _IOW('i', 50, struct ifreq):
120 return sys_ioctl(fd, SIOCDELMULTI, arg);
121
122
123
124 case _IOW('i', 51, struct ifreq):
125 case _IOW('i', 52, struct ifreq):
126 case _IOW('i', 53, struct ifreq):
127 case _IOW('i', 54, struct ifreq):
128 case _IOW('i', 55, struct ifreq):
129 case _IOW('i', 56, struct ifreq):
130 case _IOW('i', 57, struct ifreq):
131 case _IOW('i', 58, struct ifreq):
132 case _IOW('i', 59, struct ifreq):
133 printk("FDDI ioctl, returning EOPNOTSUPP\n");
134 return -EOPNOTSUPP;
135 case _IOW('t', 125, int):
136
137
138
139 return 0;
140
141 case _IOR('t', 119, int):
142 return -EIO;
143 }
144
145 #if 0
146 if (cmd & 0xff00 == ('k' << 8)){
147 printk ("[[KBIO: %8.8x\n", (unsigned int) cmd);
148 }
149 #endif
150
151 foo = sys_ioctl(fd, cmd, arg);
152
153 return (foo == -EINVAL ? -EOPNOTSUPP : foo);
154 }
155
156