*
* This file is derived from linux/drivers/net/slip.c
*
* slip.c Authors : Laurence Culhane <loz@holmes.demon.co.uk>
* Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
*
* This file is derived from linux/drivers/net/slip.c
*
* slip.c Authors : Laurence Culhane <loz@holmes.demon.co.uk>
* Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
/* maximum rx buffer len: extended CAN frame with timestamp */
#define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1)
/* maximum rx buffer len: extended CAN frame with timestamp */
#define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1)
* <type> <id> <dlc> <data>*
*
* Extended frames (29 bit) are defined by capital characters in the type.
* <type> <id> <dlc> <data>*
*
* Extended frames (29 bit) are defined by capital characters in the type.
************************************************************************/
static int asc2nibble(char c)
************************************************************************/
static int asc2nibble(char c)
{
if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */
if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
(sl->rcount > 4)) {
{
if ((s == '\r') || (s == '\a')) { /* CR or BEL ends the pdu */
if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
(sl->rcount > 4)) {
************************************************************************/
/* Encapsulate one can_frame and stuff into a TTY queue. */
************************************************************************/
/* Encapsulate one can_frame and stuff into a TTY queue. */
* Called by the driver when there's room for more data. If we have
* more packets to send, we send them here.
*/
* Called by the driver when there's room for more data. If we have
* more packets to send, we send them here.
*/
-/* Hook the destructor so we can free slcan devs at the right point in time */
-static void slc_free_netdev(struct net_device *dev)
+/* Hook the destructor so we can free sllin devs at the right point in time */
+static void sll_free_netdev(struct net_device *dev)
-static const struct net_device_ops slc_netdev_ops = {
- .ndo_open = slc_open,
- .ndo_stop = slc_close,
- .ndo_start_xmit = slc_xmit,
+static const struct net_device_ops sll_netdev_ops = {
+ .ndo_open = sll_open,
+ .ndo_stop = sll_close,
+ .ndo_start_xmit = sll_xmit,
/*
* Handle the 'receiver data ready' interrupt.
* This function is called by the 'tty_io' module in the kernel when
/*
* Handle the 'receiver data ready' interrupt.
* This function is called by the 'tty_io' module in the kernel when
* and sent on to some IP layer for further processing. This will not
* be re-entered while running but other ldisc functions may be called
* in parallel
*/
* and sent on to some IP layer for further processing. This will not
* be re-entered while running but other ldisc functions may be called
* in parallel
*/
-/* Find a free SLCAN channel, and link in this `tty' line. */
-static struct slcan *slc_alloc(dev_t line)
+/* Find a free SLLIN channel, and link in this `tty' line. */
+static struct sllin *sll_alloc(dev_t line)
if (test_bit(SLF_INUSE, &sl->flags)) {
unregister_netdevice(dev);
dev = NULL;
if (test_bit(SLF_INUSE, &sl->flags)) {
unregister_netdevice(dev);
dev = NULL;
* This means flushing out any pending queues, and then returning. This
* call is serialized against other ldisc functions.
*
* We also use this method for a hangup event.
*/
* This means flushing out any pending queues, and then returning. This
* call is serialized against other ldisc functions.
*
* We also use this method for a hangup event.
*/
-/* Perform I/O control on an active SLCAN channel. */
-static int slcan_ioctl(struct tty_struct *tty, struct file *file,
+/* Perform I/O control on an active SLLIN channel. */
+static int sllin_ioctl(struct tty_struct *tty, struct file *file,
- .name = "slcan",
- .open = slcan_open,
- .close = slcan_close,
- .hangup = slcan_hangup,
- .ioctl = slcan_ioctl,
- .receive_buf = slcan_receive_buf,
- .write_wakeup = slcan_write_wakeup,
+ .name = "sllin",
+ .open = sllin_open,
+ .close = sllin_close,
+ .hangup = sllin_hangup,
+ .ioctl = sllin_ioctl,
+ .receive_buf = sllin_receive_buf,
+ .write_wakeup = sllin_write_wakeup,
- slcan_devs = kzalloc(sizeof(struct net_device *)*maxdev, GFP_KERNEL);
- if (!slcan_devs) {
- printk(KERN_ERR "slcan: can't allocate slcan device array!\n");
+ sllin_devs = kzalloc(sizeof(struct net_device *)*maxdev, GFP_KERNEL);
+ if (!sllin_devs) {
+ printk(KERN_ERR "sllin: can't allocate sllin device array!\n");