]> rtime.felk.cvut.cz Git - linux-lin.git/commitdiff
sllin: Ensure full initialization of all termios flags.
authorRostislav Lisovy <lisovy@gmail.com>
Mon, 19 Dec 2011 12:13:21 +0000 (13:13 +0100)
committerRostislav Lisovy <lisovy@gmail.com>
Mon, 19 Dec 2011 12:13:21 +0000 (13:13 +0100)
sllin/sllin.c

index 7388bb60b42cada46067d2f6ca37cb98fb117b0e..92420f0e3ce0b29a4559ba8fd923cb21edc51ce1 100644 (file)
@@ -188,10 +188,16 @@ static int sltty_change_speed(struct tty_struct *tty, unsigned speed)
        mutex_lock(&tty->termios_mutex);
 
        old_termios = *(tty->termios);
-       cflag = tty->termios->c_cflag;
+
+       cflag = CS8 | CREAD | CLOCAL | HUPCL;
        cflag &= ~(CBAUD | CIBAUD);
        cflag |= BOTHER;
        tty->termios->c_cflag = cflag;
+       tty->termios->c_oflag = 0;
+       tty->termios->c_lflag = 0;
+
+       /* Enable interrupt when UART-Break or Framing error received */
+       tty->termios->c_iflag = BRKINT | INPCK;
 
        tty_encode_baud_rate(tty, speed, speed);
 
@@ -203,7 +209,6 @@ static int sltty_change_speed(struct tty_struct *tty, unsigned speed)
        return 0;
 }
 
-
 /* Send one can_frame to the network layer */
 static void sllin_send_canfr(struct sllin *sl, canid_t id, char *data, int len)
 {
@@ -417,9 +422,11 @@ static void sllin_receive_buf(struct tty_struct *tty,
                if (fp && *fp++) {
                        if (!test_and_set_bit(SLF_ERROR, &sl->flags))
                                sl->dev->stats.rx_errors++;
+
                        pr_debug("sllin: sllin_receive_buf char 0x%02x ignored "
                                "due marker 0x%02x, flags 0x%lx\n",
                                *cp, *(fp-1), sl->flags);
+
                        cp++;
                        continue;
                }