#define SLF_TXEVENT 3 /* Tx wake event */
#define SLF_MSGEVENT 4 /* CAN message to sent */
- unsigned char leased;
dev_t line;
struct task_struct *kwthread;
wait_queue_head_t kwt_wq;
sl->tx_lim = SLLIN_BUFF_DATA;
if ((data != NULL) && len) {
+ int i;
+ unsigned csum = 0;
+
sl->tx_lim += len;
memcpy(sl->tx_buff + SLLIN_BUFF_DATA, data, len);
+ /* compute data parity there */
+ for (i = SLLIN_BUFF_DATA; i < sl->tx_lim; i++) {
+ csum += sl->tx_buff[i];
+ if (csum > 255)
+ csum -= 255;
+ }
+
+ sl->tx_buff[sl->tx_lim++] = csum;
}
- sl->rx_lim += len;
+ if (len != 0)
+ sl->rx_lim += len + 1;
return 0;
}
break;
sl = netdev_priv(dev);
- if (sl->tty || sl->leased)
+ if (sl->tty)
continue;
if (dev->flags & IFF_UP)
dev_close(dev);
tty->disc_data = NULL;
sl->tty = NULL;
- if (!sl->leased)
- sl->line = 0;
/* Flush network side */
unregister_netdev(sl->dev);