From: Rostislav Lisovy Date: Fri, 25 Nov 2011 10:56:01 +0000 (+0100) Subject: Merge branch 'master' of ssh://rtime.felk.cvut.cz/lisovros/pcan_lin X-Git-Url: http://rtime.felk.cvut.cz/gitweb/linux-lin.git/commitdiff_plain/da4c52f4818f9b7353cdda054272fcf191366bac?hp=-c Merge branch 'master' of ssh://rtime.felk.cvut.cz/lisovros/pcan_lin --- da4c52f4818f9b7353cdda054272fcf191366bac diff --combined sllin/sllin.c index a0bb1e5,d177f54..bfa5dc5 --- a/sllin/sllin.c +++ b/sllin/sllin.c @@@ -123,6 -123,7 +123,6 @@@ struct sllin #define SLF_TXEVENT 3 /* Tx wake event */ #define SLF_MSGEVENT 4 /* CAN message to sent */ - unsigned char leased; dev_t line; struct task_struct *kwthread; wait_queue_head_t kwt_wq; @@@ -147,9 -148,15 +147,15 @@@ static int sltty_change_speed(struct tt int cflag; mutex_lock(&tty->termios_mutex); + old_termios = *(tty->termios); cflag = tty->termios->c_cflag; + cflag &= ~(CBAUD | CIBAUD); + cflag |= BOTHER; + tty->termios->c_cflag = cflag; + tty_encode_baud_rate(tty, speed, speed); + if (tty->ops->set_termios) tty->ops->set_termios(tty, &old_termios); //priv->io.speed = speed; @@@ -248,7 -255,7 +254,7 @@@ static void sll_encaps(struct sllin *sl pr_debug("sllin: %s() RTR CAN frame\n", __FUNCTION__); lframe[2] = (u8)cf->can_id; /* Get one byte LIN ID */ - sltty_change_speed(tty, sl->lin_baud / 2); + sltty_change_speed(tty, sl->lin_baud * 2 / 3); tty->ops->write(tty, &lframe[0], 1); sltty_change_speed(tty, sl->lin_baud); tty->ops->write(tty, &lframe[1], 1); @@@ -440,6 -447,8 +446,8 @@@ static void sllin_receive_buf(struct tt if (fp && *fp++) { if (!test_and_set_bit(SLF_ERROR, &sl->flags)) sl->dev->stats.rx_errors++; + printk(KERN_INFO "sllin_receive_buf char 0x%02x ignored due marker 0x%02x, flags 0x%lx\n", + *cp, *(fp-1), sl->flags); cp++; continue; } @@@ -651,7 -660,7 +659,7 @@@ static void sll_sync(void break; sl = netdev_priv(dev); - if (sl->tty || sl->leased) + if (sl->tty) continue; if (dev->flags & IFF_UP) dev_close(dev); @@@ -825,6 -834,8 +833,6 @@@ static void sllin_close(struct tty_stru tty->disc_data = NULL; sl->tty = NULL; - if (!sl->leased) - sl->line = 0; /* Flush network side */ unregister_netdev(sl->dev);