+ /* nothing */
+}
+
+static struct {
+ int cmd;
+ char *level;
+ char *name;
+} tty_ioctls[] = {
+ /* don't print these, they flood the log ... */
+ { TCGETS, NULL, "TCGETS" },
+ { TCSETS, NULL, "TCSETS" },
+ { TCSETSW, NULL, "TCSETSW" },
+ { TCFLSH, NULL, "TCFLSH" },
+ { TCSBRK, NULL, "TCSBRK" },
+
+ /* general tty stuff */
+ { TCSETSF, KERN_DEBUG, "TCSETSF" },
+ { TCGETA, KERN_DEBUG, "TCGETA" },
+ { TIOCMGET, KERN_DEBUG, "TIOCMGET" },
+ { TCSBRKP, KERN_DEBUG, "TCSBRKP" },
+ { TIOCMSET, KERN_DEBUG, "TIOCMSET" },
+
+ /* linux-specific ones */
+ { TIOCLINUX, KERN_INFO, "TIOCLINUX" },
+ { KDGKBMODE, KERN_INFO, "KDGKBMODE" },
+ { KDGKBTYPE, KERN_INFO, "KDGKBTYPE" },
+ { KDSIGACCEPT, KERN_INFO, "KDSIGACCEPT" },
+};
+
+int line_ioctl(struct tty_struct *tty, struct file * file,
+ unsigned int cmd, unsigned long arg)
+{
+ int ret;
+ int i;
+
+ ret = 0;
+ switch(cmd) {
+#ifdef TIOCGETP
+ case TIOCGETP:
+ case TIOCSETP:
+ case TIOCSETN:
+#endif
+#ifdef TIOCGETC
+ case TIOCGETC:
+ case TIOCSETC:
+#endif
+#ifdef TIOCGLTC
+ case TIOCGLTC:
+ case TIOCSLTC:
+#endif
+ case TCGETS:
+ case TCSETSF:
+ case TCSETSW:
+ case TCSETS:
+ case TCGETA:
+ case TCSETAF:
+ case TCSETAW:
+ case TCSETA:
+ case TCXONC:
+ case TCFLSH:
+ case TIOCOUTQ:
+ case TIOCINQ:
+ case TIOCGLCKTRMIOS:
+ case TIOCSLCKTRMIOS:
+ case TIOCPKT:
+ case TIOCGSOFTCAR:
+ case TIOCSSOFTCAR:
+ return -ENOIOCTLCMD;
+#if 0
+ case TCwhatever:
+ /* do something */
+ break;
+#endif
+ default:
+ for (i = 0; i < ARRAY_SIZE(tty_ioctls); i++)
+ if (cmd == tty_ioctls[i].cmd)
+ break;
+ if (i < ARRAY_SIZE(tty_ioctls)) {
+ if (NULL != tty_ioctls[i].level)
+ printk("%s%s: %s: ioctl %s called\n",
+ tty_ioctls[i].level, __FUNCTION__,
+ tty->name, tty_ioctls[i].name);
+ } else {
+ printk(KERN_ERR "%s: %s: unknown ioctl: 0x%x\n",
+ __FUNCTION__, tty->name, cmd);
+ }
+ ret = -ENOIOCTLCMD;
+ break;
+ }
+ return ret;
+}
+
+void line_throttle(struct tty_struct *tty)
+{
+ struct line *line = tty->driver_data;
+
+ deactivate_chan(&line->chan_list, line->driver->read_irq);
+ line->throttled = 1;
+}
+
+void line_unthrottle(struct tty_struct *tty)
+{
+ struct line *line = tty->driver_data;
+
+ line->throttled = 0;
+ chan_interrupt(&line->chan_list, &line->task, tty,
+ line->driver->read_irq);
+
+ /* Maybe there is enough stuff pending that calling the interrupt
+ * throttles us again. In this case, line->throttled will be 1
+ * again and we shouldn't turn the interrupt back on.
+ */
+ if(!line->throttled)
+ reactivate_chan(&line->chan_list, line->driver->read_irq);
+}
+
+static irqreturn_t line_write_interrupt(int irq, void *data,
+ struct pt_regs *unused)
+{
+ struct chan *chan = data;
+ struct line *line = chan->line;
+ struct tty_struct *tty = line->tty;