sllin0 8 [0] remote request
sllin0 2000 [0]
+$ ip -s link show dev sllin0
+14: sllin0: <NOARP,UP,LOWER_UP> mtu 16 qdisc pfifo_fast state UNKNOWN qlen 10
+ link/can
+ RX: bytes packets errors dropped overrun mcast
+ 2 4 1 0 0 0
+ TX: bytes packets errors dropped carrier collsns
+ 0 4 0 0 0 0
+
+
# ----- Configure frame cache -----
# Configure frame cache to answer on LIN ID = 8
sl->dev->stats.rx_packets++;
sl->dev->stats.rx_bytes += cf.can_dlc;
-
-
}
/**
*/
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);
}
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);