{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
struct net_device_stats *stats = slc_get_stats(sl->dev);
-#else
- struct net_device_stats *stats = &sl->dev->stats;
#endif
struct sk_buff *skb;
struct can_frame cf;
if (strict_strtoul(sl->rbuff+1, 16, &ultmp))
return;
#endif
+
cf.can_id = ultmp;
if (!(cmd & 0x20)) /* NO tiny chars => extended frame format */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
sl->dev->last_rx = jiffies;
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
stats->rx_packets++;
stats->rx_bytes += cf.can_dlc;
+#else
+ sl->dev->stats.rx_packets++;
+ sl->dev->stats.rx_bytes += cf.can_dlc;
+#endif
}
/* parse tty input stream */
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
struct net_device_stats *stats = slc_get_stats(sl->dev);
-#else
- struct net_device_stats *stats = &sl->dev->stats;
#endif
if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */
sl->rbuff[sl->rcount++] = s;
return;
} else {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
stats->rx_over_errors++;
+#else
+ sl->dev->stats.rx_over_errors++;
+#endif
set_bit(SLF_ERROR, &sl->flags);
}
}
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
struct net_device_stats *stats = slc_get_stats(sl->dev);
-#else
- struct net_device_stats *stats = &sl->dev->stats;
#endif
int actual, idx, i;
char cmd;
#endif
sl->xleft = strlen(sl->xbuff) - actual;
sl->xhead = sl->xbuff + actual;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
stats->tx_bytes += cf->can_dlc;
+#else
+ sl->dev->stats.tx_bytes += cf->can_dlc;
+#endif
}
/*
struct slcan *sl = (struct slcan *) tty->disc_data;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
struct net_device_stats *stats = slc_get_stats(sl->dev);
-#else
- struct net_device_stats *stats = &sl->dev->stats;
#endif
/* First make sure we're connected. */
if (sl->xleft <= 0) {
/* Now serial buffer is almost free & we can start
* transmission of another packet */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
stats->tx_packets++;
+#else
+ sl->dev->stats.tx_packets++;
+#endif
clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
netif_wake_queue(sl->dev);
return;
struct slcan *sl = (struct slcan *) tty->disc_data;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
struct net_device_stats *stats = slc_get_stats(sl->dev);
-#else
- struct net_device_stats *stats = &sl->dev->stats;
#endif
if (!sl || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev))
while (count--) {
if (fp && *fp++) {
if (!test_and_set_bit(SLF_ERROR, &sl->flags))
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
stats->rx_errors++;
+#else
+ sl->dev->stats.rx_errors++;
+#endif
cp++;
continue;
}