X-Git-Url: http://rtime.felk.cvut.cz/gitweb/linux-lin.git/blobdiff_plain/e2414b4fbb15520fe38c8319e5fb7c3fe5e1b679..7b1241d0725b0f98d0494120d7fe7913c63ef91a:/sllin/sllin.c diff --git a/sllin/sllin.c b/sllin/sllin.c index 3e020b1..e05564c 100644 --- a/sllin/sllin.c +++ b/sllin/sllin.c @@ -62,6 +62,7 @@ #include #include #include +#include #include "linux/lin_bus.h" /* Should be in include/linux/tty.h */ @@ -206,22 +207,31 @@ const unsigned char sllin_id_parity_table[] = { */ static int sltty_change_speed(struct tty_struct *tty, unsigned speed) { - struct ktermios old_termios; + struct ktermios old_termios, termios; int cflag; mutex_lock(&tty->termios_mutex); - old_termios = *(tty->termios); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) + old_termios = termios = *(tty->termios); +#else + old_termios = termios = tty->termios; +#endif 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; + termios.c_cflag = cflag; + termios.c_oflag = 0; + termios.c_lflag = 0; /* Enable interrupt when UART-Break or Framing error received */ - tty->termios->c_iflag = BRKINT | INPCK; + termios.c_iflag = BRKINT | INPCK; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) + *(tty->termios) = termios; +#else + tty->termios = termios; +#endif tty_encode_baud_rate(tty, speed, speed);