patch-2.1.18 linux/drivers/net/mkiss.c

Next file: linux/drivers/net/ni52.c
Previous file: linux/drivers/net/hdlcdrv.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.17/linux/drivers/net/mkiss.c linux/drivers/net/mkiss.c
@@ -101,11 +101,11 @@
 
 	for (i = 0; i < ax25_maxdev; i++) {
 		axp = ax25_ctrls[i];
-		
+
 		/* Not allocated ? */
 		if (axp == NULL)
 			break;
-			
+
 		/* Not in use ? */
 		if (!set_bit(AXF_INUSE, &axp->ctrl.flags))
 			break;
@@ -261,9 +261,9 @@
 	struct sk_buff *skb;
 	struct mkiss_channel *mkiss;
 	int count;
-	
+
         tmp_ax = ax;
-                
+
 	if (ax->rbuff[0] > 0x0f) {
 		if (ax->mkiss != NULL) {
 			mkiss= ax->mkiss->tty->driver_data;
@@ -271,7 +271,7 @@
 				tmp_ax = ax->mkiss;
 		}
  	}
- 	
+
 	count = ax->rcount;
 
 	if ((skb = dev_alloc_skb(count)) == NULL) {
@@ -282,7 +282,7 @@
 
 	skb->dev      = tmp_ax->dev;
 	memcpy(skb_put(skb,count), ax->rbuff, count);
-	skb->mac.raw  = skb->data; 
+	skb->mac.raw  = skb->data;
 	skb->protocol = htons(ETH_P_AX25);
 	netif_rx(skb);
 	tmp_ax->rx_packets++;
@@ -307,7 +307,7 @@
 	}
 
 	p = icp;
-	
+
 	if (mkiss->magic  != MKISS_DRIVER_MAGIC) {
 		count = kiss_esc(p, (unsigned char *)ax->xbuff, len);
 		ax->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
@@ -320,7 +320,7 @@
 		count = kiss_esc(p, (unsigned char *) ax->mkiss->xbuff, len);
 		ax->mkiss->tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
 		actual = ax->mkiss->tty->driver.write(ax->mkiss->tty, 0, ax->mkiss->xbuff, count);
-		ax->tx_packets++; 
+		ax->tx_packets++;
 		ax->mkiss->dev->trans_start = jiffies;
 		ax->mkiss->xleft = count - actual;
 		ax->mkiss->xhead = ax->mkiss->xbuff + actual;
@@ -336,7 +336,7 @@
 	int actual;
 	struct ax_disp *ax = (struct ax_disp *)tty->disc_data;
 	struct mkiss_channel *mkiss;
-	
+
 	/* First make sure we're connected. */
 	if (ax == NULL || ax->magic != AX25_MAGIC || !ax->dev->start)
 		return;
@@ -368,14 +368,14 @@
 	struct ax_disp *ax = (struct ax_disp*)dev->priv;
 	struct mkiss_channel *mkiss = ax->tty->driver_data;
 	struct ax_disp *tmp_ax;
-	
+
 	tmp_ax = NULL;
-	
+
 	if (mkiss->magic  == MKISS_DRIVER_MAGIC) {
 		if (skb->data[0] < 0x10)
 			skb->data[0] = skb->data[0] + 0x10;
 		tmp_ax = ax->mkiss;
-	}                
+	}
 
 	if (!dev->start)  {
 		printk(KERN_ERR "%s: xmit call when iface is down\n", dev->name);
@@ -385,13 +385,13 @@
 	if (tmp_ax != NULL)
 		if (tmp_ax->dev->tbusy)
 			return 1;
-	     
-	if (tmp_ax != NULL)     
+
+	if (tmp_ax != NULL)
 		if (dev->tbusy) {
 			printk(KERN_ERR "mkiss: dev busy while serial dev is free\n");
 			ax_unlock(ax);
 	        }
-	        
+
 	if (dev->tbusy) {
 		/*
 		 * May be we must check transmitter timeout here ?
@@ -410,7 +410,7 @@
 		ax->tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
 		ax_unlock(ax);
 	}
-	
+
 	/* We were not busy, so we are now... :-) */
 	if (skb != NULL) {
 		ax_lock(ax);
@@ -585,7 +585,7 @@
 	if (tty->ldisc.flush_buffer)
 		tty->ldisc.flush_buffer(tty);
 
-	/* Restore default settings */	
+	/* Restore default settings */
 	ax->dev->type = ARPHRD_AX25;
 
 	/* Perform the low-level AX25 initialization. */
@@ -612,7 +612,7 @@
 		ax->mkiss     = tmp_ax;
 		tmp_ax->mkiss = ax;
 	}
-	
+
 	MOD_INC_USE_COUNT;
 
 	/* Done.  We have linked the TTY line to a channel. */
@@ -630,7 +630,7 @@
 
 	mkiss = ax->mode;
 	dev_close(ax->dev);
-	
+
 	tty->disc_data = 0;
 	ax->tty        = NULL;
 
@@ -783,7 +783,7 @@
 		case SIOCGIFENCAP:
 			if ((err = verify_area(VERIFY_WRITE, arg, sizeof(int))) != 0)
 				return err;
-			put_user(4, (int *)arg); 
+			put_user(4, (int *)arg);
 			return 0;
 
 		case SIOCSIFENCAP:
@@ -820,12 +820,12 @@
 	int status;
 
 	if (ax25_maxdev < 4) ax25_maxdev = 4; /* Sanity */
-	
+
 	if ((ax25_ctrls = (ax25_ctrl_t **)kmalloc(sizeof(void*) * ax25_maxdev, GFP_KERNEL)) == NULL) {
 		printk(KERN_ERR "mkiss: Can't allocate ax25_ctrls[] array !  No mkiss available\n");
 		return -ENOMEM;
 	}
-	
+
 	/* Clear the pointer array, we allocate devices when we need them */
 	memset(ax25_ctrls, 0, sizeof(void*) * ax25_maxdev); /* Pointers */
 
@@ -879,7 +879,7 @@
 	memset(ax, 0, sizeof (struct ax_disp));
 	ax->magic  = AX25_MAGIC;
 	ax->dev	   = dev;
-	
+
 	/* Finish setting up the DEVICE info. */
 	dev->mtu             = AX_MTU;
 	dev->hard_start_xmit = ax_xmit;
@@ -919,7 +919,7 @@
 static int mkiss_open(struct tty_struct *tty, struct file *filp)
 {
 	struct mkiss_channel *mkiss;
-	int chan;	 	 
+	int chan;
 
 	chan = MINOR(tty->device) - tty->driver.minor_start;
 
@@ -966,11 +966,11 @@
 		case TIOCMGET:
 		case TIOCMBIS:
 		case TIOCMBIC:
-		case TIOCMSET:		
+		case TIOCMSET:
 		case TCSETS:
 		case TCSETSF:		/* should flush first, but... */
 		case TCSETSW:		/* should wait until flush, but... */
-			return 0;		
+			return 0;
 		default:
 			return -ENOIOCTLCMD;
 	}
@@ -980,7 +980,7 @@
 static void mkiss_dummy(struct tty_struct *tty)
 {
 	struct mkiss_channel *mkiss = tty->driver_data;
-	
+
 	if (tty == NULL)
 		return;
 
@@ -991,7 +991,7 @@
 static void mkiss_dummy2(struct tty_struct *tty, unsigned char ch)
 {
 	struct mkiss_channel *mkiss = tty->driver_data;
-	
+
 	if (tty == NULL)
 		return;
 
@@ -1043,7 +1043,7 @@
 
 	mkiss_driver.magic       = MKISS_DRIVER_MAGIC;
 	mkiss_driver.name        = "mkiss";
-	mkiss_driver.major       = MKISS_MAJOR;		
+	mkiss_driver.major       = MKISS_MAJOR;
 	mkiss_driver.minor_start = 0;
 	mkiss_driver.num         = NR_MKISS;
 	mkiss_driver.type        = TTY_DRIVER_TYPE_SERIAL;
@@ -1074,25 +1074,24 @@
 	mkiss_driver.stop         = mkiss_dummy;
 	mkiss_driver.start        = mkiss_dummy;
 	mkiss_driver.hangup       = mkiss_dummy;
-	mkiss_driver.flush_chars  = mkiss_dummy;        
-	mkiss_driver.put_char     = mkiss_dummy2;        
-       
+	mkiss_driver.flush_chars  = mkiss_dummy;
+	mkiss_driver.put_char     = mkiss_dummy2;
+
 	if (tty_register_driver(&mkiss_driver)) {
 		printk(KERN_ERR "Couldn't register Mkiss device\n");
-		return -EIO;		           
-	}                                
+		return -EIO;
+	}
 
 	printk(KERN_INFO "AX.25 Multikiss device enabled\n");
 
-	return 0;		
+	return 0;
 }
 
 #ifdef MODULE
+EXPORT_NO_SYMBOLS;
 
 int init_module(void)
 {
-	register_symtab(NULL);
-
 	return mkiss_init_ctrl_dev();
 }
 
@@ -1106,7 +1105,7 @@
 				/*
 				 * VSV = if dev->start==0, then device
 				 * unregistred while close proc.
-				 */ 
+				 */
 				if (ax25_ctrls[i]->dev.start)
 					unregister_netdev(&(ax25_ctrls[i]->dev));
 
@@ -1119,11 +1118,11 @@
 		ax25_ctrls = NULL;
 	}
 
-	if ((i = tty_register_ldisc(N_AX25, NULL)))  
+	if ((i = tty_register_ldisc(N_AX25, NULL)))
 		printk(KERN_ERR "mkiss: can't unregister line discipline (err = %d)\n", i);
 
 	if (tty_unregister_driver(&mkiss_driver))	/* remove devive */
 		printk(KERN_ERR "mkiss: can't unregister MKISS device\n");
 }
- 
+
 #endif /* MODULE */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov