epca: Restore driver
authorAlan Cox <alan@redhat.com>
Tue, 22 Jul 2008 10:18:12 +0000 (11:18 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Jul 2008 20:03:28 +0000 (13:03 -0700)
Convert the driver to use the added hardware break support

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/Kconfig
drivers/char/epca.c

index a185263..9ead63c 100644 (file)
@@ -167,7 +167,7 @@ config CYZ_INTR
 
 config DIGIEPCA
        tristate "Digiboard Intelligent Async Support"
-       depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI) && BROKEN
+       depends on SERIAL_NONSTANDARD && (ISA || EISA || PCI)
        ---help---
          This is a driver for Digi International's Xx, Xeve, and Xem series
          of cards which provide multiple serial ports. You would need
index 94dca7b..9d9ae1c 100644 (file)
@@ -184,7 +184,7 @@ static void pc_stop(struct tty_struct *);
 static void pc_start(struct tty_struct *);
 static void pc_throttle(struct tty_struct *tty);
 static void pc_unthrottle(struct tty_struct *tty);
-static void digi_send_break(struct channel *ch, int msec);
+static int pc_send_break(struct tty_struct *tty, int msec);
 static void setup_empty_event(struct tty_struct *tty, struct channel *ch);
 static void epca_setup(char *, int *);
 
@@ -1040,6 +1040,7 @@ static const struct tty_operations pc_ops = {
        .throttle = pc_throttle,
        .unthrottle = pc_unthrottle,
        .hangup = pc_hangup,
+       .break_ctl = pc_send_break
 };
 
 static int info_open(struct tty_struct *tty, struct file *filp)
@@ -1132,7 +1133,7 @@ static int __init pc_init(void)
        pc_driver->init_termios.c_lflag = 0;
        pc_driver->init_termios.c_ispeed = 9600;
        pc_driver->init_termios.c_ospeed = 9600;
-       pc_driver->flags = TTY_DRIVER_REAL_RAW;
+       pc_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_HARDWARE_BREAK;
        tty_set_operations(pc_driver, &pc_ops);
 
        pc_info->owner = THIS_MODULE;
@@ -2177,7 +2178,6 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file,
                                        unsigned int cmd, unsigned long arg)
 {
        digiflow_t dflow;
-       int retval;
        unsigned long flags;
        unsigned int mflag, mstat;
        unsigned char startc, stopc;
@@ -2190,31 +2190,6 @@ static int pc_ioctl(struct tty_struct *tty, struct file *file,
        else
                return -EINVAL;
        switch (cmd) {
-       case TCSBRK:    /* SVID version: non-zero arg --> no break */
-               retval = tty_check_change(tty);
-               if (retval)
-                       return retval;
-               /* Setup an event to indicate when the transmit
-                  buffer empties */
-               spin_lock_irqsave(&epca_lock, flags);
-               setup_empty_event(tty, ch);
-               spin_unlock_irqrestore(&epca_lock, flags);
-               tty_wait_until_sent(tty, 0);
-               if (!arg)
-                       digi_send_break(ch, HZ / 4);    /* 1/4 second */
-               return 0;
-       case TCSBRKP:   /* support for POSIX tcsendbreak() */
-               retval = tty_check_change(tty);
-               if (retval)
-                       return retval;
-               /* Setup an event to indicate when the transmit buffer
-                  empties */
-               spin_lock_irqsave(&epca_lock, flags);
-               setup_empty_event(tty, ch);
-               spin_unlock_irqrestore(&epca_lock, flags);
-               tty_wait_until_sent(tty, 0);
-               digi_send_break(ch, arg ? arg*(HZ/10) : HZ/4);
-               return 0;
        case TIOCMODG:
                mflag = pc_tiocmget(tty, file);
                if (put_user(mflag, (unsigned long __user *)argp))
@@ -2500,10 +2475,14 @@ static void pc_unthrottle(struct tty_struct *tty)
        }
 }
 
-static void digi_send_break(struct channel *ch, int msec)
+static int pc_send_break(struct tty_struct *tty, int msec)
 {
+       struct channel *ch = (struct channel *) tty->driver_data;
        unsigned long flags;
 
+       if (msec == -1)
+               return -EOPNOTSUPP;
+
        spin_lock_irqsave(&epca_lock, flags);
        globalwinon(ch);
        /*
@@ -2516,6 +2495,7 @@ static void digi_send_break(struct channel *ch, int msec)
        fepcmd(ch, SENDBREAK, msec, 0, 10, 0);
        memoff(ch);
        spin_unlock_irqrestore(&epca_lock, flags);
+       return 0;
 }
 
 /* Caller MUST hold the lock */