switch (ax->crcmode) { unsigned short crc; 
if ((*p & 0x0f) != 0) { /* Configuration Command (kissparms(1). * Protocol spec says: never append CRC. * This fixes a very old bug in the linux * kiss driver. -- dl9sau */ switch (*p & 0xff) { case 0x85: /* command from userspace especially for us, * not for delivery to the tnc */ if (len > 1) { int cmd = (p[1] & 0xff); switch(cmd) { case 3: ax->crcmode = CRC_MODE_SMACK; break; case 2: ax->crcmode = CRC_MODE_FLEX; break; case 1: ax->crcmode = CRC_MODE_NONE; break; case 0: default: ax->crcmode = CRC_MODE_SMACK_TEST; cmd = 0; } ax->crcauto = (cmd ? 0 : 1); printk(KERN_INFO "mkiss: %s: crc mode %s %d\n", ax->dev->name, (len) ? "set to" : "is", cmd); } spin_unlock_bh(&ax->buflock); netif_start_queue(dev); 
static void ax_encaps(struct net_device *dev, unsigned char *icp, int len){	struct mkiss *ax = netdev_priv(dev);	unsigned char *p;	int actual, count;	if (ax->mtu != ax->dev->mtu + 73)	/* Someone has been ifconfigging */		ax_changedmtu(ax);	if (len > ax->mtu) {		/* Sigh, shouldn't occur BUT ... */		len = ax->mtu;		printk(KERN_ERR "mkiss: %s: truncating oversized transmit packet!\n", ax->dev->name);		ax->stats.tx_dropped++;		netif_start_queue(dev);		return;	}	p = icp;	spin_lock_bh(&ax->buflock);        switch (ax->crcmode) {	         unsigned short crc;	case CRC_MODE_FLEX:	         *p |= 0x20;	         crc = calc_crc_flex(p, len);		 count = kiss_esc_crc(p, (unsigned char *)ax->xbuff, crc, len+2);		 break;	default:	         count = kiss_esc(p, (unsigned char *)ax->xbuff, len);		 break;	}		set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags);	actual = ax->tty->driver->write(ax->tty, ax->xbuff, count);	ax->stats.tx_packets++;	ax->stats.tx_bytes += actual;	ax->dev->trans_start = jiffies;	ax->xleft = count - actual;	ax->xhead = ax->xbuff + actual;	spin_unlock_bh(&ax->buflock);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5793f4be23f0171b4999ca68a39a9157b44139f3/mkiss.c/clean/drivers/net/hamradio/mkiss.c