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);
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)
{
sl->dev->stats.rx_packets++;
sl->dev->stats.rx_bytes += cf.can_dlc;
-
-
}
/**
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;
}
*/
void sllin_report_error(struct sllin *sl, int err)
{
+ switch (err) {
+ case LIN_ERR_CHECKSUM:
+ sl->dev->stats.rx_crc_errors++;
+ break;
+
+ case LIN_ERR_RX_TIMEOUT:
+ sl->dev->stats.rx_errors++;
+ break;
+ }
+
sllin_send_canfr(sl, 0 | CAN_EFF_FLAG |
(err & ~LIN_ID_MASK), NULL, 0);
}
clear_bit(SLF_MSGEVENT, &sl->flags);
kfree_skb(sl->tx_req_skb);
netif_wake_queue(sl->dev);
+ hrtimer_start(&sl->rx_timer,
+ ktime_add(ktime_get(), sl->rx_timer_timeout),
+ HRTIMER_MODE_ABS);
break;
case SLSTATE_BREAK_SENT:
break;
case SLSTATE_ID_SENT:
+ hrtimer_cancel(&sl->rx_timer);
sl->id_to_send = false;
if (sl->data_to_send) {
sllin_send_tx_buff(sl);
lin_buff = (sl->lin_master) ? sl->tx_buff : sl->rx_buff;
if (cf->can_id == (lin_buff[SLLIN_BUFF_ID] & LIN_ID_MASK)) {
+ hrtimer_cancel(&sl->rx_timer);
+ pr_debug("sllin: received LIN response in a CAN frame.\n");
if (sllin_setup_msg(sl, SLLIN_STPMSG_RESPONLY,
cf->can_id & LIN_ID_MASK,
cf->data, cf->can_dlc) != -1) {
if (sllin_rx_validate(sl) == -1) {
pr_debug("sllin: RX validation failed.\n");
sllin_report_error(sl, LIN_ERR_CHECKSUM);
- /* FIXME tx_stat.err++ */
} else {
/* Send CAN non-RTR frame with data */
pr_debug("sllin: sending NON-RTR CAN"
sl->lin_state = SLSTATE_IDLE;
break;
}
-
-
-
-
- /* sl->dev->stats.tx_packets++; send frames statistic */
- /* netif_wake_queue(sl->dev); allow next Tx packet arrival */
}
hrtimer_cancel(&sl->rx_timer);