From: hartkopp Date: Fri, 16 Apr 2010 19:03:14 +0000 (+0000) Subject: As Stephen Hellriegel pointed out in X-Git-Url: https://rtime.felk.cvut.cz/gitweb/socketcan-devel.git/commitdiff_plain/2d59ba8eb3d5c7e2059de336a88caa9233f10be2 As Stephen Hellriegel pointed out in https://lists.berlios.de/pipermail/socketcan-users/2010-April/001378.html it does not make sense to monitor the tx data flow in the slcan driver as we do not know anything about the CAN specific problems that may occur in the slcan device. Therefore we just wait until the ASCII data is sent on the serial line without having a separate timeout handler in the slcan driver. git-svn-id: svn://svn.berlios.de//socketcan/trunk@1168 030b6a49-0b11-0410-94ab-b0dab22257f2 --- diff --git a/kernel/2.6/drivers/net/can/slcan.c b/kernel/2.6/drivers/net/can/slcan.c index eec61d0..a71774b 100644 --- a/kernel/2.6/drivers/net/can/slcan.c +++ b/kernel/2.6/drivers/net/can/slcan.c @@ -124,7 +124,6 @@ module_param(debug, int, S_IRUGO); * to use the slcan driver with an existing kernel. */ -#define SLC_CHECK_TRANSMIT #define SLCAN_MAGIC 0x53CA static int maxdev = 10; /* MAX number of SLCAN channels; @@ -386,9 +385,6 @@ static void slc_encaps(struct slcan *sl, struct can_frame *cf) actual = sl->tty->driver->write(sl->tty, sl->xbuff, strlen(sl->xbuff)); #else actual = sl->tty->ops->write(sl->tty, sl->xbuff, strlen(sl->xbuff)); -#endif -#ifdef SLC_CHECK_TRANSMIT - sl->dev->trans_start = jiffies; #endif sl->xleft = strlen(sl->xbuff) - actual; sl->xhead = sl->xbuff + actual; @@ -431,40 +427,6 @@ static void slcan_write_wakeup(struct tty_struct *tty) sl->xhead += actual; } -static void slc_tx_timeout(struct net_device *dev) -{ - struct slcan *sl = netdev_priv(dev); - - spin_lock(&sl->lock); - - if (netif_queue_stopped(dev)) { - if (!netif_running(dev)) - goto out; - - /* May be we must check transmitter timeout here ? - * 14 Oct 1994 Dmitry Gorodchanin. - */ -#ifdef SLC_CHECK_TRANSMIT - if (time_before(jiffies, dev->trans_start + 20 * HZ)) { - /* 20 sec timeout not reached */ - goto out; - } - printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26) - (sl->tty->driver->chars_in_buffer(sl->tty) || sl->xleft) -#else - (tty_chars_in_buffer(sl->tty) || sl->xleft) -#endif - ? "bad line quality" : "driver error"); - sl->xleft = 0; - sl->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); - netif_wake_queue(sl->dev); -#endif - } -out: - spin_unlock(&sl->lock); -} - /****************************************** * Routines looking at netdevice side. @@ -554,9 +516,6 @@ static const struct net_device_ops slc_netdev_ops = { .ndo_open = slc_open, .ndo_stop = slc_close, .ndo_start_xmit = slc_xmit, -#ifdef SLC_CHECK_TRANSMIT - .ndo_tx_timeout = slc_tx_timeout, -#endif }; #endif @@ -585,12 +544,6 @@ static void slc_setup(struct net_device *dev) dev->mtu = sizeof(struct can_frame); dev->type = ARPHRD_CAN; -#ifdef SLC_CHECK_TRANSMIT -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,28) - dev->tx_timeout = slc_tx_timeout; -#endif - dev->watchdog_timeo = 20*HZ; -#endif /* New-style flags. */ dev->flags = IFF_NOARP;