blob: ce943853c38d6a913e6d5a113f1a71857537fb69 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*********************************************************************
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +09002 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07003 * Filename: ircomm_tty_ioctl.c
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +09004 * Version:
5 * Description:
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * Status: Experimental.
7 * Author: Dag Brattli <dagb@cs.uit.no>
8 * Created at: Thu Jun 10 14:39:09 1999
9 * Modified at: Wed Jan 5 14:45:43 2000
10 * Modified by: Dag Brattli <dagb@cs.uit.no>
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +090011 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 * Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved.
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +090013 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
Linus Torvalds1da177e2005-04-16 15:20:36 -070017 * the License, or (at your option) any later version.
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +090018 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +090023 *
24 * You should have received a copy of the GNU General Public License
Jeff Kirsherd3770502013-12-06 09:13:43 -080025 * along with this program; if not, see <http://www.gnu.org/licenses/>.
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +090026 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 ********************************************************************/
28
29#include <linux/init.h>
30#include <linux/fs.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070031#include <linux/termios.h>
32#include <linux/tty.h>
33#include <linux/serial.h>
34
35#include <asm/uaccess.h>
36
37#include <net/irda/irda.h>
38#include <net/irda/irmod.h>
39
40#include <net/irda/ircomm_core.h>
41#include <net/irda/ircomm_param.h>
42#include <net/irda/ircomm_tty_attach.h>
43#include <net/irda/ircomm_tty.h>
44
45#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
46
47/*
48 * Function ircomm_tty_change_speed (driver)
49 *
50 * Change speed of the driver. If the remote device is a DCE, then this
51 * should make it change the speed of its serial port
52 */
Jiri Slaby62f228a2012-06-04 13:35:21 +020053static void ircomm_tty_change_speed(struct ircomm_tty_cb *self,
54 struct tty_struct *tty)
Linus Torvalds1da177e2005-04-16 15:20:36 -070055{
Eric Dumazet95c96172012-04-15 05:58:06 +000056 unsigned int cflag, cval;
Linus Torvalds1da177e2005-04-16 15:20:36 -070057 int baud;
58
Harvey Harrison0dc47872008-03-05 20:47:47 -080059 IRDA_DEBUG(2, "%s()\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
Jiri Slaby62f228a2012-06-04 13:35:21 +020061 if (!self->ircomm)
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 return;
63
Alan Coxadc8d742012-07-14 15:31:47 +010064 cflag = tty->termios.c_cflag;
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
66 /* byte size and parity */
67 switch (cflag & CSIZE) {
68 case CS5: cval = IRCOMM_WSIZE_5; break;
69 case CS6: cval = IRCOMM_WSIZE_6; break;
70 case CS7: cval = IRCOMM_WSIZE_7; break;
71 case CS8: cval = IRCOMM_WSIZE_8; break;
72 default: cval = IRCOMM_WSIZE_5; break;
73 }
74 if (cflag & CSTOPB)
75 cval |= IRCOMM_2_STOP_BIT;
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +090076
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 if (cflag & PARENB)
78 cval |= IRCOMM_PARITY_ENABLE;
79 if (!(cflag & PARODD))
80 cval |= IRCOMM_PARITY_EVEN;
81
82 /* Determine divisor based on baud rate */
Jiri Slaby62f228a2012-06-04 13:35:21 +020083 baud = tty_get_baud_rate(tty);
Linus Torvalds1da177e2005-04-16 15:20:36 -070084 if (!baud)
85 baud = 9600; /* B0 transition handled in rs_set_termios */
86
87 self->settings.data_rate = baud;
88 ircomm_param_request(self, IRCOMM_DATA_RATE, FALSE);
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +090089
Linus Torvalds1da177e2005-04-16 15:20:36 -070090 /* CTS flow control flag and modem status interrupts */
91 if (cflag & CRTSCTS) {
Jiri Slaby849d5a92012-06-04 13:35:19 +020092 self->port.flags |= ASYNC_CTS_FLOW;
Linus Torvalds1da177e2005-04-16 15:20:36 -070093 self->settings.flow_control |= IRCOMM_RTS_CTS_IN;
94 /* This got me. Bummer. Jean II */
95 if (self->service_type == IRCOMM_3_WIRE_RAW)
Harvey Harrison0dc47872008-03-05 20:47:47 -080096 IRDA_WARNING("%s(), enabling RTS/CTS on link that doesn't support it (3-wire-raw)\n", __func__);
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 } else {
Jiri Slaby849d5a92012-06-04 13:35:19 +020098 self->port.flags &= ~ASYNC_CTS_FLOW;
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 self->settings.flow_control &= ~IRCOMM_RTS_CTS_IN;
100 }
101 if (cflag & CLOCAL)
Jiri Slaby849d5a92012-06-04 13:35:19 +0200102 self->port.flags &= ~ASYNC_CHECK_CD;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 else
Jiri Slaby849d5a92012-06-04 13:35:19 +0200104 self->port.flags |= ASYNC_CHECK_CD;
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900105#if 0
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 /*
107 * Set up parity check flag
108 */
109
110 if (I_INPCK(self->tty))
111 driver->read_status_mask |= LSR_FE | LSR_PE;
112 if (I_BRKINT(driver->tty) || I_PARMRK(driver->tty))
113 driver->read_status_mask |= LSR_BI;
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900114
Linus Torvalds1da177e2005-04-16 15:20:36 -0700115 /*
116 * Characters to ignore
117 */
118 driver->ignore_status_mask = 0;
119 if (I_IGNPAR(driver->tty))
120 driver->ignore_status_mask |= LSR_PE | LSR_FE;
121
122 if (I_IGNBRK(self->tty)) {
123 self->ignore_status_mask |= LSR_BI;
124 /*
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900125 * If we're ignore parity and break indicators, ignore
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126 * overruns too. (For real raw support).
127 */
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900128 if (I_IGNPAR(self->tty))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 self->ignore_status_mask |= LSR_OE;
130 }
131#endif
132 self->settings.data_format = cval;
133
134 ircomm_param_request(self, IRCOMM_DATA_FORMAT, FALSE);
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900135 ircomm_param_request(self, IRCOMM_FLOW_CONTROL, TRUE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136}
137
138/*
139 * Function ircomm_tty_set_termios (tty, old_termios)
140 *
141 * This routine allows the tty driver to be notified when device's
142 * termios settings have changed. Note that a well-designed tty driver
143 * should be prepared to accept the case where old == NULL, and try to
144 * do something rational.
145 */
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900146void ircomm_tty_set_termios(struct tty_struct *tty,
Alan Coxedc6afc2006-12-08 02:38:44 -0800147 struct ktermios *old_termios)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148{
149 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
Alan Coxadc8d742012-07-14 15:31:47 +0100150 unsigned int cflag = tty->termios.c_cflag;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151
Harvey Harrison0dc47872008-03-05 20:47:47 -0800152 IRDA_DEBUG(2, "%s()\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900154 if ((cflag == old_termios->c_cflag) &&
Alan Coxadc8d742012-07-14 15:31:47 +0100155 (RELEVANT_IFLAG(tty->termios.c_iflag) ==
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156 RELEVANT_IFLAG(old_termios->c_iflag)))
157 {
158 return;
159 }
160
Jiri Slaby62f228a2012-06-04 13:35:21 +0200161 ircomm_tty_change_speed(self, tty);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162
163 /* Handle transition to B0 status */
164 if ((old_termios->c_cflag & CBAUD) &&
165 !(cflag & CBAUD)) {
166 self->settings.dte &= ~(IRCOMM_DTR|IRCOMM_RTS);
167 ircomm_param_request(self, IRCOMM_DTE, TRUE);
168 }
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900169
Linus Torvalds1da177e2005-04-16 15:20:36 -0700170 /* Handle transition away from B0 status */
171 if (!(old_termios->c_cflag & CBAUD) &&
172 (cflag & CBAUD)) {
173 self->settings.dte |= IRCOMM_DTR;
Alan Coxadc8d742012-07-14 15:31:47 +0100174 if (!(tty->termios.c_cflag & CRTSCTS) ||
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 !test_bit(TTY_THROTTLED, &tty->flags)) {
176 self->settings.dte |= IRCOMM_RTS;
177 }
178 ircomm_param_request(self, IRCOMM_DTE, TRUE);
179 }
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900180
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181 /* Handle turning off CRTSCTS */
182 if ((old_termios->c_cflag & CRTSCTS) &&
Alan Coxadc8d742012-07-14 15:31:47 +0100183 !(tty->termios.c_cflag & CRTSCTS))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184 {
185 tty->hw_stopped = 0;
186 ircomm_tty_start(tty);
187 }
188}
189
190/*
Alan Cox60b33c12011-02-14 16:26:14 +0000191 * Function ircomm_tty_tiocmget (tty)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700192 *
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900193 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194 *
195 */
Alan Cox60b33c12011-02-14 16:26:14 +0000196int ircomm_tty_tiocmget(struct tty_struct *tty)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197{
198 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
199 unsigned int result;
200
Harvey Harrison0dc47872008-03-05 20:47:47 -0800201 IRDA_DEBUG(2, "%s()\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202
203 if (tty->flags & (1 << TTY_IO_ERROR))
204 return -EIO;
205
206 result = ((self->settings.dte & IRCOMM_RTS) ? TIOCM_RTS : 0)
207 | ((self->settings.dte & IRCOMM_DTR) ? TIOCM_DTR : 0)
208 | ((self->settings.dce & IRCOMM_CD) ? TIOCM_CAR : 0)
209 | ((self->settings.dce & IRCOMM_RI) ? TIOCM_RNG : 0)
210 | ((self->settings.dce & IRCOMM_DSR) ? TIOCM_DSR : 0)
211 | ((self->settings.dce & IRCOMM_CTS) ? TIOCM_CTS : 0);
212 return result;
213}
214
215/*
Alan Cox20b9d172011-02-14 16:26:50 +0000216 * Function ircomm_tty_tiocmset (tty, set, clear)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217 *
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900218 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700219 *
220 */
Alan Cox20b9d172011-02-14 16:26:50 +0000221int ircomm_tty_tiocmset(struct tty_struct *tty,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222 unsigned int set, unsigned int clear)
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900223{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
225
Harvey Harrison0dc47872008-03-05 20:47:47 -0800226 IRDA_DEBUG(2, "%s()\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -0700227
228 if (tty->flags & (1 << TTY_IO_ERROR))
229 return -EIO;
230
231 IRDA_ASSERT(self != NULL, return -1;);
232 IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
233
234 if (set & TIOCM_RTS)
235 self->settings.dte |= IRCOMM_RTS;
236 if (set & TIOCM_DTR)
237 self->settings.dte |= IRCOMM_DTR;
238
239 if (clear & TIOCM_RTS)
240 self->settings.dte &= ~IRCOMM_RTS;
241 if (clear & TIOCM_DTR)
242 self->settings.dte &= ~IRCOMM_DTR;
243
244 if ((set|clear) & TIOCM_RTS)
245 self->settings.dte |= IRCOMM_DELTA_RTS;
246 if ((set|clear) & TIOCM_DTR)
247 self->settings.dte |= IRCOMM_DELTA_DTR;
248
249 ircomm_param_request(self, IRCOMM_DTE, TRUE);
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900250
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251 return 0;
252}
253
254/*
255 * Function get_serial_info (driver, retinfo)
256 *
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900257 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700258 *
259 */
260static int ircomm_tty_get_serial_info(struct ircomm_tty_cb *self,
261 struct serial_struct __user *retinfo)
262{
263 struct serial_struct info;
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900264
Linus Torvalds1da177e2005-04-16 15:20:36 -0700265 if (!retinfo)
266 return -EFAULT;
267
Harvey Harrison0dc47872008-03-05 20:47:47 -0800268 IRDA_DEBUG(2, "%s()\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -0700269
270 memset(&info, 0, sizeof(info));
271 info.line = self->line;
Jiri Slaby849d5a92012-06-04 13:35:19 +0200272 info.flags = self->port.flags;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273 info.baud_base = self->settings.data_rate;
Jiri Slaby2a0213c2012-06-04 13:35:17 +0200274 info.close_delay = self->port.close_delay;
275 info.closing_wait = self->port.closing_wait;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276
277 /* For compatibility */
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900278 info.type = PORT_16550A;
279 info.port = 0;
280 info.irq = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281 info.xmit_fifo_size = 0;
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900282 info.hub6 = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283 info.custom_divisor = 0;
284
285 if (copy_to_user(retinfo, &info, sizeof(*retinfo)))
286 return -EFAULT;
287
288 return 0;
289}
290
291/*
292 * Function set_serial_info (driver, new_info)
293 *
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900294 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 *
296 */
297static int ircomm_tty_set_serial_info(struct ircomm_tty_cb *self,
298 struct serial_struct __user *new_info)
299{
300#if 0
301 struct serial_struct new_serial;
302 struct ircomm_tty_cb old_state, *state;
303
Harvey Harrison0dc47872008-03-05 20:47:47 -0800304 IRDA_DEBUG(0, "%s()\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305
306 if (copy_from_user(&new_serial,new_info,sizeof(new_serial)))
307 return -EFAULT;
308
309
310 state = self
311 old_state = *self;
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900312
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 if (!capable(CAP_SYS_ADMIN)) {
314 if ((new_serial.baud_base != state->settings.data_rate) ||
315 (new_serial.close_delay != state->close_delay) ||
316 ((new_serial.flags & ~ASYNC_USR_MASK) !=
317 (self->flags & ~ASYNC_USR_MASK)))
318 return -EPERM;
319 state->flags = ((state->flags & ~ASYNC_USR_MASK) |
320 (new_serial.flags & ASYNC_USR_MASK));
321 self->flags = ((self->flags & ~ASYNC_USR_MASK) |
322 (new_serial.flags & ASYNC_USR_MASK));
323 /* self->custom_divisor = new_serial.custom_divisor; */
324 goto check_and_exit;
325 }
326
327 /*
328 * OK, past this point, all the error checking has been done.
329 * At this point, we start making changes.....
330 */
331
332 if (self->settings.data_rate != new_serial.baud_base) {
333 self->settings.data_rate = new_serial.baud_base;
334 ircomm_param_request(self, IRCOMM_DATA_RATE, TRUE);
335 }
336
337 self->close_delay = new_serial.close_delay * HZ/100;
338 self->closing_wait = new_serial.closing_wait * HZ/100;
339 /* self->custom_divisor = new_serial.custom_divisor; */
340
341 self->flags = ((self->flags & ~ASYNC_FLAGS) |
342 (new_serial.flags & ASYNC_FLAGS));
343 self->tty->low_latency = (self->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
344
345 check_and_exit:
346
347 if (self->flags & ASYNC_INITIALIZED) {
348 if (((old_state.flags & ASYNC_SPD_MASK) !=
349 (self->flags & ASYNC_SPD_MASK)) ||
350 (old_driver.custom_divisor != driver->custom_divisor)) {
351 if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
352 driver->tty->alt_speed = 57600;
353 if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
354 driver->tty->alt_speed = 115200;
355 if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
356 driver->tty->alt_speed = 230400;
357 if ((driver->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
358 driver->tty->alt_speed = 460800;
359 ircomm_tty_change_speed(driver);
360 }
361 }
362#endif
363 return 0;
364}
365
366/*
Alan Cox6caa76b2011-02-14 16:27:22 +0000367 * Function ircomm_tty_ioctl (tty, cmd, arg)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368 *
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900369 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370 *
371 */
Alan Cox6caa76b2011-02-14 16:27:22 +0000372int ircomm_tty_ioctl(struct tty_struct *tty,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 unsigned int cmd, unsigned long arg)
374{
375 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
376 int ret = 0;
377
Harvey Harrison0dc47872008-03-05 20:47:47 -0800378 IRDA_DEBUG(2, "%s()\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379
380 if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
381 (cmd != TIOCSERCONFIG) && (cmd != TIOCSERGSTRUCT) &&
382 (cmd != TIOCMIWAIT) && (cmd != TIOCGICOUNT)) {
383 if (tty->flags & (1 << TTY_IO_ERROR))
384 return -EIO;
385 }
386
387 switch (cmd) {
388 case TIOCGSERIAL:
389 ret = ircomm_tty_get_serial_info(self, (struct serial_struct __user *) arg);
390 break;
391 case TIOCSSERIAL:
392 ret = ircomm_tty_set_serial_info(self, (struct serial_struct __user *) arg);
393 break;
394 case TIOCMIWAIT:
395 IRDA_DEBUG(0, "(), TIOCMIWAIT, not impl!\n");
396 break;
397
398 case TIOCGICOUNT:
Harvey Harrison0dc47872008-03-05 20:47:47 -0800399 IRDA_DEBUG(0, "%s(), TIOCGICOUNT not impl!\n", __func__ );
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400#if 0
401 save_flags(flags); cli();
402 cnow = driver->icount;
403 restore_flags(flags);
404 p_cuser = (struct serial_icounter_struct __user *) arg;
405 if (put_user(cnow.cts, &p_cuser->cts) ||
406 put_user(cnow.dsr, &p_cuser->dsr) ||
407 put_user(cnow.rng, &p_cuser->rng) ||
408 put_user(cnow.dcd, &p_cuser->dcd) ||
409 put_user(cnow.rx, &p_cuser->rx) ||
410 put_user(cnow.tx, &p_cuser->tx) ||
411 put_user(cnow.frame, &p_cuser->frame) ||
412 put_user(cnow.overrun, &p_cuser->overrun) ||
413 put_user(cnow.parity, &p_cuser->parity) ||
414 put_user(cnow.brk, &p_cuser->brk) ||
415 put_user(cnow.buf_overrun, &p_cuser->buf_overrun))
416 return -EFAULT;
YOSHIFUJI Hideaki6819bc22007-02-09 23:24:53 +0900417#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418 return 0;
419 default:
420 ret = -ENOIOCTLCMD; /* ioctls which we must ignore */
421 }
422 return ret;
423}
424
425
426